-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheslint.config.js
137 lines (136 loc) · 4.04 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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
import js from '@eslint/js'
import globals from 'globals'
import tsEslint from 'typescript-eslint'
import prettierPlugin from 'eslint-plugin-prettier'
import eslintConfigPrettier from 'eslint-config-prettier'
export default tsEslint.config(
js.configs.recommended,
...tsEslint.configs.recommended,
{
ignores: ['**/dist', '**/node_modules', '**/coverage', '*.config.*', '*.json']
},
{
plugins: {
'@typescript-eslint': tsEslint.plugin,
prettier: prettierPlugin
},
languageOptions: {
globals: {
...globals.browser,
...globals.node,
...globals.es2024
},
ecmaVersion: 2024,
parserOptions: {
project: ['**/tsconfig.json']
}
},
files: ['**/*.{ts,tsx}'],
rules: {
...prettierPlugin.configs.recommended.rules,
...eslintConfigPrettier.rules,
indent: [
'error',
2,
{
SwitchCase: 1,
offsetTernaryExpressions: true
}
],
quotes: ['error', 'single'],
semi: ['error', 'never'],
eqeqeq: 'error',
'no-console': 'off',
'no-debugger': 'error',
'no-unused-vars': 'error',
'prefer-const': 'error',
'for-direction': 'warn',
'no-unmodified-loop-condition': 'error',
'no-unreachable-loop': 'error',
'no-unused-expressions': 'error',
'constructor-super': 'error',
'getter-return': 'error',
'no-setter-return': 'error',
'no-class-assign': 'error',
'no-dupe-class-members': 'error',
'no-constructor-return': 'error',
'no-this-before-super': 'error',
'no-unused-private-class-members': 'error',
'grouped-accessor-pairs': ['error', 'setBeforeGet'],
'accessor-pairs': [
'error',
{
getWithoutSet: true,
enforceForClassMembers: false
}
],
'no-irregular-whitespace': [
'error',
{
skipComments: true,
skipRegExps: true
}
],
'no-template-curly-in-string': 'error',
'no-unexpected-multiline': 'error',
'no-async-promise-executor': 'off',
'no-await-in-loop': 'error',
'no-promise-executor-return': 'error',
'vars-on-top': 'error',
'no-const-assign': 'error',
'no-constant-binary-expression': 'warn',
'no-self-assign': 'error',
'no-undef': 'off',
'block-scoped-var': 'error',
'no-dupe-args': 'error',
'no-func-assign': 'error',
'arrow-body-style': 'warn',
'default-param-last': 'error',
'func-name-matching': 'warn',
'func-names': ['warn', 'as-needed'],
'no-dupe-keys': 'error',
'no-empty-pattern': 'error',
'no-obj-calls': 'error',
'no-new-symbol': 'error',
'no-new-object': 'error',
'no-new-func': 'error',
'no-new-native-nonconstructor': 'error',
'no-prototype-builtins': 'error',
'dot-notation': 'off',
'no-sparse-arrays': 'warn',
'array-callback-return': 'error',
'no-cond-assign': ['error', 'always'],
'func-style': ['error', 'expression'],
'no-constant-condition': 'error',
'no-compare-neg-zero': 'error',
'no-dupe-else-if': 'error',
'no-inner-declarations': 'warn',
'no-self-compare': 'error',
'no-unsafe-negation': 'error',
'no-unsafe-optional-chaining': 'error',
'valid-typeof': 'error',
'no-duplicate-imports': 'error',
'no-import-assign': 'error',
'no-ex-assign': 'error',
'no-duplicate-case': 'error',
'no-fallthrough': 'error',
'default-case': 'off',
'default-case-last': 'error',
'capitalized-comments': 'off',
'no-loss-of-precision': 'error',
'no-unreachable': 'error',
'no-unsafe-finally': 'error',
'require-atomic-updates': 'error',
'use-isnan': 'error',
camelcase: [
'error',
{
properties: 'always'
}
],
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unused-vars': 'error'
}
}
)