-
Notifications
You must be signed in to change notification settings - Fork 13
/
eslint.config.mjs
28 lines (27 loc) 路 1.51 KB
/
eslint.config.mjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import js from '@eslint/js';
import globals from 'globals';
import eslintPluginJsonSchemaValidator from 'eslint-plugin-json-schema-validator';
export default [
js.configs.recommended,
{ ignores: ['**/*.min.js'] },
{
rules: {
'indent': 'off', 'no-unexpected-multiline': 'off', 'key-spacing': 'off', // allow whitespace anywhere
'semi': ['error', 'always'], // enforce semicolons at end of statement
'quotes': ['error', 'single'], // enforce single quotes for string literals
'comma-dangle': ['error', 'never'], // enforce no trailing commas in arrays or objects
'no-async-promise-executor': 'off', // allow promise executor functions to be async (to accomodate await lines)
'no-constant-condition': 'off', // allow constant conditions
'no-empty': 'off', // allow empty blocks
'no-inner-declarations': 'off', // allow function declarations anywhere
'no-useless-escape': 'off', // allow all escape chars cause ESLint sucks at detecting truly useless ones
'no-unused-vars': ['error', { 'caughtErrors': 'none' }] // allow unused named args in catch blocks
},
languageOptions: {
ecmaVersion: 2022, sourceType: 'script',
globals: { ...globals.browser, ...globals.greasemonkey, chatgpt: 'readonly' }
}
},
{ files: ['**/*.mjs', '**/lib*/*.js'], languageOptions: { sourceType: 'module' }},
...eslintPluginJsonSchemaValidator.configs['flat/recommended']
];