ws4kp/.eslintrc.js

93 lines
1.8 KiB
JavaScript
Raw Normal View History

2020-09-04 18:02:20 +00:00
module.exports = {
2020-10-29 21:44:28 +00:00
env: {
browser: true,
commonjs: true,
es6: true,
node: true,
jquery: true,
2020-09-04 18:02:20 +00:00
},
2023-01-06 20:39:39 +00:00
extends: [
'airbnb-base',
'plugin:sonarjs/recommended',
],
2020-10-29 21:44:28 +00:00
globals: {
Atomics: 'readonly',
SharedArrayBuffer: 'readonly',
2022-12-06 22:14:56 +00:00
StationInfo: 'readonly',
RegionalCities: 'readonly',
TravelCities: 'readonly',
NoSleep: 'readonly',
states: 'readonly',
SunCalc: 'readonly',
2020-09-04 18:02:20 +00:00
},
2020-10-29 21:44:28 +00:00
parserOptions: {
2022-11-22 22:19:10 +00:00
ecmaVersion: 2021,
2020-09-04 18:02:20 +00:00
},
2023-01-06 20:39:39 +00:00
plugins: [
'unicorn',
'sonarjs',
],
2020-10-29 21:44:28 +00:00
rules: {
indent: [
2020-09-04 18:02:20 +00:00
'error',
2020-10-29 21:44:28 +00:00
'tab',
2020-09-04 18:02:20 +00:00
],
2020-10-29 21:44:28 +00:00
'no-tabs': 0,
'no-console': 0,
'max-len': 0,
2022-03-01 22:19:08 +00:00
'no-use-before-define': [
'error',
{
variables: false,
},
],
2022-05-03 20:21:05 +00:00
'no-param-reassign': [
'error',
{
props: false,
},
],
2020-12-29 16:22:20 +00:00
'no-mixed-operators': [
'error',
{
groups: [
['&', '|', '^', '~', '<<', '>>', '>>>'],
['==', '!=', '===', '!==', '>', '>=', '<', '<='],
['&&', '||'],
['in', 'instanceof'],
],
allowSamePrecedence: true,
},
],
2022-11-22 22:19:10 +00:00
'import/extensions': [
'error',
{
mjs: 'always',
json: 'always',
},
],
2023-01-06 20:39:39 +00:00
// 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,
2020-09-04 18:02:20 +00:00
},
2020-10-29 21:44:28 +00:00
ignorePatterns: [
'*.min.js',
2020-09-04 18:02:20 +00:00
],
2020-10-29 21:44:28 +00:00
};