-
Notifications
You must be signed in to change notification settings - Fork 3
/
eslint.config.js
108 lines (98 loc) · 3.67 KB
/
eslint.config.js
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
// @ts-check
import { config, configs, parser, plugin } from 'typescript-eslint';
import stylistic from '@stylistic/eslint-plugin';
export default config({
// @ts-ignore
files: ['src/**/*.ts'],
ignores: ['build/**/*', '**/node_modules/', 'locales/**', '**/.*'],
extends: [...configs.recommended],
plugins: { '@stylistic': stylistic, '@typescript-eslint': plugin },
languageOptions: {
parser,
parserOptions: { sourceType: 'module' },
ecmaVersion: 2022,
},
rules: {
yoda: 'error',
'no-var': 'error',
'no-console': 'warn',
complexity: 'warn',
'dot-notation': 'off',
'prefer-const': 'error',
'no-lonely-if': 'error',
'no-inline-comments': 'off',
'no-empty-function': 'error',
'handle-callback-err': 'error',
'no-useless-computed-key': 'error',
'no-constant-binary-expression': 'error',
'max-nested-callbacks': ['error', { max: 4 }],
curly: ['error', 'multi-line', 'consistent'],
'@typescript-eslint/no-unused-vars': 'error',
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/no-shadow': ['error', { allow: ['err', 'resolve', 'reject'] }],
// 'class-methods-use-this': 'warn',
'no-nested-ternary': 'error',
'object-shorthand': 'error',
'no-array-constructor': 'error',
'array-callback-return': 'error',
'prefer-template': 'error',
'no-eval': 'error',
'no-loop-func': 'error',
'no-param-reassign': 'error',
'prefer-rest-params': 'error',
'prefer-spread': 'error',
'no-useless-constructor': 'error',
'no-duplicate-imports': 'error',
'one-var': ['error', 'never'],
'no-multi-assign': 'error',
eqeqeq: 'error',
'no-new-wrappers': 'error',
'prefer-arrow-callback': ['error', { allowNamedFunctions: true }],
'arrow-body-style': ['error', 'as-needed'],
'@stylistic/max-len': [
'error',
{
code: 100,
tabWidth: 2,
ignoreStrings: true,
ignoreComments: true,
ignoreTrailingComments: true,
ignoreTemplateLiterals: true,
ignoreRegExpLiterals: true,
},
],
'@stylistic/eol-last': ['error', 'always'],
'@stylistic/nonblock-statement-body-position': ['error', 'beside'],
// '@stylistic/no-mixed-operators': 'error',
'@stylistic/object-curly-newline': 'error',
'@stylistic/template-curly-spacing': ['error', 'never'],
'@stylistic/arrow-parens': ['error', 'always'],
'@stylistic/comma-style': 'error',
'@stylistic/arrow-spacing': 'error',
'@stylistic/comma-spacing': 'error',
'@stylistic/keyword-spacing': 'error',
'@stylistic/space-in-parens': 'error',
'@stylistic/space-infix-ops': 'error',
'@stylistic/space-unary-ops': 'error',
'@stylistic/spaced-comment': 'error',
'@stylistic/no-multi-spaces': 'error',
'@stylistic/space-before-blocks': 'error',
'@stylistic/no-floating-decimal': 'error',
'@stylistic/indent': ['error', 2],
'@stylistic/semi': ['error', 'always'],
'@stylistic/quotes': ['error', 'single'],
'@stylistic/no-trailing-spaces': ['error'],
'@stylistic/dot-location': ['error', 'property'],
'@stylistic/object-curly-spacing': ['error', 'always'],
'@stylistic/array-bracket-spacing': ['error', 'never'],
'@stylistic/comma-dangle': ['error', 'always-multiline'],
'@stylistic/max-statements-per-line': ['error', { max: 2 }],
'@stylistic/brace-style': ['error', 'stroustrup', { allowSingleLine: true }],
'@stylistic/no-multiple-empty-lines': ['error', { max: 2, maxEOF: 1, maxBOF: 0 }],
'@stylistic/space-before-function-paren': [
'error',
{ anonymous: 'never', named: 'never', asyncArrow: 'always' },
],
},
});