@citrus-linting/eslint-config 1.1.1 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/index.js +6 -0
- package/package.json +1 -1
- package/rules/base.js +243 -1
- package/rules/typescript.js +3 -2
package/README.md
CHANGED
|
@@ -16,7 +16,7 @@ ESLint config used by [CitRUS](https://github.com/CitRUSprod).
|
|
|
16
16
|
Install dependencies:
|
|
17
17
|
|
|
18
18
|
```sh
|
|
19
|
-
npm add -D globals @citrus-linting/eslint-config
|
|
19
|
+
npm add -D globals @stylistic/eslint-plugin eslint-plugin-import @citrus-linting/eslint-config
|
|
20
20
|
```
|
|
21
21
|
|
|
22
22
|
Add `extends` field to your ESLint config (eslint.config.js):
|
|
@@ -51,7 +51,7 @@ export default [
|
|
|
51
51
|
Install dependencies:
|
|
52
52
|
|
|
53
53
|
```sh
|
|
54
|
-
npm add -D globals typescript-eslint @citrus-linting/eslint-config
|
|
54
|
+
npm add -D globals typescript-eslint @stylistic/eslint-plugin eslint-plugin-import @citrus-linting/eslint-config
|
|
55
55
|
```
|
|
56
56
|
|
|
57
57
|
Add `extends` field to your ESLint config (eslint.config.js):
|
|
@@ -90,7 +90,7 @@ export default [
|
|
|
90
90
|
Install dependencies:
|
|
91
91
|
|
|
92
92
|
```sh
|
|
93
|
-
npm add -D globals svelte-eslint-parser eslint-plugin-svelte @citrus-linting/eslint-config
|
|
93
|
+
npm add -D globals svelte-eslint-parser eslint-plugin-svelte @stylistic/eslint-plugin eslint-plugin-import @citrus-linting/eslint-config
|
|
94
94
|
```
|
|
95
95
|
|
|
96
96
|
Add `extends` field to your ESLint config (eslint.config.js):
|
|
@@ -129,7 +129,7 @@ export default [
|
|
|
129
129
|
Install dependencies:
|
|
130
130
|
|
|
131
131
|
```sh
|
|
132
|
-
npm add -D globals svelte-eslint-parser eslint-plugin-svelte typescript-eslint @citrus-linting/eslint-config
|
|
132
|
+
npm add -D globals svelte-eslint-parser eslint-plugin-svelte typescript-eslint @stylistic/eslint-plugin eslint-plugin-import @citrus-linting/eslint-config
|
|
133
133
|
```
|
|
134
134
|
|
|
135
135
|
Add `extends` field to your ESLint config (eslint.config.js):
|
package/index.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import globals from "globals"
|
|
2
|
+
import stylistic from "@stylistic/eslint-plugin"
|
|
3
|
+
import importPlugin from "eslint-plugin-import"
|
|
2
4
|
|
|
3
5
|
import baseRules from "./rules/base.js"
|
|
4
6
|
|
|
@@ -12,6 +14,10 @@ export default [
|
|
|
12
14
|
...globals.node,
|
|
13
15
|
...globals.es6
|
|
14
16
|
}
|
|
17
|
+
},
|
|
18
|
+
plugins: {
|
|
19
|
+
"@stylistic": stylistic,
|
|
20
|
+
import: importPlugin
|
|
15
21
|
}
|
|
16
22
|
},
|
|
17
23
|
{
|
package/package.json
CHANGED
package/rules/base.js
CHANGED
|
@@ -208,5 +208,247 @@ export default {
|
|
|
208
208
|
"use-isnan": [2, { enforceForIndexOf: true }],
|
|
209
209
|
"valid-typeof": [2, { requireStringLiterals: true }],
|
|
210
210
|
"vars-on-top": 0,
|
|
211
|
-
yoda: [2, "never", { exceptRange: true }]
|
|
211
|
+
yoda: [2, "never", { exceptRange: true }],
|
|
212
|
+
|
|
213
|
+
"@stylistic/array-bracket-newline": [2, "consistent"],
|
|
214
|
+
"@stylistic/array-bracket-spacing": 2,
|
|
215
|
+
"@stylistic/array-element-newline": [2, "consistent"],
|
|
216
|
+
"@stylistic/arrow-parens": [2, "as-needed"],
|
|
217
|
+
"@stylistic/arrow-spacing": 2,
|
|
218
|
+
"@stylistic/block-spacing": 2,
|
|
219
|
+
"@stylistic/brace-style": 2,
|
|
220
|
+
"@stylistic/comma-dangle": 2,
|
|
221
|
+
"@stylistic/comma-spacing": 2,
|
|
222
|
+
"@stylistic/comma-style": 2,
|
|
223
|
+
"@stylistic/computed-property-spacing": 2,
|
|
224
|
+
"@stylistic/curly-newline": 2,
|
|
225
|
+
"@stylistic/dot-location": [2, "property"],
|
|
226
|
+
"@stylistic/eol-last": 2,
|
|
227
|
+
"@stylistic/func-call-spacing": 2,
|
|
228
|
+
"@stylistic/function-call-argument-newline": [2, "consistent"],
|
|
229
|
+
"@stylistic/function-call-spacing": 2,
|
|
230
|
+
"@stylistic/function-paren-newline": 2,
|
|
231
|
+
"@stylistic/generator-star-spacing": [
|
|
232
|
+
2,
|
|
233
|
+
{
|
|
234
|
+
named: "after",
|
|
235
|
+
anonymous: "neither",
|
|
236
|
+
method: "before"
|
|
237
|
+
}
|
|
238
|
+
],
|
|
239
|
+
"@stylistic/implicit-arrow-linebreak": 2,
|
|
240
|
+
"@stylistic/indent": [2, 4, { SwitchCase: 1 }],
|
|
241
|
+
"@stylistic/indent-binary-ops": 2,
|
|
242
|
+
"@stylistic/jsx-child-element-spacing": 2,
|
|
243
|
+
"@stylistic/jsx-closing-bracket-location": 2,
|
|
244
|
+
"@stylistic/jsx-closing-tag-location": 2,
|
|
245
|
+
"@stylistic/jsx-curly-brace-presence": 2,
|
|
246
|
+
"@stylistic/jsx-curly-newline": 2,
|
|
247
|
+
"@stylistic/jsx-curly-spacing": 2,
|
|
248
|
+
"@stylistic/jsx-equals-spacing": 2,
|
|
249
|
+
"@stylistic/jsx-first-prop-new-line": 2,
|
|
250
|
+
"@stylistic/jsx-function-call-newline": 2,
|
|
251
|
+
"@stylistic/jsx-indent-props": 2,
|
|
252
|
+
"@stylistic/jsx-max-props-per-line": 2,
|
|
253
|
+
"@stylistic/jsx-newline": 2,
|
|
254
|
+
"@stylistic/jsx-one-expression-per-line": 2,
|
|
255
|
+
"@stylistic/jsx-pascal-case": 2,
|
|
256
|
+
"@stylistic/jsx-props-no-multi-spaces": 2,
|
|
257
|
+
"@stylistic/jsx-quotes": 2,
|
|
258
|
+
"@stylistic/jsx-self-closing-comp": 2,
|
|
259
|
+
"@stylistic/jsx-sort-props": 2,
|
|
260
|
+
"@stylistic/jsx-tag-spacing": 2,
|
|
261
|
+
"@stylistic/jsx-wrap-multilines": 2,
|
|
262
|
+
"@stylistic/key-spacing": 2,
|
|
263
|
+
"@stylistic/keyword-spacing": 2,
|
|
264
|
+
"@stylistic/line-comment-position": 0,
|
|
265
|
+
"@stylistic/linebreak-style": 2,
|
|
266
|
+
"@stylistic/lines-around-comment": 0,
|
|
267
|
+
"@stylistic/lines-between-class-members": [2, "always", { exceptAfterSingleLine: true }],
|
|
268
|
+
"@stylistic/max-len": [2, { code: 100 }],
|
|
269
|
+
"@stylistic/max-statements-per-line": 0,
|
|
270
|
+
"@stylistic/member-delimiter-style": [
|
|
271
|
+
2,
|
|
272
|
+
{
|
|
273
|
+
multiline: { delimiter: "none" },
|
|
274
|
+
singleline: { delimiter: "comma" }
|
|
275
|
+
}
|
|
276
|
+
],
|
|
277
|
+
"@stylistic/multiline-comment-style": 0,
|
|
278
|
+
"@stylistic/multiline-ternary": [2, "always-multiline"],
|
|
279
|
+
"@stylistic/new-parens": 2,
|
|
280
|
+
"@stylistic/newline-per-chained-call": 0,
|
|
281
|
+
"@stylistic/no-confusing-arrow": 0,
|
|
282
|
+
"@stylistic/no-extra-parens": 2,
|
|
283
|
+
"@stylistic/no-extra-semi": 0,
|
|
284
|
+
"@stylistic/no-floating-decimal": 2,
|
|
285
|
+
"@stylistic/no-mixed-operators": 0,
|
|
286
|
+
"@stylistic/no-mixed-spaces-and-tabs": 2,
|
|
287
|
+
"@stylistic/no-multi-spaces": 2,
|
|
288
|
+
"@stylistic/no-multiple-empty-lines": [2, { max: 1 }],
|
|
289
|
+
"@stylistic/no-tabs": 2,
|
|
290
|
+
"@stylistic/no-trailing-spaces": 2,
|
|
291
|
+
"@stylistic/no-whitespace-before-property": 2,
|
|
292
|
+
"@stylistic/nonblock-statement-body-position": 0,
|
|
293
|
+
"@stylistic/object-curly-newline": 2,
|
|
294
|
+
"@stylistic/object-curly-spacing": [2, "always"],
|
|
295
|
+
"@stylistic/object-property-newline": 0,
|
|
296
|
+
"@stylistic/one-var-declaration-per-line": 0,
|
|
297
|
+
"@stylistic/operator-linebreak": 2,
|
|
298
|
+
"@stylistic/padded-blocks": [2, "never"],
|
|
299
|
+
"@stylistic/padding-line-between-statements": [
|
|
300
|
+
2,
|
|
301
|
+
{
|
|
302
|
+
blankLine: "always",
|
|
303
|
+
prev: "cjs-import",
|
|
304
|
+
next: "*"
|
|
305
|
+
},
|
|
306
|
+
{
|
|
307
|
+
blankLine: "always",
|
|
308
|
+
prev: "*",
|
|
309
|
+
next: "cjs-import"
|
|
310
|
+
},
|
|
311
|
+
{
|
|
312
|
+
blankLine: "any",
|
|
313
|
+
prev: "cjs-import",
|
|
314
|
+
next: "cjs-import"
|
|
315
|
+
},
|
|
316
|
+
{
|
|
317
|
+
blankLine: "always",
|
|
318
|
+
prev: "cjs-export",
|
|
319
|
+
next: "*"
|
|
320
|
+
},
|
|
321
|
+
{
|
|
322
|
+
blankLine: "always",
|
|
323
|
+
prev: "*",
|
|
324
|
+
next: "cjs-export"
|
|
325
|
+
},
|
|
326
|
+
{
|
|
327
|
+
blankLine: "any",
|
|
328
|
+
prev: "cjs-export",
|
|
329
|
+
next: "cjs-export"
|
|
330
|
+
},
|
|
331
|
+
{
|
|
332
|
+
blankLine: "always",
|
|
333
|
+
prev: "import",
|
|
334
|
+
next: "*"
|
|
335
|
+
},
|
|
336
|
+
{
|
|
337
|
+
blankLine: "always",
|
|
338
|
+
prev: "*",
|
|
339
|
+
next: "import"
|
|
340
|
+
},
|
|
341
|
+
{
|
|
342
|
+
blankLine: "any",
|
|
343
|
+
prev: "import",
|
|
344
|
+
next: "import"
|
|
345
|
+
},
|
|
346
|
+
{
|
|
347
|
+
blankLine: "always",
|
|
348
|
+
prev: "export",
|
|
349
|
+
next: "*"
|
|
350
|
+
},
|
|
351
|
+
{
|
|
352
|
+
blankLine: "always",
|
|
353
|
+
prev: "*",
|
|
354
|
+
next: "export"
|
|
355
|
+
},
|
|
356
|
+
{
|
|
357
|
+
blankLine: "any",
|
|
358
|
+
prev: "export",
|
|
359
|
+
next: "export"
|
|
360
|
+
},
|
|
361
|
+
{
|
|
362
|
+
blankLine: "always",
|
|
363
|
+
prev: "multiline-block-like",
|
|
364
|
+
next: "*"
|
|
365
|
+
},
|
|
366
|
+
{
|
|
367
|
+
blankLine: "always",
|
|
368
|
+
prev: "*",
|
|
369
|
+
next: "multiline-block-like"
|
|
370
|
+
}
|
|
371
|
+
],
|
|
372
|
+
"@stylistic/quote-props": [2, "as-needed"],
|
|
373
|
+
"@stylistic/quotes": [2, "double", { allowTemplateLiterals: true }],
|
|
374
|
+
"@stylistic/rest-spread-spacing": 2,
|
|
375
|
+
"@stylistic/semi": [2, "never"],
|
|
376
|
+
"@stylistic/semi-spacing": 2,
|
|
377
|
+
"@stylistic/semi-style": 0,
|
|
378
|
+
"@stylistic/space-before-blocks": 2,
|
|
379
|
+
"@stylistic/space-before-function-paren": [
|
|
380
|
+
2,
|
|
381
|
+
{ anonymous: "never", named: "never", asyncArrow: "always" }
|
|
382
|
+
],
|
|
383
|
+
"@stylistic/space-in-parens": 2,
|
|
384
|
+
"@stylistic/space-infix-ops": 2,
|
|
385
|
+
"@stylistic/space-unary-ops": 2,
|
|
386
|
+
"@stylistic/spaced-comment": [2, "always", { markers: ["/"] }],
|
|
387
|
+
"@stylistic/switch-colon-spacing": 2,
|
|
388
|
+
"@stylistic/template-curly-spacing": 2,
|
|
389
|
+
"@stylistic/template-tag-spacing": 2,
|
|
390
|
+
"@stylistic/type-annotation-spacing": 2,
|
|
391
|
+
"@stylistic/type-generic-spacing": 2,
|
|
392
|
+
"@stylistic/type-named-tuple-spacing": 2,
|
|
393
|
+
"@stylistic/wrap-iife": [2, "inside", { functionPrototypeMethods: true }],
|
|
394
|
+
"@stylistic/wrap-regex": 0,
|
|
395
|
+
"@stylistic/yield-star-spacing": 2,
|
|
396
|
+
|
|
397
|
+
"import/no-unresolved": 0,
|
|
398
|
+
"import/named": 0,
|
|
399
|
+
"import/default": 2,
|
|
400
|
+
"import/namespace": 2,
|
|
401
|
+
"import/no-namespace": 0,
|
|
402
|
+
"import/export": 2,
|
|
403
|
+
"import/no-mutable-exports": 2,
|
|
404
|
+
"import/extensions": 0,
|
|
405
|
+
"import/no-restricted-paths": 0,
|
|
406
|
+
"import/no-internal-modules": 0,
|
|
407
|
+
"import/group-exports": 0,
|
|
408
|
+
"import/no-relative-packages": 2,
|
|
409
|
+
"import/no-relative-parent-imports": 0,
|
|
410
|
+
"import/consistent-type-specifier-style": [2, "prefer-inline"],
|
|
411
|
+
"import/no-self-import": 2,
|
|
412
|
+
"import/no-cycle": 2,
|
|
413
|
+
"import/no-named-default": 2,
|
|
414
|
+
"import/no-named-as-default": 0,
|
|
415
|
+
"import/no-named-as-default-member": 2,
|
|
416
|
+
"import/no-anonymous-default-export": 2,
|
|
417
|
+
"import/no-unused-modules": 0,
|
|
418
|
+
"import/no-commonjs": 0,
|
|
419
|
+
"import/no-amd": 2,
|
|
420
|
+
"import/no-duplicates": [2, { "prefer-inline": true }],
|
|
421
|
+
"import/first": 2,
|
|
422
|
+
"import/max-dependencies": 0,
|
|
423
|
+
"import/no-extraneous-dependencies": 2,
|
|
424
|
+
"import/no-absolute-path": 2,
|
|
425
|
+
"import/no-nodejs-modules": 0,
|
|
426
|
+
"import/no-webpack-loader-syntax": 2,
|
|
427
|
+
"import/order": [
|
|
428
|
+
2,
|
|
429
|
+
{
|
|
430
|
+
"newlines-between": "always",
|
|
431
|
+
named: {
|
|
432
|
+
types: "types-last"
|
|
433
|
+
},
|
|
434
|
+
alphabetize: {
|
|
435
|
+
order: "asc",
|
|
436
|
+
orderImportKind: "asc",
|
|
437
|
+
caseInsensitive: true
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
],
|
|
441
|
+
"import/newline-after-import": 2,
|
|
442
|
+
"import/prefer-default-export": 0,
|
|
443
|
+
"import/no-default-export": 0,
|
|
444
|
+
"import/no-named-export": 0,
|
|
445
|
+
"import/no-dynamic-require": 2,
|
|
446
|
+
"import/unambiguous": 0,
|
|
447
|
+
"import/no-unassigned-import": 2,
|
|
448
|
+
"import/no-useless-path-segments": 2,
|
|
449
|
+
"import/dynamic-import-chunkname": 0,
|
|
450
|
+
"import/no-import-module-exports": 2,
|
|
451
|
+
"import/no-empty-named-blocks": 2,
|
|
452
|
+
"import/exports-last": 0,
|
|
453
|
+
"import/no-deprecated": 2
|
|
212
454
|
}
|
package/rules/typescript.js
CHANGED
|
@@ -61,7 +61,8 @@ export default {
|
|
|
61
61
|
},
|
|
62
62
|
{ selector: ["enumMember", "typeLike"], format: ["PascalCase"] },
|
|
63
63
|
{ selector: "import", modifiers: ["default"], format: ["camelCase", "PascalCase"] },
|
|
64
|
-
{ selector: ["objectLiteralProperty", "typeProperty"], format: null }
|
|
64
|
+
{ selector: ["objectLiteralProperty", "typeProperty"], format: null },
|
|
65
|
+
{ selector: "import", filter: { regex: "^_$", match: true }, format: null }
|
|
65
66
|
],
|
|
66
67
|
"no-array-constructor": 0,
|
|
67
68
|
"@typescript-eslint/no-array-constructor": 2,
|
|
@@ -86,7 +87,7 @@ export default {
|
|
|
86
87
|
"@typescript-eslint/no-for-in-array": 2,
|
|
87
88
|
"no-implied-eval": 0,
|
|
88
89
|
"@typescript-eslint/no-implied-eval": 2,
|
|
89
|
-
"@typescript-eslint/no-import-type-side-effects":
|
|
90
|
+
"@typescript-eslint/no-import-type-side-effects": 0,
|
|
90
91
|
"@typescript-eslint/no-inferrable-types": 2,
|
|
91
92
|
"no-invalid-this": 0,
|
|
92
93
|
"@typescript-eslint/no-invalid-this": 2,
|