Skip to content

Commit 7fc8262

Browse files
build(eslint.config): set up eslint
1 parent daf742e commit 7fc8262

File tree

1 file changed

+283
-0
lines changed

1 file changed

+283
-0
lines changed

eslint.config.js

Lines changed: 283 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,283 @@
1+
import globals from 'globals';
2+
import pluginJs from '@eslint/js';
3+
4+
5+
export default [
6+
{ languageOptions: { globals: { ...globals.browser, ...globals.node } } },
7+
pluginJs.configs.recommended,
8+
{
9+
'rules': {
10+
'accessor-pairs': 'error',
11+
'array-bracket-spacing': [
12+
'error',
13+
'always'
14+
],
15+
'array-callback-return': 'error',
16+
'arrow-body-style': 'error',
17+
'arrow-parens': 'error',
18+
'arrow-spacing': 'error',
19+
'block-scoped-var': 'error',
20+
'block-spacing': 'error',
21+
'brace-style': 'error',
22+
'callback-return': 'error',
23+
'camelcase': 'error',
24+
'capitalized-comments': 'off',
25+
'class-methods-use-this': 'error',
26+
'comma-dangle': 'off',
27+
'comma-spacing': 'off',
28+
'comma-style': [
29+
'error',
30+
'last'
31+
],
32+
'complexity': 'error',
33+
'computed-property-spacing': 'off',
34+
'consistent-return': 'error',
35+
'consistent-this': 'error',
36+
'curly': 'off',
37+
'default-case': 'error',
38+
'dot-location': [
39+
'error',
40+
'property'
41+
],
42+
'dot-notation': 'error',
43+
'eol-last': 'error',
44+
'eqeqeq': 'off',
45+
'func-call-spacing': 'error',
46+
'func-name-matching': 'error',
47+
'func-names': [
48+
'error',
49+
'never'
50+
],
51+
'func-style': 'error',
52+
'generator-star-spacing': 'error',
53+
'global-require': 'error',
54+
'guard-for-in': 'error',
55+
'handle-callback-err': 'error',
56+
'id-blacklist': 'error',
57+
'id-length': 'off',
58+
'id-match': 'error',
59+
'indent': 'off',
60+
'init-declarations': 'off',
61+
'jsx-quotes': 'error',
62+
'key-spacing': 'error',
63+
'keyword-spacing': [
64+
'error',
65+
{
66+
'after': true,
67+
'before': true
68+
}
69+
],
70+
'line-comment-position': 'off',
71+
'linebreak-style': [
72+
'error',
73+
'unix'
74+
],
75+
'lines-around-comment': 'error',
76+
'lines-around-directive': 'error',
77+
'max-depth': 'error',
78+
'max-len': 'off',
79+
'max-lines': [
80+
'error',
81+
{
82+
'max': 900,
83+
'skipBlankLines': true,
84+
'skipComments': true
85+
}
86+
],
87+
'max-nested-callbacks': 'error',
88+
'max-params': 'off',
89+
'max-statements': 'off',
90+
'max-statements-per-line': 'error',
91+
'multiline-ternary': 'off',
92+
'new-cap': 'error',
93+
'new-parens': 'error',
94+
'newline-after-var': 'off',
95+
'newline-before-return': 'off',
96+
'newline-per-chained-call': 'off',
97+
'no-alert': 'error',
98+
'no-array-constructor': 'error',
99+
'no-await-in-loop': 'error',
100+
'no-bitwise': 'error',
101+
'no-caller': 'error',
102+
'no-catch-shadow': 'error',
103+
'no-confusing-arrow': 'error',
104+
'no-continue': 'error',
105+
'no-div-regex': 'error',
106+
'no-duplicate-imports': 'error',
107+
'no-else-return': 'error',
108+
'no-empty-function': 'error',
109+
'no-eq-null': 'error',
110+
'no-eval': 'error',
111+
'no-extend-native': 'error',
112+
'no-extra-bind': 'error',
113+
'no-extra-label': 'error',
114+
'no-extra-parens': 'off',
115+
'no-floating-decimal': 'error',
116+
'no-implicit-globals': 'off',
117+
'no-implied-eval': 'error',
118+
'no-inline-comments': 'off',
119+
'no-inner-declarations': [
120+
'error',
121+
'functions'
122+
],
123+
'no-invalid-this': 'error',
124+
'no-iterator': 'error',
125+
'no-label-var': 'error',
126+
'no-labels': 'error',
127+
'no-lone-blocks': 'error',
128+
'no-lonely-if': 'error',
129+
'no-loop-func': 'error',
130+
'no-magic-numbers': 'off',
131+
'no-mixed-operators': 'error',
132+
'no-mixed-requires': 'error',
133+
'no-multi-spaces': 'off',
134+
'no-multi-str': 'error',
135+
'no-multiple-empty-lines': 'error',
136+
'no-native-reassign': 'error',
137+
'no-negated-condition': 'error',
138+
'no-negated-in-lhs': 'error',
139+
'no-nested-ternary': 'off',
140+
'no-new': 'error',
141+
'no-new-func': 'error',
142+
'no-new-object': 'error',
143+
'no-new-require': 'error',
144+
'no-new-wrappers': 'error',
145+
'no-octal-escape': 'error',
146+
'no-param-reassign': [
147+
'error',
148+
{
149+
'props': false
150+
}
151+
],
152+
'no-path-concat': 'error',
153+
'no-plusplus': 'error',
154+
'no-process-env': 'error',
155+
'no-process-exit': 'error',
156+
'no-proto': 'error',
157+
'no-prototype-builtins': 'error',
158+
'no-restricted-globals': 'error',
159+
'no-restricted-imports': 'error',
160+
'no-restricted-modules': 'error',
161+
'no-restricted-properties': 'error',
162+
'no-restricted-syntax': 'error',
163+
'no-return-assign': 'error',
164+
'no-return-await': 'error',
165+
'no-script-url': 'error',
166+
'no-self-compare': 'error',
167+
'no-sequences': 'error',
168+
'no-shadow': 'error',
169+
'no-shadow-restricted-names': 'error',
170+
'no-spaced-func': 'error',
171+
'no-sync': 'error',
172+
'no-tabs': 'error',
173+
'no-template-curly-in-string': 'error',
174+
'no-ternary': 'off',
175+
'no-throw-literal': 'error',
176+
'no-trailing-spaces': 'error',
177+
'no-undef-init': 'error',
178+
'no-undefined': 'off',
179+
'no-underscore-dangle': 'error',
180+
'no-unmodified-loop-condition': 'error',
181+
'no-unneeded-ternary': 'error',
182+
'no-unused-expressions': 'error',
183+
'no-use-before-define': 'error',
184+
'no-useless-call': 'error',
185+
'no-useless-computed-key': 'error',
186+
'no-useless-concat': 'error',
187+
'no-useless-constructor': 'error',
188+
'no-useless-escape': 'off',
189+
'no-useless-rename': 'error',
190+
'no-useless-return': 'error',
191+
'no-var': 'off',
192+
'no-void': 'error',
193+
'no-warning-comments': [
194+
'error',
195+
{
196+
'location': 'start'
197+
}
198+
],
199+
'no-whitespace-before-property': 'error',
200+
'no-with': 'error',
201+
'object-curly-newline': 'error',
202+
'object-curly-spacing': [
203+
'error',
204+
'always'
205+
],
206+
'object-property-newline': [
207+
'error',
208+
{
209+
'allowMultiplePropertiesPerLine': true
210+
}
211+
],
212+
'object-shorthand': 'off',
213+
'one-var': 'off',
214+
'one-var-declaration-per-line': 'error',
215+
'operator-assignment': [
216+
'error',
217+
'always'
218+
],
219+
'operator-linebreak': [
220+
'error',
221+
'after'
222+
],
223+
'padded-blocks': 'off',
224+
'prefer-arrow-callback': 'off',
225+
'prefer-const': 'error',
226+
'prefer-destructuring': 'off',
227+
'prefer-numeric-literals': 'error',
228+
'prefer-reflect': 'off',
229+
'prefer-rest-params': 'error',
230+
'prefer-spread': 'error',
231+
'prefer-template': 'off',
232+
'quote-props': 'off',
233+
'quotes': [
234+
'error',
235+
'single'
236+
],
237+
'radix': [
238+
'error',
239+
'always'
240+
],
241+
'require-await': 'error',
242+
'rest-spread-spacing': 'error',
243+
'semi': 'error',
244+
'semi-spacing': [
245+
'error',
246+
{
247+
'after': true,
248+
'before': false
249+
}
250+
],
251+
'sort-imports': 'error',
252+
'sort-keys': 'off',
253+
'sort-vars': 'error',
254+
'space-before-blocks': 'error',
255+
'space-before-function-paren': 'error',
256+
'space-in-parens': 'off',
257+
'space-infix-ops': 'error',
258+
'space-unary-ops': 'error',
259+
'spaced-comment': [
260+
'error',
261+
'always'
262+
],
263+
'strict': [
264+
'error',
265+
'never'
266+
],
267+
'symbol-description': 'error',
268+
'template-curly-spacing': 'error',
269+
'unicode-bom': [
270+
'error',
271+
'never'
272+
],
273+
'vars-on-top': 'off',
274+
'wrap-iife': 'error',
275+
'wrap-regex': 'error',
276+
'yield-star-spacing': 'error',
277+
'yoda': [
278+
'error',
279+
'never'
280+
]
281+
}
282+
}
283+
];

0 commit comments

Comments
 (0)