90 lines
2.8 KiB
JavaScript
90 lines
2.8 KiB
JavaScript
import js from '@eslint/js';
|
|
import globals from 'globals';
|
|
|
|
export default [
|
|
js.configs.recommended,
|
|
{
|
|
languageOptions: {
|
|
ecmaVersion: 2022,
|
|
sourceType: 'module',
|
|
globals: {
|
|
...globals.node,
|
|
...globals.es2021
|
|
}
|
|
},
|
|
rules: {
|
|
'no-unused-vars': ['warn', {
|
|
argsIgnorePattern: '^_',
|
|
varsIgnorePattern: '^_'
|
|
}],
|
|
'no-console': 'off',
|
|
'no-undef': 'error',
|
|
'no-redeclare': 'error',
|
|
'no-unreachable': 'error',
|
|
'no-duplicate-case': 'error',
|
|
'no-empty': 'warn',
|
|
'no-extra-semi': 'warn',
|
|
'no-func-assign': 'error',
|
|
'no-invalid-regexp': 'error',
|
|
'no-irregular-whitespace': 'error',
|
|
'no-obj-calls': 'error',
|
|
'no-sparse-arrays': 'error',
|
|
'no-unexpected-multiline': 'error',
|
|
'no-unsafe-finally': 'error',
|
|
'no-unsafe-negation': 'error',
|
|
'use-isnan': 'error',
|
|
'valid-typeof': 'error',
|
|
'curly': ['warn', 'all'],
|
|
'eqeqeq': ['warn', 'always'],
|
|
'no-eval': 'error',
|
|
'no-implied-eval': 'error',
|
|
'no-new-wrappers': 'error',
|
|
'no-throw-literal': 'error',
|
|
'no-with': 'error',
|
|
'radix': 'warn',
|
|
'no-var': 'error',
|
|
'prefer-const': 'warn',
|
|
'prefer-arrow-callback': 'warn',
|
|
'arrow-spacing': 'warn',
|
|
'no-trailing-spaces': 'warn',
|
|
'comma-dangle': ['warn', 'never'],
|
|
'indent': ['warn', 4, { SwitchCase: 1 }],
|
|
'quotes': ['warn', 'single', { avoidEscape: true }],
|
|
'semi': ['warn', 'always'],
|
|
'space-before-blocks': 'warn',
|
|
'space-before-function-paren': ['warn', {
|
|
anonymous: 'always',
|
|
named: 'never',
|
|
asyncArrow: 'always'
|
|
}],
|
|
'space-in-parens': ['warn', 'never'],
|
|
'space-infix-ops': 'warn',
|
|
'space-unary-ops': 'warn',
|
|
'spaced-comment': ['warn', 'always'],
|
|
'object-curly-spacing': ['warn', 'always'],
|
|
'array-bracket-spacing': ['warn', 'never'],
|
|
'comma-spacing': 'warn',
|
|
'key-spacing': 'warn',
|
|
'brace-style': ['warn', '1tbs'],
|
|
'camelcase': ['warn', {
|
|
properties: 'always',
|
|
ignoreDestructuring: true,
|
|
ignoreImports: true,
|
|
ignoreGlobals: true
|
|
}]
|
|
}
|
|
},
|
|
{
|
|
ignores: [
|
|
'node_modules/**',
|
|
'test-configs/**',
|
|
'*.min.js',
|
|
'coverage/**',
|
|
'dist/**',
|
|
'build/**',
|
|
'package-lock.json'
|
|
]
|
|
}
|
|
];
|
|
|