@ghettoddos/eslint-config 1.0.0 → 1.0.2
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/dist/index.d.ts +88 -0
- package/dist/index.js +25 -10
- package/package.json +2 -1
package/dist/index.d.ts
CHANGED
|
@@ -14,6 +14,61 @@ interface RuleOptions {
|
|
|
14
14
|
* @see https://eslint.org/docs/latest/rules/accessor-pairs
|
|
15
15
|
*/
|
|
16
16
|
'accessor-pairs'?: Linter.RuleEntry<AccessorPairs>
|
|
17
|
+
/**
|
|
18
|
+
* Having line breaks styles to object, array and named imports
|
|
19
|
+
* @see https://github.com/antfu/eslint-plugin-antfu/blob/main/src/rules/consistent-chaining.md
|
|
20
|
+
*/
|
|
21
|
+
'antfu/consistent-chaining'?: Linter.RuleEntry<AntfuConsistentChaining>
|
|
22
|
+
/**
|
|
23
|
+
* Having line breaks styles to object, array and named imports
|
|
24
|
+
* @see https://github.com/antfu/eslint-plugin-antfu/blob/main/src/rules/consistent-list-newline.md
|
|
25
|
+
*/
|
|
26
|
+
'antfu/consistent-list-newline'?: Linter.RuleEntry<AntfuConsistentListNewline>
|
|
27
|
+
/**
|
|
28
|
+
* Enforce Anthony's style of curly bracket
|
|
29
|
+
* @see https://github.com/antfu/eslint-plugin-antfu/blob/main/src/rules/curly.md
|
|
30
|
+
*/
|
|
31
|
+
'antfu/curly'?: Linter.RuleEntry<[]>
|
|
32
|
+
/**
|
|
33
|
+
* Newline after if
|
|
34
|
+
* @see https://github.com/antfu/eslint-plugin-antfu/blob/main/src/rules/if-newline.md
|
|
35
|
+
*/
|
|
36
|
+
'antfu/if-newline'?: Linter.RuleEntry<[]>
|
|
37
|
+
/**
|
|
38
|
+
* Fix duplication in imports
|
|
39
|
+
* @see https://github.com/antfu/eslint-plugin-antfu/blob/main/src/rules/import-dedupe.md
|
|
40
|
+
*/
|
|
41
|
+
'antfu/import-dedupe'?: Linter.RuleEntry<[]>
|
|
42
|
+
/**
|
|
43
|
+
* Enforce consistent indentation in `unindent` template tag
|
|
44
|
+
* @see https://github.com/antfu/eslint-plugin-antfu/blob/main/src/rules/indent-unindent.md
|
|
45
|
+
*/
|
|
46
|
+
'antfu/indent-unindent'?: Linter.RuleEntry<AntfuIndentUnindent>
|
|
47
|
+
/**
|
|
48
|
+
* Prevent importing modules in `dist` folder
|
|
49
|
+
* @see https://github.com/antfu/eslint-plugin-antfu/blob/main/src/rules/no-import-dist.test.ts
|
|
50
|
+
*/
|
|
51
|
+
'antfu/no-import-dist'?: Linter.RuleEntry<[]>
|
|
52
|
+
/**
|
|
53
|
+
* Prevent importing modules in `node_modules` folder by relative or absolute path
|
|
54
|
+
* @see https://github.com/antfu/eslint-plugin-antfu/blob/main/src/rules/no-import-node-modules-by-path.test.ts
|
|
55
|
+
*/
|
|
56
|
+
'antfu/no-import-node-modules-by-path'?: Linter.RuleEntry<[]>
|
|
57
|
+
/**
|
|
58
|
+
* Prevent using top-level await
|
|
59
|
+
* @see https://github.com/antfu/eslint-plugin-antfu/blob/main/src/rules/no-top-level-await.test.ts
|
|
60
|
+
*/
|
|
61
|
+
'antfu/no-top-level-await'?: Linter.RuleEntry<[]>
|
|
62
|
+
/**
|
|
63
|
+
* Do not use `exports =`
|
|
64
|
+
* @see https://github.com/antfu/eslint-plugin-antfu/blob/main/src/rules/no-ts-export-equal.test.ts
|
|
65
|
+
*/
|
|
66
|
+
'antfu/no-ts-export-equal'?: Linter.RuleEntry<[]>
|
|
67
|
+
/**
|
|
68
|
+
* Enforce top-level functions to be declared with function keyword
|
|
69
|
+
* @see https://github.com/antfu/eslint-plugin-antfu/blob/main/src/rules/top-level-function.md
|
|
70
|
+
*/
|
|
71
|
+
'antfu/top-level-function'?: Linter.RuleEntry<[]>
|
|
17
72
|
/**
|
|
18
73
|
* Enforce linebreaks after opening and before closing array brackets
|
|
19
74
|
* @see https://eslint.org/docs/latest/rules/array-bracket-newline
|
|
@@ -5314,6 +5369,39 @@ type AccessorPairs = []|[{
|
|
|
5314
5369
|
setWithoutGet?: boolean
|
|
5315
5370
|
enforceForClassMembers?: boolean
|
|
5316
5371
|
}]
|
|
5372
|
+
// ----- antfu/consistent-chaining -----
|
|
5373
|
+
type AntfuConsistentChaining = []|[{
|
|
5374
|
+
|
|
5375
|
+
allowLeadingPropertyAccess?: boolean
|
|
5376
|
+
}]
|
|
5377
|
+
// ----- antfu/consistent-list-newline -----
|
|
5378
|
+
type AntfuConsistentListNewline = []|[{
|
|
5379
|
+
ArrayExpression?: boolean
|
|
5380
|
+
ArrayPattern?: boolean
|
|
5381
|
+
ArrowFunctionExpression?: boolean
|
|
5382
|
+
CallExpression?: boolean
|
|
5383
|
+
ExportNamedDeclaration?: boolean
|
|
5384
|
+
FunctionDeclaration?: boolean
|
|
5385
|
+
FunctionExpression?: boolean
|
|
5386
|
+
ImportDeclaration?: boolean
|
|
5387
|
+
JSONArrayExpression?: boolean
|
|
5388
|
+
JSONObjectExpression?: boolean
|
|
5389
|
+
JSXOpeningElement?: boolean
|
|
5390
|
+
NewExpression?: boolean
|
|
5391
|
+
ObjectExpression?: boolean
|
|
5392
|
+
ObjectPattern?: boolean
|
|
5393
|
+
TSFunctionType?: boolean
|
|
5394
|
+
TSInterfaceDeclaration?: boolean
|
|
5395
|
+
TSTupleType?: boolean
|
|
5396
|
+
TSTypeLiteral?: boolean
|
|
5397
|
+
TSTypeParameterDeclaration?: boolean
|
|
5398
|
+
TSTypeParameterInstantiation?: boolean
|
|
5399
|
+
}]
|
|
5400
|
+
// ----- antfu/indent-unindent -----
|
|
5401
|
+
type AntfuIndentUnindent = []|[{
|
|
5402
|
+
indent?: number
|
|
5403
|
+
tags?: string[]
|
|
5404
|
+
}]
|
|
5317
5405
|
// ----- array-bracket-newline -----
|
|
5318
5406
|
type ArrayBracketNewline = []|[(("always" | "never" | "consistent") | {
|
|
5319
5407
|
multiline?: boolean
|
package/dist/index.js
CHANGED
|
@@ -4,11 +4,12 @@ import { isPackageExists as isPackageExists3 } from "local-pkg";
|
|
|
4
4
|
|
|
5
5
|
// src/plugins.ts
|
|
6
6
|
import { default as default2 } from "@eslint-community/eslint-plugin-eslint-comments";
|
|
7
|
+
import { default as default3 } from "eslint-plugin-antfu";
|
|
7
8
|
import * as pluginImport from "eslint-plugin-import-x";
|
|
8
|
-
import { default as
|
|
9
|
-
import { default as
|
|
10
|
-
import { default as
|
|
11
|
-
import { default as
|
|
9
|
+
import { default as default4 } from "eslint-plugin-n";
|
|
10
|
+
import { default as default5 } from "eslint-plugin-perfectionist";
|
|
11
|
+
import { default as default6 } from "eslint-plugin-unicorn";
|
|
12
|
+
import { default as default7 } from "eslint-plugin-unused-imports";
|
|
12
13
|
|
|
13
14
|
// src/configs/comments.ts
|
|
14
15
|
async function comments() {
|
|
@@ -101,6 +102,7 @@ async function disables() {
|
|
|
101
102
|
files: [`**/scripts/${GLOB_SRC}`],
|
|
102
103
|
name: "disables/scripts",
|
|
103
104
|
rules: {
|
|
105
|
+
"antfu/no-top-level-await": "off",
|
|
104
106
|
"no-console": "off",
|
|
105
107
|
"ts/explicit-function-return-type": "off"
|
|
106
108
|
}
|
|
@@ -241,11 +243,16 @@ async function stylistic(options = {}) {
|
|
|
241
243
|
{
|
|
242
244
|
name: "stylistic/rules",
|
|
243
245
|
plugins: {
|
|
246
|
+
antfu: default3,
|
|
244
247
|
style: pluginStylistic
|
|
245
248
|
},
|
|
246
249
|
rules: {
|
|
247
250
|
...config2.rules,
|
|
248
|
-
"
|
|
251
|
+
"antfu/consistent-chaining": "error",
|
|
252
|
+
"antfu/consistent-list-newline": "error",
|
|
253
|
+
"antfu/curly": "error",
|
|
254
|
+
"antfu/if-newline": "error",
|
|
255
|
+
"antfu/top-level-function": "error",
|
|
249
256
|
"style/generator-star-spacing": [
|
|
250
257
|
"error",
|
|
251
258
|
{ after: true, before: false }
|
|
@@ -442,9 +449,13 @@ async function imports(options = {}) {
|
|
|
442
449
|
{
|
|
443
450
|
name: "imports/rules",
|
|
444
451
|
plugins: {
|
|
452
|
+
antfu: default3,
|
|
445
453
|
import: pluginImport
|
|
446
454
|
},
|
|
447
455
|
rules: {
|
|
456
|
+
"antfu/import-dedupe": "error",
|
|
457
|
+
"antfu/no-import-dist": "error",
|
|
458
|
+
"antfu/no-import-node-modules-by-path": "error",
|
|
448
459
|
"import/consistent-type-specifier-style": ["error", "prefer-top-level"],
|
|
449
460
|
"import/first": "error",
|
|
450
461
|
"import/no-duplicates": "error",
|
|
@@ -493,13 +504,15 @@ async function javascript(options = {}) {
|
|
|
493
504
|
{
|
|
494
505
|
name: "javascript/rules",
|
|
495
506
|
plugins: {
|
|
496
|
-
"
|
|
507
|
+
"antfu": default3,
|
|
508
|
+
"unused-imports": default7
|
|
497
509
|
},
|
|
498
510
|
rules: {
|
|
499
511
|
"accessor-pairs": [
|
|
500
512
|
"error",
|
|
501
513
|
{ enforceForClassMembers: true, setWithoutGet: true }
|
|
502
514
|
],
|
|
515
|
+
"antfu/no-top-level-await": "error",
|
|
503
516
|
"array-callback-return": "error",
|
|
504
517
|
"block-scoped-var": "error",
|
|
505
518
|
"constructor-super": "error",
|
|
@@ -839,6 +852,7 @@ async function markdown(options = {}) {
|
|
|
839
852
|
},
|
|
840
853
|
name: "markdown/disables",
|
|
841
854
|
rules: {
|
|
855
|
+
"antfu/no-top-level-await": "off",
|
|
842
856
|
"import/newline-after-import": "off",
|
|
843
857
|
"no-alert": "off",
|
|
844
858
|
"no-console": "off",
|
|
@@ -875,7 +889,7 @@ async function node() {
|
|
|
875
889
|
{
|
|
876
890
|
name: "node/rules",
|
|
877
891
|
plugins: {
|
|
878
|
-
node:
|
|
892
|
+
node: default4
|
|
879
893
|
},
|
|
880
894
|
rules: {
|
|
881
895
|
"node/handle-callback-err": ["error", "^(err|error)$"],
|
|
@@ -897,7 +911,7 @@ async function perfectionist() {
|
|
|
897
911
|
{
|
|
898
912
|
name: "perfectionist/setup",
|
|
899
913
|
plugins: {
|
|
900
|
-
perfectionist:
|
|
914
|
+
perfectionist: default5
|
|
901
915
|
},
|
|
902
916
|
rules: {
|
|
903
917
|
"perfectionist/sort-exports": [
|
|
@@ -1478,6 +1492,7 @@ async function typescript(options = {}) {
|
|
|
1478
1492
|
// Install the plugins without globs, so they can be configured separately.
|
|
1479
1493
|
name: "typescript/setup",
|
|
1480
1494
|
plugins: {
|
|
1495
|
+
antfu: default3,
|
|
1481
1496
|
ts: pluginTs
|
|
1482
1497
|
}
|
|
1483
1498
|
},
|
|
@@ -1576,10 +1591,10 @@ async function unicorn(options = {}) {
|
|
|
1576
1591
|
{
|
|
1577
1592
|
name: "unicorn/rules",
|
|
1578
1593
|
plugins: {
|
|
1579
|
-
unicorn:
|
|
1594
|
+
unicorn: default6
|
|
1580
1595
|
},
|
|
1581
1596
|
rules: {
|
|
1582
|
-
...options.allRecommended ?
|
|
1597
|
+
...options.allRecommended ? default6.configs.recommended.rules : {
|
|
1583
1598
|
"unicorn/consistent-empty-array-spread": "error",
|
|
1584
1599
|
"unicorn/error-message": "error",
|
|
1585
1600
|
"unicorn/escape-case": "error",
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ghettoddos/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.2",
|
|
5
5
|
"description": "ghettoDdOS ESLint config",
|
|
6
6
|
"author": "ghettoDdOS <pen.egor2002@gamil.com> (https://github.com/ghettoDdOS/)",
|
|
7
7
|
"license": "MIT",
|
|
@@ -46,6 +46,7 @@
|
|
|
46
46
|
"eslint-config-flat-gitignore": "^2.1.0",
|
|
47
47
|
"eslint-flat-config-utils": "^2.0.1",
|
|
48
48
|
"eslint-merge-processors": "^2.0.0",
|
|
49
|
+
"eslint-plugin-antfu": "^3.1.1",
|
|
49
50
|
"eslint-plugin-import-x": "^4.6.1",
|
|
50
51
|
"eslint-plugin-jsonc": "^2.19.1",
|
|
51
52
|
"eslint-plugin-n": "^17.16.2",
|