mirror of
https://github.com/edward-shen/MMM-pages.git
synced 2025-06-03 09:43:36 -07:00
chore: review ESLint config and add markdown linting
This commit is contained in:
parent
6a84961a36
commit
5b6abc66e9
4 changed files with 1176 additions and 33 deletions
4
.github/ISSUE_TEMPLATE/Bug_report.md
vendored
4
.github/ISSUE_TEMPLATE/Bug_report.md
vendored
|
@ -26,7 +26,7 @@ have aptly described your issue in words, feel free to ignore/delete this sectio
|
||||||
**Please fill out the following information;**
|
**Please fill out the following information;**
|
||||||
|
|
||||||
- Node version: [This can be obtained by running `node -v` in your terminal]
|
- Node version: [This can be obtained by running `node -v` in your terminal]
|
||||||
- Have you updated to the latest MagicMirror core? [yes/no]
|
- Have you updated to the latest MagicMirror core? (yes/no)
|
||||||
- Please post the relevant part of your config file here:
|
- Please post the relevant part of your config file here:
|
||||||
|
|
||||||
```json
|
```json
|
||||||
|
@ -35,7 +35,7 @@ have aptly described your issue in words, feel free to ignore/delete this sectio
|
||||||
|
|
||||||
- Please post any errors you see about MMM-pages in the console (Hit F12 > Console when the MagicMirror window is focused), or write **None** if there aren't any:
|
- Please post any errors you see about MMM-pages in the console (Hit F12 > Console when the MagicMirror window is focused), or write **None** if there aren't any:
|
||||||
|
|
||||||
```
|
```bash
|
||||||
(Paste the error here)
|
(Paste the error here)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
@ -1,13 +1,14 @@
|
||||||
import eslintPluginJs from '@eslint/js';
|
import { defineConfig } from 'eslint/config';
|
||||||
import eslintPluginStylistic from '@stylistic/eslint-plugin';
|
|
||||||
import globals from 'globals';
|
import globals from 'globals';
|
||||||
|
import js from '@eslint/js';
|
||||||
|
import markdown from '@eslint/markdown';
|
||||||
|
import stylistic from '@stylistic/eslint-plugin';
|
||||||
|
|
||||||
const config = [
|
export default defineConfig([
|
||||||
eslintPluginJs.configs.recommended,
|
|
||||||
eslintPluginStylistic.configs.recommended,
|
|
||||||
{
|
{
|
||||||
files: ['**/*.js', '**/*.mjs'],
|
files: ['**/*.js'],
|
||||||
languageOptions: {
|
languageOptions: {
|
||||||
|
ecmaVersion: 'latest',
|
||||||
globals: {
|
globals: {
|
||||||
...globals.browser,
|
...globals.browser,
|
||||||
Log: 'readonly',
|
Log: 'readonly',
|
||||||
|
@ -16,14 +17,30 @@ const config = [
|
||||||
module: 'readonly',
|
module: 'readonly',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
plugins: { js, stylistic },
|
||||||
|
extends: ['js/recommended', 'stylistic/recommended'],
|
||||||
rules: {
|
rules: {
|
||||||
'@stylistic/brace-style': ['error', '1tbs', { allowSingleLine: true }],
|
'@stylistic/brace-style': ['error', '1tbs', { allowSingleLine: true }],
|
||||||
'@stylistic/comma-dangle': ['error', 'only-multiline'],
|
'@stylistic/comma-dangle': ['error', 'only-multiline'],
|
||||||
'@stylistic/max-statements-per-line': ['error', { max: 2 }],
|
'@stylistic/max-statements-per-line': ['error', { max: 2 }],
|
||||||
'@stylistic/semi': ['error', 'always'],
|
'@stylistic/semi': ['error', 'always'],
|
||||||
'object-shorthand': ['error', 'always']
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
files: ['**/*.mjs'],
|
||||||
|
languageOptions: {
|
||||||
|
ecmaVersion: 'latest',
|
||||||
|
globals: {
|
||||||
|
...globals.node,
|
||||||
|
},
|
||||||
|
sourceType: 'module'
|
||||||
},
|
},
|
||||||
}
|
plugins: { js, stylistic },
|
||||||
];
|
extends: ['js/recommended', 'stylistic/recommended'],
|
||||||
|
rules: {
|
||||||
export default config;
|
'@stylistic/comma-dangle': ['error', 'only-multiline'],
|
||||||
|
'@stylistic/semi': ['error', 'always'],
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ files: ['**/*.md'], plugins: { markdown }, language: 'markdown/gfm', extends: ['markdown/recommended'] },
|
||||||
|
]);
|
||||||
|
|
1165
package-lock.json
generated
1165
package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
@ -25,6 +25,7 @@
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@eslint/js": "^9.23.0",
|
"@eslint/js": "^9.23.0",
|
||||||
|
"@eslint/markdown": "^6.4.0",
|
||||||
"@stylistic/eslint-plugin": "^4.2.0",
|
"@stylistic/eslint-plugin": "^4.2.0",
|
||||||
"eslint": "^9.23.0",
|
"eslint": "^9.23.0",
|
||||||
"globals": "^16.0.0"
|
"globals": "^16.0.0"
|
||||||
|
|
Loading…
Reference in a new issue