-
Notifications
You must be signed in to change notification settings - Fork 0
/
eslint.config.mjs
222 lines (167 loc) · 6.75 KB
/
eslint.config.mjs
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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
/*
* Copyright (C) 2024 brittni and the polar bear LLC.
*
* This file is a part of brittni and the polar bear's rainbow waves algorithmic art project,
* which is released under the GNU Affero General Public License, Version 3.0.
* You may not use this file except in compliance with the license.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. See LICENSE or go to
* https://www.gnu.org/licenses/agpl-3.0.en.html for full license details.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU Affero General Public License for more details.
*
* The visual outputs of this source code are licensed under the
* Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0) License.
* You should have received a copy of the CC BY-NC-ND 4.0 License with this program.
* See OUTPUT-LICENSE or go to https://creativecommons.org/licenses/by-nc-nd/4.0/
* for full license details.
*/
import js from '@eslint/js';
import es_x from 'eslint-plugin-es-x';
import node from 'eslint-plugin-n';
import security from 'eslint-plugin-security';
import stylistic from '@stylistic/eslint-plugin'
import typescript from '@typescript-eslint/eslint-plugin';
import tsParser from '@typescript-eslint/parser';
import tsEslint from 'typescript-eslint';
export default tsEslint.config(
js.configs.recommended,
es_x.configs['flat/restrict-to-es2022'],
node.configs["flat/recommended"],
security.configs.recommended,
stylistic.configs['recommended-flat'],
...tsEslint.configs.recommended,
...tsEslint.configs.recommendedTypeChecked,
...tsEslint.configs.strict,
...tsEslint.configs.strictTypeChecked,
...tsEslint.configs.stylistic,
...tsEslint.configs.strictTypeChecked,
{
languageOptions: {
parser: tsParser,
ecmaVersion: 6,
sourceType: 'script',
parserOptions: {
projectService: {
defaultProject: './tsconfig.json'
},
}
},
plugins: {
'es-x': es_x,
'@stylistic': stylistic,
'@typescript-eslint': typescript
},
rules: {
'array-callback-return': ['error', {
checkForEach: true
}],
'no-await-in-loop': 'error',
'no-cond-assign': ['error', 'always'],
'no-constant-condition': ['error', {
checkLoops: 'all'
}],
'no-constructor-return': 'error',
'no-duplicate-imports': ['error', {
includeExports: true
}],
'no-inner-declarations': ['error', 'both'],
'no-promise-executor-return': 'error',
'no-self-compare': 'error',
'no-template-curly-in-string': 'error',
'no-unmodified-loop-condition': 'error',
'no-unreachable-loop': 'error',
'no-unsafe-negation': ['error', {
enforceForOrderingRelations: true
}],
'no-unsafe-optional-chaining': ['error', {
disallowArithmeticOperators: true
}],
'no-useless-assignment': 'error',
'require-atomic-updates': 'error',
'use-isnan': ['error', {
enforceForSwitchCase: true,
enforceForIndexOf: true
}],
'valid-typeof': ['error', {
requireStringLiterals: true
}],
'one-var': ['error', 'never'],
'n/no-missing-import': 'off',
'security/detect-object-injection': 'off',
'@stylistic/brace-style': ['error', '1tbs'],
'@stylistic/no-extra-semi': 'error',
'@stylistic/function-call-argument-newline': ['error', 'consistent'],
'@stylistic/function-call-spacing': ['error', 'never'],
'@stylistic/comma-dangle': ['error', 'never'],
'@stylistic/indent': ['error',
4,
{
SwitchCase: 1,
FunctionDeclaration: {
parameters: 'first'
},
FunctionExpression: {
parameters: 'first'
}
}
],
'@stylistic/indent-binary-ops': 'off',
'@stylistic/member-delimiter-style': ['error', {
multiline: {
delimiter: 'semi',
requireLast: false
},
singleline: {
delimiter: 'semi',
requireLast: false
}
}],
'@stylistic/operator-linebreak': ['error', 'after'],
'@stylistic/quotes': ['error',
'single',
{
avoidEscape: true,
allowTemplateLiterals: true
}
],
'@stylistic/semi': ['error', 'always'],
'dot-notation': 'off',
'@typescript-eslint/dot-notation': 'error',
'no-array-constructor': 'off',
'@typescript-eslint/no-array-constructor': 'error',
'no-empty-function': 'off',
'@typescript-eslint/no-empty-function': 'error',
'no-loop-func': 'off',
'@typescript-eslint/no-loop-func': 'error',
'no-loss-of-precision': 'off',
'@typescript-eslint/no-loss-of-precision': 'error',
'no-shadow': 'off',
'@typescript-eslint/no-shadow': 'error',
'no-unused-expressions': 'off',
'@typescript-eslint/no-unused-expressions': 'error',
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': 'error',
'no-use-before-define': 'off',
'@typescript-eslint/no-use-before-define': 'error',
'no-useless-constructor': 'off',
'@typescript-eslint/no-useless-constructor': 'error',
'@typescript-eslint/class-literal-property-style': ['error', 'getters'],
'@typescript-eslint/consistent-type-definitions': ['error', 'interface'],
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-extraneous-class': ['error', {
allowStaticOnly: true,
}],
'@typescript-eslint/no-inferrable-types': 'off',
'@typescript-eslint/prefer-for-of': 'off',
'@typescript-eslint/restrict-template-expressions': ['error', {
allowNumber: true,
allowBoolean: true
}]
}
}
);