additional eslint rules
This commit is contained in:
parent
b890b4e53d
commit
3743c45de6
26 changed files with 1079 additions and 184 deletions
27
.eslintrc.js
27
.eslintrc.js
|
|
@ -6,7 +6,10 @@ module.exports = {
|
|||
node: true,
|
||||
jquery: true,
|
||||
},
|
||||
extends: 'airbnb-base',
|
||||
extends: [
|
||||
'airbnb-base',
|
||||
'plugin:sonarjs/recommended',
|
||||
],
|
||||
globals: {
|
||||
Atomics: 'readonly',
|
||||
SharedArrayBuffer: 'readonly',
|
||||
|
|
@ -21,6 +24,10 @@ module.exports = {
|
|||
parserOptions: {
|
||||
ecmaVersion: 2021,
|
||||
},
|
||||
plugins: [
|
||||
'unicorn',
|
||||
'sonarjs',
|
||||
],
|
||||
rules: {
|
||||
indent: [
|
||||
'error',
|
||||
|
|
@ -60,6 +67,24 @@ module.exports = {
|
|||
json: 'always',
|
||||
},
|
||||
],
|
||||
// unicorn
|
||||
'unicorn/numeric-separators-style': 'error',
|
||||
'unicorn/prefer-query-selector': 'error',
|
||||
'unicorn/catch-error-name': 'error',
|
||||
'unicorn/no-negated-condition': 'error',
|
||||
'unicorn/better-regex': 'error',
|
||||
'unicorn/consistent-function-scoping': 'error',
|
||||
'unicorn/prefer-array-flat-map': 'error',
|
||||
'unicorn/prefer-array-find': 'error',
|
||||
'unicorn/prefer-regexp-test': 'error',
|
||||
'unicorn/consistent-destructuring': 'error',
|
||||
'unicorn/prefer-date-now': 'error',
|
||||
'unicorn/prefer-ternary': 'error',
|
||||
'unicorn/prefer-dom-node-append': 'error',
|
||||
'unicorn/explicit-length-check': 'error',
|
||||
'unicorn/prefer-at': 'error',
|
||||
// sonarjs
|
||||
'sonarjs/cognitive-complexity': 0,
|
||||
},
|
||||
ignorePatterns: [
|
||||
'*.min.js',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue