@kikiutils/eslint-config 6.0.0 → 7.0.1
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/base.d.ts.map +1 -1
- package/dist/base.js +198 -153
- package/dist/base.js.map +1 -1
- package/dist/style.js +1 -2
- package/dist/style.js.map +1 -1
- package/dist/vue.js +1 -2
- package/dist/vue.js.map +1 -1
- package/package.json +9 -12
- package/src/base.ts +320 -251
- package/dist/json.d.ts +0 -7
- package/dist/json.d.ts.map +0 -1
- package/dist/json.js +0 -27
- package/dist/json.js.map +0 -1
- package/src/json.ts +0 -29
package/dist/base.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.d.ts","names":[],"sources":["../src/base.ts"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"base.d.ts","names":[],"sources":["../src/base.ts"],"mappings":";;;iBAYgB,iBAAA,CAAkB,WAAA,oBAAuC,mBAAA"}
|
package/dist/base.js
CHANGED
|
@@ -1,167 +1,212 @@
|
|
|
1
1
|
import promise from "eslint-plugin-promise";
|
|
2
|
-
|
|
3
2
|
//#region src/base.ts
|
|
4
3
|
const basePerfectionistSortOptions = {
|
|
5
4
|
ignoreCase: false,
|
|
6
5
|
type: "natural"
|
|
7
6
|
};
|
|
8
7
|
function createBaseConfigs(environment = "node") {
|
|
9
|
-
return [
|
|
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
|
-
ignoreCase: false,
|
|
50
|
-
internalPattern: [
|
|
51
|
-
"^#.*",
|
|
52
|
-
"^@/.*",
|
|
53
|
-
"^~/.*"
|
|
54
|
-
],
|
|
55
|
-
type: "natural"
|
|
56
|
-
}],
|
|
57
|
-
"perfectionist/sort-interfaces": ["error", basePerfectionistSortOptions],
|
|
58
|
-
"perfectionist/sort-intersection-types": ["error", basePerfectionistSortOptions],
|
|
59
|
-
"perfectionist/sort-maps": ["error", basePerfectionistSortOptions],
|
|
60
|
-
"perfectionist/sort-modules": ["error", {
|
|
61
|
-
...basePerfectionistSortOptions,
|
|
62
|
-
groups: [
|
|
63
|
-
"declare-type",
|
|
64
|
-
["export-type", "type"],
|
|
65
|
-
"declare-interface",
|
|
66
|
-
["export-interface", "interface"],
|
|
67
|
-
"declare-enum",
|
|
68
|
-
["enum", "export-enum"],
|
|
69
|
-
"declare-class",
|
|
70
|
-
["class", "export-class"],
|
|
71
|
-
"declare-function",
|
|
72
|
-
["export-function", "function"]
|
|
8
|
+
return [
|
|
9
|
+
{ rules: {
|
|
10
|
+
"e18e/ban-dependencies": ["error", { allowed: ["axios", "rimraf"] }],
|
|
11
|
+
"e18e/prefer-static-regex": ["off"]
|
|
12
|
+
} },
|
|
13
|
+
{
|
|
14
|
+
files: ["**/*.{cjs,js,mjs}"],
|
|
15
|
+
plugins: { promise },
|
|
16
|
+
rules: {
|
|
17
|
+
...createBaseRules(environment),
|
|
18
|
+
"node/prefer-global/process": ["error", "always"]
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
files: ["**/*.{ts,tsx}"],
|
|
23
|
+
plugins: { promise },
|
|
24
|
+
rules: {
|
|
25
|
+
...createBaseRules(environment),
|
|
26
|
+
"node/prefer-global/process": ["error", "always"],
|
|
27
|
+
"ts/consistent-generic-constructors": ["error", "constructor"],
|
|
28
|
+
"ts/no-redeclare": "off"
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
files: ["**/.vscode/*.json"],
|
|
33
|
+
rules: {
|
|
34
|
+
"jsonc/sort-array-values": ["error", {
|
|
35
|
+
order: {
|
|
36
|
+
natural: true,
|
|
37
|
+
type: "asc"
|
|
38
|
+
},
|
|
39
|
+
pathPattern: "^.*$"
|
|
40
|
+
}],
|
|
41
|
+
"jsonc/sort-keys": [
|
|
42
|
+
"error",
|
|
43
|
+
"asc",
|
|
44
|
+
{
|
|
45
|
+
caseSensitive: true,
|
|
46
|
+
natural: true
|
|
47
|
+
}
|
|
73
48
|
]
|
|
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
|
-
multiline: true
|
|
122
|
-
},
|
|
123
|
-
ImportDeclaration: {
|
|
124
|
-
minProperties: 2,
|
|
125
|
-
multiline: true
|
|
126
|
-
},
|
|
127
|
-
ObjectExpression: {
|
|
128
|
-
minProperties: 2,
|
|
129
|
-
multiline: true
|
|
130
|
-
},
|
|
131
|
-
ObjectPattern: {
|
|
132
|
-
minProperties: 3,
|
|
133
|
-
multiline: true
|
|
134
|
-
}
|
|
135
|
-
}],
|
|
136
|
-
"style/operator-linebreak": [
|
|
137
|
-
"error",
|
|
138
|
-
"before",
|
|
139
|
-
{ overrides: { "=": "after" } }
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
files: ["**/*.{vue}"],
|
|
53
|
+
plugins: { promise },
|
|
54
|
+
rules: {
|
|
55
|
+
...createBaseRules(environment),
|
|
56
|
+
"ts/consistent-generic-constructors": ["error", "constructor"],
|
|
57
|
+
"ts/no-redeclare": "off"
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
];
|
|
61
|
+
}
|
|
62
|
+
function createBaseRules(environment = "node") {
|
|
63
|
+
return {
|
|
64
|
+
"antfu/consistent-list-newline": ["error", {
|
|
65
|
+
ArrayExpression: false,
|
|
66
|
+
ArrayPattern: false
|
|
67
|
+
}],
|
|
68
|
+
"antfu/curly": "off",
|
|
69
|
+
"antfu/if-newline": "off",
|
|
70
|
+
"antfu/no-top-level-await": "off",
|
|
71
|
+
"curly": ["error", "multi-line"],
|
|
72
|
+
"max-classes-per-file": ["error", 1],
|
|
73
|
+
"no-promise-executor-return": ["error", { allowVoid: true }],
|
|
74
|
+
"perfectionist/sort-array-includes": ["error", basePerfectionistSortOptions],
|
|
75
|
+
"perfectionist/sort-enums": ["error", {
|
|
76
|
+
...basePerfectionistSortOptions,
|
|
77
|
+
sortByValue: "never"
|
|
78
|
+
}],
|
|
79
|
+
"perfectionist/sort-heritage-clauses": ["error", {
|
|
80
|
+
ignoreCase: false,
|
|
81
|
+
type: "natural"
|
|
82
|
+
}],
|
|
83
|
+
"perfectionist/sort-imports": ["error", {
|
|
84
|
+
environment,
|
|
85
|
+
groups: [
|
|
86
|
+
"side-effect",
|
|
87
|
+
"side-effect-style",
|
|
88
|
+
"style",
|
|
89
|
+
["value-builtin", "type-builtin"],
|
|
90
|
+
["value-external", "type-external"],
|
|
91
|
+
["value-internal", "type-internal"],
|
|
92
|
+
["value-parent", "type-parent"],
|
|
93
|
+
["value-sibling", "type-sibling"],
|
|
94
|
+
["value-index", "type-index"],
|
|
95
|
+
"unknown"
|
|
140
96
|
],
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
"class",
|
|
147
|
-
"enum",
|
|
148
|
-
"function"
|
|
149
|
-
],
|
|
150
|
-
prev: "*"
|
|
151
|
-
},
|
|
152
|
-
{
|
|
153
|
-
blankLine: "always",
|
|
154
|
-
next: "*",
|
|
155
|
-
prev: ["class", "function"]
|
|
156
|
-
}
|
|
97
|
+
ignoreCase: false,
|
|
98
|
+
internalPattern: [
|
|
99
|
+
"^#.*",
|
|
100
|
+
"^@/.*",
|
|
101
|
+
"^~/.*"
|
|
157
102
|
],
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
103
|
+
type: "natural"
|
|
104
|
+
}],
|
|
105
|
+
"perfectionist/sort-interfaces": ["error", basePerfectionistSortOptions],
|
|
106
|
+
"perfectionist/sort-intersection-types": ["error", basePerfectionistSortOptions],
|
|
107
|
+
"perfectionist/sort-maps": ["error", basePerfectionistSortOptions],
|
|
108
|
+
"perfectionist/sort-modules": ["error", {
|
|
109
|
+
...basePerfectionistSortOptions,
|
|
110
|
+
groups: [
|
|
111
|
+
"declare-type",
|
|
112
|
+
["export-type", "type"],
|
|
113
|
+
"declare-interface",
|
|
114
|
+
["export-interface", "interface"],
|
|
115
|
+
"declare-enum",
|
|
116
|
+
["enum", "export-enum"],
|
|
117
|
+
"declare-class",
|
|
118
|
+
["class", "export-class"],
|
|
119
|
+
"declare-function",
|
|
120
|
+
["export-function", "function"]
|
|
121
|
+
]
|
|
122
|
+
}],
|
|
123
|
+
"perfectionist/sort-object-types": ["error", basePerfectionistSortOptions],
|
|
124
|
+
"perfectionist/sort-objects": ["error", basePerfectionistSortOptions],
|
|
125
|
+
"perfectionist/sort-sets": ["error", basePerfectionistSortOptions],
|
|
126
|
+
"perfectionist/sort-switch-case": ["error", {
|
|
127
|
+
ignoreCase: false,
|
|
128
|
+
type: "natural"
|
|
129
|
+
}],
|
|
130
|
+
"perfectionist/sort-union-types": ["error", basePerfectionistSortOptions],
|
|
131
|
+
"perfectionist/sort-variable-declarations": ["error", basePerfectionistSortOptions],
|
|
132
|
+
"promise/no-multiple-resolved": "error",
|
|
133
|
+
"promise/no-return-in-finally": "error",
|
|
134
|
+
"promise/no-return-wrap": "error",
|
|
135
|
+
"require-await": "error",
|
|
136
|
+
"style/array-bracket-newline": ["error", { multiline: true }],
|
|
137
|
+
"style/array-element-newline": ["error", {
|
|
138
|
+
ArrayExpression: {
|
|
139
|
+
consistent: true,
|
|
140
|
+
minItems: 2
|
|
141
|
+
},
|
|
142
|
+
ArrayPattern: { minItems: 3 }
|
|
143
|
+
}],
|
|
144
|
+
"style/arrow-parens": ["error", "always"],
|
|
145
|
+
"style/brace-style": [
|
|
146
|
+
"error",
|
|
147
|
+
"1tbs",
|
|
148
|
+
{ allowSingleLine: false }
|
|
149
|
+
],
|
|
150
|
+
"style/function-call-spacing": ["error", "never"],
|
|
151
|
+
"style/indent": ["error", 4],
|
|
152
|
+
"style/max-len": ["warn", {
|
|
153
|
+
code: 120,
|
|
154
|
+
comments: 120
|
|
155
|
+
}],
|
|
156
|
+
"style/member-delimiter-style": ["error", { multiline: {
|
|
157
|
+
delimiter: "semi",
|
|
158
|
+
requireLast: true
|
|
159
|
+
} }],
|
|
160
|
+
"style/no-extra-parens": [
|
|
161
|
+
"error",
|
|
162
|
+
"all",
|
|
163
|
+
{ nestedBinaryExpressions: false }
|
|
164
|
+
],
|
|
165
|
+
"style/no-extra-semi": "error",
|
|
166
|
+
"style/object-curly-newline": ["error", {
|
|
167
|
+
ExportDeclaration: {
|
|
168
|
+
minProperties: 2,
|
|
169
|
+
multiline: true
|
|
170
|
+
},
|
|
171
|
+
ImportDeclaration: {
|
|
172
|
+
minProperties: 2,
|
|
173
|
+
multiline: true
|
|
174
|
+
},
|
|
175
|
+
ObjectExpression: {
|
|
176
|
+
minProperties: 2,
|
|
177
|
+
multiline: true
|
|
178
|
+
},
|
|
179
|
+
ObjectPattern: {
|
|
180
|
+
minProperties: 3,
|
|
181
|
+
multiline: true
|
|
182
|
+
}
|
|
183
|
+
}],
|
|
184
|
+
"style/operator-linebreak": [
|
|
185
|
+
"error",
|
|
186
|
+
"before",
|
|
187
|
+
{ overrides: { "=": "after" } }
|
|
188
|
+
],
|
|
189
|
+
"style/padding-line-between-statements": [
|
|
190
|
+
"error",
|
|
191
|
+
{
|
|
192
|
+
blankLine: "always",
|
|
193
|
+
next: [
|
|
194
|
+
"class",
|
|
195
|
+
"enum",
|
|
196
|
+
"function"
|
|
197
|
+
],
|
|
198
|
+
prev: "*"
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
blankLine: "always",
|
|
202
|
+
next: "*",
|
|
203
|
+
prev: ["class", "function"]
|
|
204
|
+
}
|
|
205
|
+
],
|
|
206
|
+
"style/semi": ["error", "always"]
|
|
207
|
+
};
|
|
163
208
|
}
|
|
164
|
-
|
|
165
209
|
//#endregion
|
|
166
210
|
export { createBaseConfigs };
|
|
211
|
+
|
|
167
212
|
//# sourceMappingURL=base.js.map
|
package/dist/base.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.js","names":[],"sources":["../src/base.ts"],"sourcesContent":["import type { TypedFlatConfigItem } from '@antfu/eslint-config';\n// @ts-expect-error No declare file.\nimport promise from 'eslint-plugin-promise';\n\nconst basePerfectionistSortOptions = {\n ignoreCase: false,\n type: 'natural',\n} as const;\n\nexport function createBaseConfigs(environment: 'bun' | 'node' = 'node'): TypedFlatConfigItem[] {\n return [\n {\n files: ['**/*.{cjs,js,mjs,ts,tsx}'],\n rules: {\n 'node/prefer-global/process': [\n 'error',\n 'always',\n ],\n },\n },\n {\n files: ['**/*.{cjs,js,mjs,ts,tsx,vue}'],\n plugins: { promise },\n rules: {\n 'antfu/consistent-list-newline': [\n 'error',\n {\n ArrayExpression: false,\n ArrayPattern: false,\n },\n ],\n 'antfu/curly': 'off',\n 'antfu/if-newline': 'off',\n 'antfu/no-top-level-await': 'off',\n 'curly': [\n 'error',\n 'multi-line',\n ],\n 'max-classes-per-file': [\n 'error',\n 1,\n ],\n 'no-promise-executor-return': [\n 'error',\n { allowVoid: true },\n ],\n 'perfectionist/sort-array-includes': [\n 'error',\n basePerfectionistSortOptions,\n ],\n 'perfectionist/sort-enums': [\n 'error',\n {\n ...basePerfectionistSortOptions,\n sortByValue: 'never',\n },\n ],\n 'perfectionist/sort-heritage-clauses': [\n 'error',\n {\n ignoreCase: false,\n type: 'natural',\n },\n ],\n 'perfectionist/sort-imports': [\n 'error',\n {\n environment,\n groups: [\n 'side-effect',\n 'side-effect-style',\n 'style',\n [\n 'value-builtin',\n 'type-builtin',\n ],\n [\n 'value-external',\n 'type-external',\n ],\n [\n 'value-internal',\n 'type-internal',\n ],\n [\n 'value-parent',\n 'type-parent',\n ],\n [\n 'value-sibling',\n 'type-sibling',\n ],\n [\n 'value-index',\n 'type-index',\n ],\n 'unknown',\n ],\n ignoreCase: false,\n internalPattern: [\n '^#.*',\n '^@/.*',\n '^~/.*',\n ],\n type: 'natural',\n },\n ],\n 'perfectionist/sort-interfaces': [\n 'error',\n basePerfectionistSortOptions,\n ],\n 'perfectionist/sort-intersection-types': [\n 'error',\n basePerfectionistSortOptions,\n ],\n 'perfectionist/sort-maps': [\n 'error',\n basePerfectionistSortOptions,\n ],\n 'perfectionist/sort-modules': [\n 'error',\n {\n ...basePerfectionistSortOptions,\n groups: [\n 'declare-type',\n [\n 'export-type',\n 'type',\n ],\n 'declare-interface',\n [\n 'export-interface',\n 'interface',\n ],\n 'declare-enum',\n [\n 'enum',\n 'export-enum',\n ],\n 'declare-class',\n [\n 'class',\n 'export-class',\n ],\n 'declare-function',\n [\n 'export-function',\n 'function',\n ],\n ],\n },\n ],\n 'perfectionist/sort-object-types': [\n 'error',\n basePerfectionistSortOptions,\n ],\n 'perfectionist/sort-objects': [\n 'error',\n basePerfectionistSortOptions,\n ],\n 'perfectionist/sort-sets': [\n 'error',\n basePerfectionistSortOptions,\n ],\n 'perfectionist/sort-switch-case': [\n 'error',\n {\n ignoreCase: false,\n type: 'natural',\n },\n ],\n 'perfectionist/sort-union-types': [\n 'error',\n basePerfectionistSortOptions,\n ],\n 'perfectionist/sort-variable-declarations': [\n 'error',\n basePerfectionistSortOptions,\n ],\n 'promise/no-multiple-resolved': 'error',\n 'promise/no-return-in-finally': 'error',\n 'promise/no-return-wrap': 'error',\n 'require-await': 'error',\n 'style/array-bracket-newline': [\n 'error',\n { multiline: true },\n ],\n 'style/array-element-newline': [\n 'error',\n {\n ArrayExpression: {\n consistent: true,\n minItems: 2,\n },\n ArrayPattern: { minItems: 3 },\n },\n ],\n 'style/arrow-parens': [\n 'error',\n 'always',\n ],\n 'style/brace-style': [\n 'error',\n '1tbs',\n { allowSingleLine: false },\n ],\n 'style/function-call-spacing': [\n 'error',\n 'never',\n ],\n 'style/indent': [\n 'error',\n 4,\n ],\n 'style/max-len': [\n 'warn',\n {\n code: 120,\n comments: 120,\n },\n ],\n 'style/member-delimiter-style': [\n 'error',\n {\n multiline: {\n delimiter: 'semi',\n requireLast: true,\n },\n },\n ],\n 'style/no-extra-parens': [\n 'error',\n 'all',\n { nestedBinaryExpressions: false },\n ],\n 'style/no-extra-semi': 'error',\n 'style/object-curly-newline': [\n 'error',\n {\n ExportDeclaration: {\n minProperties: 2,\n multiline: true,\n },\n ImportDeclaration: {\n minProperties: 2,\n multiline: true,\n },\n ObjectExpression: {\n minProperties: 2,\n multiline: true,\n },\n ObjectPattern: {\n minProperties: 3,\n multiline: true,\n },\n },\n ],\n 'style/operator-linebreak': [\n 'error',\n 'before',\n { overrides: { '=': 'after' } },\n ],\n 'style/padding-line-between-statements': [\n 'error',\n {\n blankLine: 'always',\n next: [\n 'class',\n 'enum',\n 'function',\n ],\n prev: '*',\n },\n {\n blankLine: 'always',\n next: '*',\n prev: [\n 'class',\n 'function',\n ],\n },\n ],\n 'style/semi': [\n 'error',\n 'always',\n ],\n 'ts/consistent-generic-constructors': [\n 'error',\n 'constructor',\n ],\n 'ts/no-redeclare': 'off',\n },\n },\n ];\n}\n"],"mappings":";;;AAIA,MAAM,+BAA+B;CACjC,YAAY;CACZ,MAAM;CACT;AAED,SAAgB,kBAAkB,cAA8B,QAA+B;AAC3F,QAAO,CACH;EACI,OAAO,CAAC,2BAA2B;EACnC,OAAO,EACH,8BAA8B,CAC1B,SACA,SACH,EACJ;EACJ,EACD;EACI,OAAO,CAAC,+BAA+B;EACvC,SAAS,EAAE,SAAS;EACpB,OAAO;GACH,iCAAiC,CAC7B,SACA;IACI,iBAAiB;IACjB,cAAc;IACjB,CACJ;GACD,eAAe;GACf,oBAAoB;GACpB,4BAA4B;GAC5B,SAAS,CACL,SACA,aACH;GACD,wBAAwB,CACpB,SACA,EACH;GACD,8BAA8B,CAC1B,SACA,EAAE,WAAW,MAAM,CACtB;GACD,qCAAqC,CACjC,SACA,6BACH;GACD,4BAA4B,CACxB,SACA;IACI,GAAG;IACH,aAAa;IAChB,CACJ;GACD,uCAAuC,CACnC,SACA;IACI,YAAY;IACZ,MAAM;IACT,CACJ;GACD,8BAA8B,CAC1B,SACA;IACI;IACA,QAAQ;KACJ;KACA;KACA;KACA,CACI,iBACA,eACH;KACD,CACI,kBACA,gBACH;KACD,CACI,kBACA,gBACH;KACD,CACI,gBACA,cACH;KACD,CACI,iBACA,eACH;KACD,CACI,eACA,aACH;KACD;KACH;IACD,YAAY;IACZ,iBAAiB;KACb;KACA;KACA;KACH;IACD,MAAM;IACT,CACJ;GACD,iCAAiC,CAC7B,SACA,6BACH;GACD,yCAAyC,CACrC,SACA,6BACH;GACD,2BAA2B,CACvB,SACA,6BACH;GACD,8BAA8B,CAC1B,SACA;IACI,GAAG;IACH,QAAQ;KACJ;KACA,CACI,eACA,OACH;KACD;KACA,CACI,oBACA,YACH;KACD;KACA,CACI,QACA,cACH;KACD;KACA,CACI,SACA,eACH;KACD;KACA,CACI,mBACA,WACH;KACJ;IACJ,CACJ;GACD,mCAAmC,CAC/B,SACA,6BACH;GACD,8BAA8B,CAC1B,SACA,6BACH;GACD,2BAA2B,CACvB,SACA,6BACH;GACD,kCAAkC,CAC9B,SACA;IACI,YAAY;IACZ,MAAM;IACT,CACJ;GACD,kCAAkC,CAC9B,SACA,6BACH;GACD,4CAA4C,CACxC,SACA,6BACH;GACD,gCAAgC;GAChC,gCAAgC;GAChC,0BAA0B;GAC1B,iBAAiB;GACjB,+BAA+B,CAC3B,SACA,EAAE,WAAW,MAAM,CACtB;GACD,+BAA+B,CAC3B,SACA;IACI,iBAAiB;KACb,YAAY;KACZ,UAAU;KACb;IACD,cAAc,EAAE,UAAU,GAAG;IAChC,CACJ;GACD,sBAAsB,CAClB,SACA,SACH;GACD,qBAAqB;IACjB;IACA;IACA,EAAE,iBAAiB,OAAO;IAC7B;GACD,+BAA+B,CAC3B,SACA,QACH;GACD,gBAAgB,CACZ,SACA,EACH;GACD,iBAAiB,CACb,QACA;IACI,MAAM;IACN,UAAU;IACb,CACJ;GACD,gCAAgC,CAC5B,SACA,EACI,WAAW;IACP,WAAW;IACX,aAAa;IAChB,EACJ,CACJ;GACD,yBAAyB;IACrB;IACA;IACA,EAAE,yBAAyB,OAAO;IACrC;GACD,uBAAuB;GACvB,8BAA8B,CAC1B,SACA;IACI,mBAAmB;KACf,eAAe;KACf,WAAW;KACd;IACD,mBAAmB;KACf,eAAe;KACf,WAAW;KACd;IACD,kBAAkB;KACd,eAAe;KACf,WAAW;KACd;IACD,eAAe;KACX,eAAe;KACf,WAAW;KACd;IACJ,CACJ;GACD,4BAA4B;IACxB;IACA;IACA,EAAE,WAAW,EAAE,KAAK,SAAS,EAAE;IAClC;GACD,yCAAyC;IACrC;IACA;KACI,WAAW;KACX,MAAM;MACF;MACA;MACA;MACH;KACD,MAAM;KACT;IACD;KACI,WAAW;KACX,MAAM;KACN,MAAM,CACF,SACA,WACH;KACJ;IACJ;GACD,cAAc,CACV,SACA,SACH;GACD,sCAAsC,CAClC,SACA,cACH;GACD,mBAAmB;GACtB;EACJ,CACJ"}
|
|
1
|
+
{"version":3,"file":"base.js","names":[],"sources":["../src/base.ts"],"sourcesContent":["import type {\n Rules,\n TypedFlatConfigItem,\n} from '@antfu/eslint-config';\n// @ts-expect-error No declare file.\nimport promise from 'eslint-plugin-promise';\n\nconst basePerfectionistSortOptions = {\n ignoreCase: false,\n type: 'natural',\n} as const;\n\nexport function createBaseConfigs(environment: 'bun' | 'node' = 'node'): TypedFlatConfigItem[] {\n return [\n // All files\n {\n rules: {\n 'e18e/ban-dependencies': [\n 'error',\n {\n allowed: [\n 'axios',\n 'rimraf',\n ],\n },\n ],\n 'e18e/prefer-static-regex': ['off'],\n },\n },\n // JavaScript\n {\n files: ['**/*.{cjs,js,mjs}'],\n plugins: { promise },\n rules: {\n ...createBaseRules(environment),\n 'node/prefer-global/process': [\n 'error',\n 'always',\n ],\n },\n },\n // TypeScript\n {\n files: ['**/*.{ts,tsx}'],\n plugins: { promise },\n rules: {\n ...createBaseRules(environment),\n 'node/prefer-global/process': [\n 'error',\n 'always',\n ],\n 'ts/consistent-generic-constructors': [\n 'error',\n 'constructor',\n ],\n 'ts/no-redeclare': 'off',\n },\n },\n // VsCode jsonc\n {\n files: ['**/.vscode/*.json'],\n rules: {\n 'jsonc/sort-array-values': [\n 'error',\n {\n order: {\n natural: true,\n type: 'asc',\n },\n pathPattern: '^.*$',\n },\n ],\n 'jsonc/sort-keys': [\n 'error',\n 'asc',\n {\n caseSensitive: true,\n natural: true,\n },\n ],\n },\n },\n // Vue\n {\n files: ['**/*.{vue}'],\n plugins: { promise },\n rules: {\n ...createBaseRules(environment),\n 'ts/consistent-generic-constructors': [\n 'error',\n 'constructor',\n ],\n 'ts/no-redeclare': 'off',\n },\n },\n ];\n}\n\nfunction createBaseRules(environment: 'bun' | 'node' = 'node'): Rules {\n return {\n 'antfu/consistent-list-newline': [\n 'error',\n {\n ArrayExpression: false,\n ArrayPattern: false,\n },\n ],\n 'antfu/curly': 'off',\n 'antfu/if-newline': 'off',\n 'antfu/no-top-level-await': 'off',\n 'curly': [\n 'error',\n 'multi-line',\n ],\n 'max-classes-per-file': [\n 'error',\n 1,\n ],\n 'no-promise-executor-return': [\n 'error',\n { allowVoid: true },\n ],\n 'perfectionist/sort-array-includes': [\n 'error',\n basePerfectionistSortOptions,\n ],\n 'perfectionist/sort-enums': [\n 'error',\n {\n ...basePerfectionistSortOptions,\n sortByValue: 'never',\n },\n ],\n 'perfectionist/sort-heritage-clauses': [\n 'error',\n {\n ignoreCase: false,\n type: 'natural',\n },\n ],\n 'perfectionist/sort-imports': [\n 'error',\n {\n environment,\n groups: [\n 'side-effect',\n 'side-effect-style',\n 'style',\n [\n 'value-builtin',\n 'type-builtin',\n ],\n [\n 'value-external',\n 'type-external',\n ],\n [\n 'value-internal',\n 'type-internal',\n ],\n [\n 'value-parent',\n 'type-parent',\n ],\n [\n 'value-sibling',\n 'type-sibling',\n ],\n [\n 'value-index',\n 'type-index',\n ],\n 'unknown',\n ],\n ignoreCase: false,\n internalPattern: [\n '^#.*',\n '^@/.*',\n '^~/.*',\n ],\n type: 'natural',\n },\n ],\n 'perfectionist/sort-interfaces': [\n 'error',\n basePerfectionistSortOptions,\n ],\n 'perfectionist/sort-intersection-types': [\n 'error',\n basePerfectionistSortOptions,\n ],\n 'perfectionist/sort-maps': [\n 'error',\n basePerfectionistSortOptions,\n ],\n 'perfectionist/sort-modules': [\n 'error',\n {\n ...basePerfectionistSortOptions,\n groups: [\n 'declare-type',\n [\n 'export-type',\n 'type',\n ],\n 'declare-interface',\n [\n 'export-interface',\n 'interface',\n ],\n 'declare-enum',\n [\n 'enum',\n 'export-enum',\n ],\n 'declare-class',\n [\n 'class',\n 'export-class',\n ],\n 'declare-function',\n [\n 'export-function',\n 'function',\n ],\n ],\n },\n ],\n 'perfectionist/sort-object-types': [\n 'error',\n basePerfectionistSortOptions,\n ],\n 'perfectionist/sort-objects': [\n 'error',\n basePerfectionistSortOptions,\n ],\n 'perfectionist/sort-sets': [\n 'error',\n basePerfectionistSortOptions,\n ],\n 'perfectionist/sort-switch-case': [\n 'error',\n {\n ignoreCase: false,\n type: 'natural',\n },\n ],\n 'perfectionist/sort-union-types': [\n 'error',\n basePerfectionistSortOptions,\n ],\n 'perfectionist/sort-variable-declarations': [\n 'error',\n basePerfectionistSortOptions,\n ],\n 'promise/no-multiple-resolved': 'error',\n 'promise/no-return-in-finally': 'error',\n 'promise/no-return-wrap': 'error',\n 'require-await': 'error',\n 'style/array-bracket-newline': [\n 'error',\n { multiline: true },\n ],\n 'style/array-element-newline': [\n 'error',\n {\n ArrayExpression: {\n consistent: true,\n minItems: 2,\n },\n ArrayPattern: { minItems: 3 },\n },\n ],\n 'style/arrow-parens': [\n 'error',\n 'always',\n ],\n 'style/brace-style': [\n 'error',\n '1tbs',\n { allowSingleLine: false },\n ],\n 'style/function-call-spacing': [\n 'error',\n 'never',\n ],\n 'style/indent': [\n 'error',\n 4,\n ],\n 'style/max-len': [\n 'warn',\n {\n code: 120,\n comments: 120,\n },\n ],\n 'style/member-delimiter-style': [\n 'error',\n {\n multiline: {\n delimiter: 'semi',\n requireLast: true,\n },\n },\n ],\n 'style/no-extra-parens': [\n 'error',\n 'all',\n { nestedBinaryExpressions: false },\n ],\n 'style/no-extra-semi': 'error',\n 'style/object-curly-newline': [\n 'error',\n {\n ExportDeclaration: {\n minProperties: 2,\n multiline: true,\n },\n ImportDeclaration: {\n minProperties: 2,\n multiline: true,\n },\n ObjectExpression: {\n minProperties: 2,\n multiline: true,\n },\n ObjectPattern: {\n minProperties: 3,\n multiline: true,\n },\n },\n ],\n 'style/operator-linebreak': [\n 'error',\n 'before',\n { overrides: { '=': 'after' } },\n ],\n 'style/padding-line-between-statements': [\n 'error',\n {\n blankLine: 'always',\n next: [\n 'class',\n 'enum',\n 'function',\n ],\n prev: '*',\n },\n {\n blankLine: 'always',\n next: '*',\n prev: [\n 'class',\n 'function',\n ],\n },\n ],\n 'style/semi': [\n 'error',\n 'always',\n ],\n };\n}\n"],"mappings":";;AAOA,MAAM,+BAA+B;CACjC,YAAY;CACZ,MAAM;CACT;AAED,SAAgB,kBAAkB,cAA8B,QAA+B;AAC3F,QAAO;EAEH,EACI,OAAO;GACH,yBAAyB,CACrB,SACA,EACI,SAAS,CACL,SACA,SACH,EACJ,CACJ;GACD,4BAA4B,CAAC,MAAM;GACtC,EACJ;EAED;GACI,OAAO,CAAC,oBAAoB;GAC5B,SAAS,EAAE,SAAS;GACpB,OAAO;IACH,GAAG,gBAAgB,YAAY;IAC/B,8BAA8B,CAC1B,SACA,SACH;IACJ;GACJ;EAED;GACI,OAAO,CAAC,gBAAgB;GACxB,SAAS,EAAE,SAAS;GACpB,OAAO;IACH,GAAG,gBAAgB,YAAY;IAC/B,8BAA8B,CAC1B,SACA,SACH;IACD,sCAAsC,CAClC,SACA,cACH;IACD,mBAAmB;IACtB;GACJ;EAED;GACI,OAAO,CAAC,oBAAoB;GAC5B,OAAO;IACH,2BAA2B,CACvB,SACA;KACI,OAAO;MACH,SAAS;MACT,MAAM;MACT;KACD,aAAa;KAChB,CACJ;IACD,mBAAmB;KACf;KACA;KACA;MACI,eAAe;MACf,SAAS;MACZ;KACJ;IACJ;GACJ;EAED;GACI,OAAO,CAAC,aAAa;GACrB,SAAS,EAAE,SAAS;GACpB,OAAO;IACH,GAAG,gBAAgB,YAAY;IAC/B,sCAAsC,CAClC,SACA,cACH;IACD,mBAAmB;IACtB;GACJ;EACJ;;AAGL,SAAS,gBAAgB,cAA8B,QAAe;AAClE,QAAO;EACH,iCAAiC,CAC7B,SACA;GACI,iBAAiB;GACjB,cAAc;GACjB,CACJ;EACD,eAAe;EACf,oBAAoB;EACpB,4BAA4B;EAC5B,SAAS,CACL,SACA,aACH;EACD,wBAAwB,CACpB,SACA,EACH;EACD,8BAA8B,CAC1B,SACA,EAAE,WAAW,MAAM,CACtB;EACD,qCAAqC,CACjC,SACA,6BACH;EACD,4BAA4B,CACxB,SACA;GACI,GAAG;GACH,aAAa;GAChB,CACJ;EACD,uCAAuC,CACnC,SACA;GACI,YAAY;GACZ,MAAM;GACT,CACJ;EACD,8BAA8B,CAC1B,SACA;GACI;GACA,QAAQ;IACJ;IACA;IACA;IACA,CACI,iBACA,eACH;IACD,CACI,kBACA,gBACH;IACD,CACI,kBACA,gBACH;IACD,CACI,gBACA,cACH;IACD,CACI,iBACA,eACH;IACD,CACI,eACA,aACH;IACD;IACH;GACD,YAAY;GACZ,iBAAiB;IACb;IACA;IACA;IACH;GACD,MAAM;GACT,CACJ;EACD,iCAAiC,CAC7B,SACA,6BACH;EACD,yCAAyC,CACrC,SACA,6BACH;EACD,2BAA2B,CACvB,SACA,6BACH;EACD,8BAA8B,CAC1B,SACA;GACI,GAAG;GACH,QAAQ;IACJ;IACA,CACI,eACA,OACH;IACD;IACA,CACI,oBACA,YACH;IACD;IACA,CACI,QACA,cACH;IACD;IACA,CACI,SACA,eACH;IACD;IACA,CACI,mBACA,WACH;IACJ;GACJ,CACJ;EACD,mCAAmC,CAC/B,SACA,6BACH;EACD,8BAA8B,CAC1B,SACA,6BACH;EACD,2BAA2B,CACvB,SACA,6BACH;EACD,kCAAkC,CAC9B,SACA;GACI,YAAY;GACZ,MAAM;GACT,CACJ;EACD,kCAAkC,CAC9B,SACA,6BACH;EACD,4CAA4C,CACxC,SACA,6BACH;EACD,gCAAgC;EAChC,gCAAgC;EAChC,0BAA0B;EAC1B,iBAAiB;EACjB,+BAA+B,CAC3B,SACA,EAAE,WAAW,MAAM,CACtB;EACD,+BAA+B,CAC3B,SACA;GACI,iBAAiB;IACb,YAAY;IACZ,UAAU;IACb;GACD,cAAc,EAAE,UAAU,GAAG;GAChC,CACJ;EACD,sBAAsB,CAClB,SACA,SACH;EACD,qBAAqB;GACjB;GACA;GACA,EAAE,iBAAiB,OAAO;GAC7B;EACD,+BAA+B,CAC3B,SACA,QACH;EACD,gBAAgB,CACZ,SACA,EACH;EACD,iBAAiB,CACb,QACA;GACI,MAAM;GACN,UAAU;GACb,CACJ;EACD,gCAAgC,CAC5B,SACA,EACI,WAAW;GACP,WAAW;GACX,aAAa;GAChB,EACJ,CACJ;EACD,yBAAyB;GACrB;GACA;GACA,EAAE,yBAAyB,OAAO;GACrC;EACD,uBAAuB;EACvB,8BAA8B,CAC1B,SACA;GACI,mBAAmB;IACf,eAAe;IACf,WAAW;IACd;GACD,mBAAmB;IACf,eAAe;IACf,WAAW;IACd;GACD,kBAAkB;IACd,eAAe;IACf,WAAW;IACd;GACD,eAAe;IACX,eAAe;IACf,WAAW;IACd;GACJ,CACJ;EACD,4BAA4B;GACxB;GACA;GACA,EAAE,WAAW,EAAE,KAAK,SAAS,EAAE;GAClC;EACD,yCAAyC;GACrC;GACA;IACI,WAAW;IACX,MAAM;KACF;KACA;KACA;KACH;IACD,MAAM;IACT;GACD;IACI,WAAW;IACX,MAAM;IACN,MAAM,CACF,SACA,WACH;IACJ;GACJ;EACD,cAAc,CACV,SACA,SACH;EACJ"}
|
package/dist/style.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import format from "eslint-plugin-format";
|
|
2
|
-
|
|
3
2
|
//#region src/style.ts
|
|
4
3
|
function createPrettierCssConfig(parser) {
|
|
5
4
|
return {
|
|
@@ -21,7 +20,7 @@ function createStyleFilesConfigs() {
|
|
|
21
20
|
createPrettierCssConfig("scss")
|
|
22
21
|
];
|
|
23
22
|
}
|
|
24
|
-
|
|
25
23
|
//#endregion
|
|
26
24
|
export { createStyleFilesConfigs };
|
|
25
|
+
|
|
27
26
|
//# sourceMappingURL=style.js.map
|
package/dist/style.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style.js","names":[],"sources":["../src/style.ts"],"sourcesContent":["import type { TypedFlatConfigItem } from '@antfu/eslint-config';\nimport format from 'eslint-plugin-format';\n\nfunction createPrettierCssConfig(parser: 'css' | 'sass' | 'scss'): TypedFlatConfigItem {\n return {\n files: [`**/*.${parser}`],\n languageOptions: { parser: format.parserPlain },\n plugins: { format },\n rules: {\n 'format/prettier': [\n 'error',\n {\n parser,\n printWidth: 120,\n singleQuote: true,\n tabWidth: 4,\n },\n ],\n },\n };\n}\n\nexport function createStyleFilesConfigs(): TypedFlatConfigItem[] {\n return [\n createPrettierCssConfig('css'),\n createPrettierCssConfig('sass'),\n createPrettierCssConfig('scss'),\n ];\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"style.js","names":[],"sources":["../src/style.ts"],"sourcesContent":["import type { TypedFlatConfigItem } from '@antfu/eslint-config';\nimport format from 'eslint-plugin-format';\n\nfunction createPrettierCssConfig(parser: 'css' | 'sass' | 'scss'): TypedFlatConfigItem {\n return {\n files: [`**/*.${parser}`],\n languageOptions: { parser: format.parserPlain },\n plugins: { format },\n rules: {\n 'format/prettier': [\n 'error',\n {\n parser,\n printWidth: 120,\n singleQuote: true,\n tabWidth: 4,\n },\n ],\n },\n };\n}\n\nexport function createStyleFilesConfigs(): TypedFlatConfigItem[] {\n return [\n createPrettierCssConfig('css'),\n createPrettierCssConfig('sass'),\n createPrettierCssConfig('scss'),\n ];\n}\n"],"mappings":";;AAGA,SAAS,wBAAwB,QAAsD;AACnF,QAAO;EACH,OAAO,CAAC,QAAQ,SAAS;EACzB,iBAAiB,EAAE,QAAQ,OAAO,aAAa;EAC/C,SAAS,EAAE,QAAQ;EACnB,OAAO,EACH,mBAAmB,CACf,SACA;GACI;GACA,YAAY;GACZ,aAAa;GACb,UAAU;GACb,CACJ,EACJ;EACJ;;AAGL,SAAgB,0BAAiD;AAC7D,QAAO;EACH,wBAAwB,MAAM;EAC9B,wBAAwB,OAAO;EAC/B,wBAAwB,OAAO;EAClC"}
|
package/dist/vue.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import kikiutilsTailwindcss from "@kikiutils/eslint-plugin-tailwindcss";
|
|
2
2
|
import kikiutilsEslintPluginVue from "@kikiutils/eslint-plugin-vue";
|
|
3
3
|
import tailwindcss from "eslint-plugin-tailwindcss";
|
|
4
|
-
|
|
5
4
|
//#region src/vue.ts
|
|
6
5
|
function createVueConfig() {
|
|
7
6
|
return {
|
|
@@ -57,7 +56,7 @@ function createVueConfig() {
|
|
|
57
56
|
}
|
|
58
57
|
};
|
|
59
58
|
}
|
|
60
|
-
|
|
61
59
|
//#endregion
|
|
62
60
|
export { createVueConfig };
|
|
61
|
+
|
|
63
62
|
//# sourceMappingURL=vue.js.map
|
package/dist/vue.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vue.js","names":[],"sources":["../src/vue.ts"],"sourcesContent":["import type { TypedFlatConfigItem } from '@antfu/eslint-config';\n// @ts-expect-error No declare file.\nimport kikiutilsTailwindcss from '@kikiutils/eslint-plugin-tailwindcss';\n// @ts-expect-error Ignore this error.\nimport kikiutilsEslintPluginVue from '@kikiutils/eslint-plugin-vue';\n// @ts-expect-error No declare file.\nimport tailwindcss from 'eslint-plugin-tailwindcss';\n\nexport function createVueConfig(): TypedFlatConfigItem {\n return {\n files: ['**/*.vue'],\n plugins: {\n '@kikiutils/tailwindcss': kikiutilsTailwindcss,\n '@kikiutils/vue': kikiutilsEslintPluginVue,\n tailwindcss,\n },\n rules: {\n '@kikiutils/tailwindcss/classnames-order': 'error',\n '@kikiutils/vue/attributes-order': [\n 'error',\n { alphabetical: true },\n ],\n '@kikiutils/vue/no-extra-space-in-class': 'error',\n 'style/max-len': 'off',\n 'tailwindcss/classnames-order': 'off',\n 'tailwindcss/enforces-negative-arbitrary-values': 'error',\n 'tailwindcss/enforces-shorthand': 'error',\n 'tailwindcss/no-unnecessary-arbitrary-value': 'error',\n 'vue/attribute-hyphenation': 'error',\n 'vue/attributes-order': 'off',\n 'vue/block-order': [\n 'error',\n {\n order: [\n 'template',\n 'script',\n 'style',\n ],\n },\n ],\n 'vue/component-api-style': 'error',\n 'vue/define-emits-declaration': 'error',\n 'vue/define-props-declaration': 'error',\n 'vue/enforce-style-attribute': 'error',\n 'vue/html-closing-bracket-newline': 'error',\n 'vue/html-closing-bracket-spacing': 'error',\n 'vue/html-indent': [\n 'error',\n 4,\n ],\n 'vue/max-attributes-per-line': [\n 'error',\n {\n multiline: 1,\n singleline: 1,\n },\n ],\n 'vue/max-len': [\n 'warn',\n {\n code: 120,\n comments: 120,\n template: 120,\n },\n ],\n 'vue/no-dupe-keys': 'error',\n 'vue/no-lone-template': 'error',\n 'vue/no-multi-spaces': 'error',\n 'vue/no-multiple-objects-in-class': 'error',\n 'vue/no-root-v-if': 'error',\n 'vue/no-template-target-blank': 'error',\n 'vue/no-v-html': 'error',\n 'vue/prefer-define-options': 'error',\n 'vue/prefer-separate-static-class': 'error',\n 'vue/require-explicit-emits': 'error',\n 'vue/require-typed-ref': 'error',\n },\n };\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"vue.js","names":[],"sources":["../src/vue.ts"],"sourcesContent":["import type { TypedFlatConfigItem } from '@antfu/eslint-config';\n// @ts-expect-error No declare file.\nimport kikiutilsTailwindcss from '@kikiutils/eslint-plugin-tailwindcss';\n// @ts-expect-error Ignore this error.\nimport kikiutilsEslintPluginVue from '@kikiutils/eslint-plugin-vue';\n// @ts-expect-error No declare file.\nimport tailwindcss from 'eslint-plugin-tailwindcss';\n\nexport function createVueConfig(): TypedFlatConfigItem {\n return {\n files: ['**/*.vue'],\n plugins: {\n '@kikiutils/tailwindcss': kikiutilsTailwindcss,\n '@kikiutils/vue': kikiutilsEslintPluginVue,\n tailwindcss,\n },\n rules: {\n '@kikiutils/tailwindcss/classnames-order': 'error',\n '@kikiutils/vue/attributes-order': [\n 'error',\n { alphabetical: true },\n ],\n '@kikiutils/vue/no-extra-space-in-class': 'error',\n 'style/max-len': 'off',\n 'tailwindcss/classnames-order': 'off',\n 'tailwindcss/enforces-negative-arbitrary-values': 'error',\n 'tailwindcss/enforces-shorthand': 'error',\n 'tailwindcss/no-unnecessary-arbitrary-value': 'error',\n 'vue/attribute-hyphenation': 'error',\n 'vue/attributes-order': 'off',\n 'vue/block-order': [\n 'error',\n {\n order: [\n 'template',\n 'script',\n 'style',\n ],\n },\n ],\n 'vue/component-api-style': 'error',\n 'vue/define-emits-declaration': 'error',\n 'vue/define-props-declaration': 'error',\n 'vue/enforce-style-attribute': 'error',\n 'vue/html-closing-bracket-newline': 'error',\n 'vue/html-closing-bracket-spacing': 'error',\n 'vue/html-indent': [\n 'error',\n 4,\n ],\n 'vue/max-attributes-per-line': [\n 'error',\n {\n multiline: 1,\n singleline: 1,\n },\n ],\n 'vue/max-len': [\n 'warn',\n {\n code: 120,\n comments: 120,\n template: 120,\n },\n ],\n 'vue/no-dupe-keys': 'error',\n 'vue/no-lone-template': 'error',\n 'vue/no-multi-spaces': 'error',\n 'vue/no-multiple-objects-in-class': 'error',\n 'vue/no-root-v-if': 'error',\n 'vue/no-template-target-blank': 'error',\n 'vue/no-v-html': 'error',\n 'vue/prefer-define-options': 'error',\n 'vue/prefer-separate-static-class': 'error',\n 'vue/require-explicit-emits': 'error',\n 'vue/require-typed-ref': 'error',\n },\n };\n}\n"],"mappings":";;;;AAQA,SAAgB,kBAAuC;AACnD,QAAO;EACH,OAAO,CAAC,WAAW;EACnB,SAAS;GACL,0BAA0B;GAC1B,kBAAkB;GAClB;GACH;EACD,OAAO;GACH,2CAA2C;GAC3C,mCAAmC,CAC/B,SACA,EAAE,cAAc,MAAM,CACzB;GACD,0CAA0C;GAC1C,iBAAiB;GACjB,gCAAgC;GAChC,kDAAkD;GAClD,kCAAkC;GAClC,8CAA8C;GAC9C,6BAA6B;GAC7B,wBAAwB;GACxB,mBAAmB,CACf,SACA,EACI,OAAO;IACH;IACA;IACA;IACH,EACJ,CACJ;GACD,2BAA2B;GAC3B,gCAAgC;GAChC,gCAAgC;GAChC,+BAA+B;GAC/B,oCAAoC;GACpC,oCAAoC;GACpC,mBAAmB,CACf,SACA,EACH;GACD,+BAA+B,CAC3B,SACA;IACI,WAAW;IACX,YAAY;IACf,CACJ;GACD,eAAe,CACX,QACA;IACI,MAAM;IACN,UAAU;IACV,UAAU;IACb,CACJ;GACD,oBAAoB;GACpB,wBAAwB;GACxB,uBAAuB;GACvB,oCAAoC;GACpC,oBAAoB;GACpB,gCAAgC;GAChC,iBAAiB;GACjB,6BAA6B;GAC7B,oCAAoC;GACpC,8BAA8B;GAC9B,yBAAyB;GAC5B;EACJ"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kikiutils/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "7.0.1",
|
|
5
5
|
"description": "Using antfu/eslint-config as a base for eslint-config, slightly modified the settings and added additional plugins, mainly for my own use.",
|
|
6
6
|
"author": "kiki-kanri",
|
|
7
7
|
"license": "MIT",
|
|
@@ -25,21 +25,20 @@
|
|
|
25
25
|
"scripts": {
|
|
26
26
|
"build": "tsdown",
|
|
27
27
|
"bumplog": "changelogen --bump --hideAuthorEmail",
|
|
28
|
-
"
|
|
28
|
+
"knip:deps": "knip --dependencies",
|
|
29
|
+
"knip:exports": "knip --exports",
|
|
29
30
|
"lint": "eslint --max-warnings 0",
|
|
30
31
|
"lint:fix": "eslint --fix --max-warnings 0",
|
|
31
32
|
"prepack": "pnpm run build",
|
|
32
33
|
"release": "pnpm run lint && pnpm run typecheck && pnpm run test && pnpm run build && changelogen --hideAuthorEmail --push --release && npm publish",
|
|
33
34
|
"test": "vitest run --coverage",
|
|
34
35
|
"test:watch": "vitest watch --coverage",
|
|
35
|
-
"typecheck": "tsc -b --noEmit"
|
|
36
|
-
"unused-exports": "ts-unused-exports ./tsconfig.json"
|
|
36
|
+
"typecheck": "tsc -b --noEmit"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
39
39
|
"@kikiutils/eslint-plugin-tailwindcss": "^3.19.0",
|
|
40
40
|
"@kikiutils/eslint-plugin-vue": "^10.2.2",
|
|
41
41
|
"eslint": ">= 9.0.0",
|
|
42
|
-
"eslint-flat-config-utils": ">= 2.0.0",
|
|
43
42
|
"eslint-plugin-format": ">= 1.0.0",
|
|
44
43
|
"eslint-plugin-tailwindcss": "^3.18.2"
|
|
45
44
|
},
|
|
@@ -50,7 +49,7 @@
|
|
|
50
49
|
"@kikiutils/eslint-plugin-vue": {
|
|
51
50
|
"optional": true
|
|
52
51
|
},
|
|
53
|
-
"eslint
|
|
52
|
+
"eslint": {
|
|
54
53
|
"optional": true
|
|
55
54
|
},
|
|
56
55
|
"eslint-plugin-format": {
|
|
@@ -61,23 +60,21 @@
|
|
|
61
60
|
}
|
|
62
61
|
},
|
|
63
62
|
"dependencies": {
|
|
64
|
-
"@antfu/eslint-config": "^7.
|
|
63
|
+
"@antfu/eslint-config": "^7.7.0",
|
|
65
64
|
"eslint-plugin-promise": "^7.2.1"
|
|
66
65
|
},
|
|
67
66
|
"devDependencies": {
|
|
68
67
|
"@kikiutils/eslint-plugin-tailwindcss": "^3.19.0",
|
|
69
68
|
"@kikiutils/eslint-plugin-vue": "^10.2.2",
|
|
70
69
|
"@kikiutils/tsconfigs": "^5.1.0",
|
|
71
|
-
"@types/node": "^25.3.
|
|
70
|
+
"@types/node": "^25.3.5",
|
|
72
71
|
"@vitest/coverage-v8": "^4.0.18",
|
|
73
72
|
"changelogen": "^0.6.2",
|
|
74
|
-
"depcheck": "^1.4.7",
|
|
75
|
-
"eslint-flat-config-utils": "^3.0.1",
|
|
76
73
|
"eslint-plugin-format": "^2.0.1",
|
|
77
74
|
"eslint-plugin-tailwindcss": "^3.18.2",
|
|
75
|
+
"knip": "^5.86.0",
|
|
78
76
|
"publint": "^0.3.18",
|
|
79
|
-
"
|
|
80
|
-
"tsdown": "^0.20.3",
|
|
77
|
+
"tsdown": "^0.21.0",
|
|
81
78
|
"typescript": "^5.9.3",
|
|
82
79
|
"unplugin-unused": "^0.5.7",
|
|
83
80
|
"vitest": "^4.0.18"
|
package/src/base.ts
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type {
|
|
2
|
+
Rules,
|
|
3
|
+
TypedFlatConfigItem,
|
|
4
|
+
} from '@antfu/eslint-config';
|
|
2
5
|
// @ts-expect-error No declare file.
|
|
3
6
|
import promise from 'eslint-plugin-promise';
|
|
4
7
|
|
|
@@ -9,281 +12,80 @@ const basePerfectionistSortOptions = {
|
|
|
9
12
|
|
|
10
13
|
export function createBaseConfigs(environment: 'bun' | 'node' = 'node'): TypedFlatConfigItem[] {
|
|
11
14
|
return [
|
|
15
|
+
// All files
|
|
12
16
|
{
|
|
13
|
-
files: ['**/*.{cjs,js,mjs,ts,tsx}'],
|
|
14
17
|
rules: {
|
|
15
|
-
'
|
|
18
|
+
'e18e/ban-dependencies': [
|
|
16
19
|
'error',
|
|
17
|
-
|
|
20
|
+
{
|
|
21
|
+
allowed: [
|
|
22
|
+
'axios',
|
|
23
|
+
'rimraf',
|
|
24
|
+
],
|
|
25
|
+
},
|
|
18
26
|
],
|
|
27
|
+
'e18e/prefer-static-regex': ['off'],
|
|
19
28
|
},
|
|
20
29
|
},
|
|
30
|
+
// JavaScript
|
|
21
31
|
{
|
|
22
|
-
files: ['**/*.{cjs,js,mjs
|
|
32
|
+
files: ['**/*.{cjs,js,mjs}'],
|
|
23
33
|
plugins: { promise },
|
|
24
34
|
rules: {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
{
|
|
28
|
-
ArrayExpression: false,
|
|
29
|
-
ArrayPattern: false,
|
|
30
|
-
},
|
|
31
|
-
],
|
|
32
|
-
'antfu/curly': 'off',
|
|
33
|
-
'antfu/if-newline': 'off',
|
|
34
|
-
'antfu/no-top-level-await': 'off',
|
|
35
|
-
'curly': [
|
|
36
|
-
'error',
|
|
37
|
-
'multi-line',
|
|
38
|
-
],
|
|
39
|
-
'max-classes-per-file': [
|
|
40
|
-
'error',
|
|
41
|
-
1,
|
|
42
|
-
],
|
|
43
|
-
'no-promise-executor-return': [
|
|
44
|
-
'error',
|
|
45
|
-
{ allowVoid: true },
|
|
46
|
-
],
|
|
47
|
-
'perfectionist/sort-array-includes': [
|
|
48
|
-
'error',
|
|
49
|
-
basePerfectionistSortOptions,
|
|
50
|
-
],
|
|
51
|
-
'perfectionist/sort-enums': [
|
|
52
|
-
'error',
|
|
53
|
-
{
|
|
54
|
-
...basePerfectionistSortOptions,
|
|
55
|
-
sortByValue: 'never',
|
|
56
|
-
},
|
|
57
|
-
],
|
|
58
|
-
'perfectionist/sort-heritage-clauses': [
|
|
59
|
-
'error',
|
|
60
|
-
{
|
|
61
|
-
ignoreCase: false,
|
|
62
|
-
type: 'natural',
|
|
63
|
-
},
|
|
64
|
-
],
|
|
65
|
-
'perfectionist/sort-imports': [
|
|
66
|
-
'error',
|
|
67
|
-
{
|
|
68
|
-
environment,
|
|
69
|
-
groups: [
|
|
70
|
-
'side-effect',
|
|
71
|
-
'side-effect-style',
|
|
72
|
-
'style',
|
|
73
|
-
[
|
|
74
|
-
'value-builtin',
|
|
75
|
-
'type-builtin',
|
|
76
|
-
],
|
|
77
|
-
[
|
|
78
|
-
'value-external',
|
|
79
|
-
'type-external',
|
|
80
|
-
],
|
|
81
|
-
[
|
|
82
|
-
'value-internal',
|
|
83
|
-
'type-internal',
|
|
84
|
-
],
|
|
85
|
-
[
|
|
86
|
-
'value-parent',
|
|
87
|
-
'type-parent',
|
|
88
|
-
],
|
|
89
|
-
[
|
|
90
|
-
'value-sibling',
|
|
91
|
-
'type-sibling',
|
|
92
|
-
],
|
|
93
|
-
[
|
|
94
|
-
'value-index',
|
|
95
|
-
'type-index',
|
|
96
|
-
],
|
|
97
|
-
'unknown',
|
|
98
|
-
],
|
|
99
|
-
ignoreCase: false,
|
|
100
|
-
internalPattern: [
|
|
101
|
-
'^#.*',
|
|
102
|
-
'^@/.*',
|
|
103
|
-
'^~/.*',
|
|
104
|
-
],
|
|
105
|
-
type: 'natural',
|
|
106
|
-
},
|
|
107
|
-
],
|
|
108
|
-
'perfectionist/sort-interfaces': [
|
|
109
|
-
'error',
|
|
110
|
-
basePerfectionistSortOptions,
|
|
111
|
-
],
|
|
112
|
-
'perfectionist/sort-intersection-types': [
|
|
113
|
-
'error',
|
|
114
|
-
basePerfectionistSortOptions,
|
|
115
|
-
],
|
|
116
|
-
'perfectionist/sort-maps': [
|
|
117
|
-
'error',
|
|
118
|
-
basePerfectionistSortOptions,
|
|
119
|
-
],
|
|
120
|
-
'perfectionist/sort-modules': [
|
|
121
|
-
'error',
|
|
122
|
-
{
|
|
123
|
-
...basePerfectionistSortOptions,
|
|
124
|
-
groups: [
|
|
125
|
-
'declare-type',
|
|
126
|
-
[
|
|
127
|
-
'export-type',
|
|
128
|
-
'type',
|
|
129
|
-
],
|
|
130
|
-
'declare-interface',
|
|
131
|
-
[
|
|
132
|
-
'export-interface',
|
|
133
|
-
'interface',
|
|
134
|
-
],
|
|
135
|
-
'declare-enum',
|
|
136
|
-
[
|
|
137
|
-
'enum',
|
|
138
|
-
'export-enum',
|
|
139
|
-
],
|
|
140
|
-
'declare-class',
|
|
141
|
-
[
|
|
142
|
-
'class',
|
|
143
|
-
'export-class',
|
|
144
|
-
],
|
|
145
|
-
'declare-function',
|
|
146
|
-
[
|
|
147
|
-
'export-function',
|
|
148
|
-
'function',
|
|
149
|
-
],
|
|
150
|
-
],
|
|
151
|
-
},
|
|
152
|
-
],
|
|
153
|
-
'perfectionist/sort-object-types': [
|
|
154
|
-
'error',
|
|
155
|
-
basePerfectionistSortOptions,
|
|
156
|
-
],
|
|
157
|
-
'perfectionist/sort-objects': [
|
|
158
|
-
'error',
|
|
159
|
-
basePerfectionistSortOptions,
|
|
160
|
-
],
|
|
161
|
-
'perfectionist/sort-sets': [
|
|
162
|
-
'error',
|
|
163
|
-
basePerfectionistSortOptions,
|
|
164
|
-
],
|
|
165
|
-
'perfectionist/sort-switch-case': [
|
|
166
|
-
'error',
|
|
167
|
-
{
|
|
168
|
-
ignoreCase: false,
|
|
169
|
-
type: 'natural',
|
|
170
|
-
},
|
|
171
|
-
],
|
|
172
|
-
'perfectionist/sort-union-types': [
|
|
173
|
-
'error',
|
|
174
|
-
basePerfectionistSortOptions,
|
|
175
|
-
],
|
|
176
|
-
'perfectionist/sort-variable-declarations': [
|
|
177
|
-
'error',
|
|
178
|
-
basePerfectionistSortOptions,
|
|
179
|
-
],
|
|
180
|
-
'promise/no-multiple-resolved': 'error',
|
|
181
|
-
'promise/no-return-in-finally': 'error',
|
|
182
|
-
'promise/no-return-wrap': 'error',
|
|
183
|
-
'require-await': 'error',
|
|
184
|
-
'style/array-bracket-newline': [
|
|
185
|
-
'error',
|
|
186
|
-
{ multiline: true },
|
|
187
|
-
],
|
|
188
|
-
'style/array-element-newline': [
|
|
189
|
-
'error',
|
|
190
|
-
{
|
|
191
|
-
ArrayExpression: {
|
|
192
|
-
consistent: true,
|
|
193
|
-
minItems: 2,
|
|
194
|
-
},
|
|
195
|
-
ArrayPattern: { minItems: 3 },
|
|
196
|
-
},
|
|
197
|
-
],
|
|
198
|
-
'style/arrow-parens': [
|
|
35
|
+
...createBaseRules(environment),
|
|
36
|
+
'node/prefer-global/process': [
|
|
199
37
|
'error',
|
|
200
38
|
'always',
|
|
201
39
|
],
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
// TypeScript
|
|
43
|
+
{
|
|
44
|
+
files: ['**/*.{ts,tsx}'],
|
|
45
|
+
plugins: { promise },
|
|
46
|
+
rules: {
|
|
47
|
+
...createBaseRules(environment),
|
|
48
|
+
'node/prefer-global/process': [
|
|
208
49
|
'error',
|
|
209
|
-
'
|
|
50
|
+
'always',
|
|
210
51
|
],
|
|
211
|
-
'
|
|
52
|
+
'ts/consistent-generic-constructors': [
|
|
212
53
|
'error',
|
|
213
|
-
|
|
214
|
-
],
|
|
215
|
-
'style/max-len': [
|
|
216
|
-
'warn',
|
|
217
|
-
{
|
|
218
|
-
code: 120,
|
|
219
|
-
comments: 120,
|
|
220
|
-
},
|
|
54
|
+
'constructor',
|
|
221
55
|
],
|
|
222
|
-
'
|
|
56
|
+
'ts/no-redeclare': 'off',
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
// VsCode jsonc
|
|
60
|
+
{
|
|
61
|
+
files: ['**/.vscode/*.json'],
|
|
62
|
+
rules: {
|
|
63
|
+
'jsonc/sort-array-values': [
|
|
223
64
|
'error',
|
|
224
65
|
{
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
66
|
+
order: {
|
|
67
|
+
natural: true,
|
|
68
|
+
type: 'asc',
|
|
228
69
|
},
|
|
70
|
+
pathPattern: '^.*$',
|
|
229
71
|
},
|
|
230
72
|
],
|
|
231
|
-
'
|
|
232
|
-
'error',
|
|
233
|
-
'all',
|
|
234
|
-
{ nestedBinaryExpressions: false },
|
|
235
|
-
],
|
|
236
|
-
'style/no-extra-semi': 'error',
|
|
237
|
-
'style/object-curly-newline': [
|
|
73
|
+
'jsonc/sort-keys': [
|
|
238
74
|
'error',
|
|
75
|
+
'asc',
|
|
239
76
|
{
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
multiline: true,
|
|
243
|
-
},
|
|
244
|
-
ImportDeclaration: {
|
|
245
|
-
minProperties: 2,
|
|
246
|
-
multiline: true,
|
|
247
|
-
},
|
|
248
|
-
ObjectExpression: {
|
|
249
|
-
minProperties: 2,
|
|
250
|
-
multiline: true,
|
|
251
|
-
},
|
|
252
|
-
ObjectPattern: {
|
|
253
|
-
minProperties: 3,
|
|
254
|
-
multiline: true,
|
|
255
|
-
},
|
|
77
|
+
caseSensitive: true,
|
|
78
|
+
natural: true,
|
|
256
79
|
},
|
|
257
80
|
],
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
blankLine: 'always',
|
|
267
|
-
next: [
|
|
268
|
-
'class',
|
|
269
|
-
'enum',
|
|
270
|
-
'function',
|
|
271
|
-
],
|
|
272
|
-
prev: '*',
|
|
273
|
-
},
|
|
274
|
-
{
|
|
275
|
-
blankLine: 'always',
|
|
276
|
-
next: '*',
|
|
277
|
-
prev: [
|
|
278
|
-
'class',
|
|
279
|
-
'function',
|
|
280
|
-
],
|
|
281
|
-
},
|
|
282
|
-
],
|
|
283
|
-
'style/semi': [
|
|
284
|
-
'error',
|
|
285
|
-
'always',
|
|
286
|
-
],
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
// Vue
|
|
84
|
+
{
|
|
85
|
+
files: ['**/*.{vue}'],
|
|
86
|
+
plugins: { promise },
|
|
87
|
+
rules: {
|
|
88
|
+
...createBaseRules(environment),
|
|
287
89
|
'ts/consistent-generic-constructors': [
|
|
288
90
|
'error',
|
|
289
91
|
'constructor',
|
|
@@ -293,3 +95,270 @@ export function createBaseConfigs(environment: 'bun' | 'node' = 'node'): TypedFl
|
|
|
293
95
|
},
|
|
294
96
|
];
|
|
295
97
|
}
|
|
98
|
+
|
|
99
|
+
function createBaseRules(environment: 'bun' | 'node' = 'node'): Rules {
|
|
100
|
+
return {
|
|
101
|
+
'antfu/consistent-list-newline': [
|
|
102
|
+
'error',
|
|
103
|
+
{
|
|
104
|
+
ArrayExpression: false,
|
|
105
|
+
ArrayPattern: false,
|
|
106
|
+
},
|
|
107
|
+
],
|
|
108
|
+
'antfu/curly': 'off',
|
|
109
|
+
'antfu/if-newline': 'off',
|
|
110
|
+
'antfu/no-top-level-await': 'off',
|
|
111
|
+
'curly': [
|
|
112
|
+
'error',
|
|
113
|
+
'multi-line',
|
|
114
|
+
],
|
|
115
|
+
'max-classes-per-file': [
|
|
116
|
+
'error',
|
|
117
|
+
1,
|
|
118
|
+
],
|
|
119
|
+
'no-promise-executor-return': [
|
|
120
|
+
'error',
|
|
121
|
+
{ allowVoid: true },
|
|
122
|
+
],
|
|
123
|
+
'perfectionist/sort-array-includes': [
|
|
124
|
+
'error',
|
|
125
|
+
basePerfectionistSortOptions,
|
|
126
|
+
],
|
|
127
|
+
'perfectionist/sort-enums': [
|
|
128
|
+
'error',
|
|
129
|
+
{
|
|
130
|
+
...basePerfectionistSortOptions,
|
|
131
|
+
sortByValue: 'never',
|
|
132
|
+
},
|
|
133
|
+
],
|
|
134
|
+
'perfectionist/sort-heritage-clauses': [
|
|
135
|
+
'error',
|
|
136
|
+
{
|
|
137
|
+
ignoreCase: false,
|
|
138
|
+
type: 'natural',
|
|
139
|
+
},
|
|
140
|
+
],
|
|
141
|
+
'perfectionist/sort-imports': [
|
|
142
|
+
'error',
|
|
143
|
+
{
|
|
144
|
+
environment,
|
|
145
|
+
groups: [
|
|
146
|
+
'side-effect',
|
|
147
|
+
'side-effect-style',
|
|
148
|
+
'style',
|
|
149
|
+
[
|
|
150
|
+
'value-builtin',
|
|
151
|
+
'type-builtin',
|
|
152
|
+
],
|
|
153
|
+
[
|
|
154
|
+
'value-external',
|
|
155
|
+
'type-external',
|
|
156
|
+
],
|
|
157
|
+
[
|
|
158
|
+
'value-internal',
|
|
159
|
+
'type-internal',
|
|
160
|
+
],
|
|
161
|
+
[
|
|
162
|
+
'value-parent',
|
|
163
|
+
'type-parent',
|
|
164
|
+
],
|
|
165
|
+
[
|
|
166
|
+
'value-sibling',
|
|
167
|
+
'type-sibling',
|
|
168
|
+
],
|
|
169
|
+
[
|
|
170
|
+
'value-index',
|
|
171
|
+
'type-index',
|
|
172
|
+
],
|
|
173
|
+
'unknown',
|
|
174
|
+
],
|
|
175
|
+
ignoreCase: false,
|
|
176
|
+
internalPattern: [
|
|
177
|
+
'^#.*',
|
|
178
|
+
'^@/.*',
|
|
179
|
+
'^~/.*',
|
|
180
|
+
],
|
|
181
|
+
type: 'natural',
|
|
182
|
+
},
|
|
183
|
+
],
|
|
184
|
+
'perfectionist/sort-interfaces': [
|
|
185
|
+
'error',
|
|
186
|
+
basePerfectionistSortOptions,
|
|
187
|
+
],
|
|
188
|
+
'perfectionist/sort-intersection-types': [
|
|
189
|
+
'error',
|
|
190
|
+
basePerfectionistSortOptions,
|
|
191
|
+
],
|
|
192
|
+
'perfectionist/sort-maps': [
|
|
193
|
+
'error',
|
|
194
|
+
basePerfectionistSortOptions,
|
|
195
|
+
],
|
|
196
|
+
'perfectionist/sort-modules': [
|
|
197
|
+
'error',
|
|
198
|
+
{
|
|
199
|
+
...basePerfectionistSortOptions,
|
|
200
|
+
groups: [
|
|
201
|
+
'declare-type',
|
|
202
|
+
[
|
|
203
|
+
'export-type',
|
|
204
|
+
'type',
|
|
205
|
+
],
|
|
206
|
+
'declare-interface',
|
|
207
|
+
[
|
|
208
|
+
'export-interface',
|
|
209
|
+
'interface',
|
|
210
|
+
],
|
|
211
|
+
'declare-enum',
|
|
212
|
+
[
|
|
213
|
+
'enum',
|
|
214
|
+
'export-enum',
|
|
215
|
+
],
|
|
216
|
+
'declare-class',
|
|
217
|
+
[
|
|
218
|
+
'class',
|
|
219
|
+
'export-class',
|
|
220
|
+
],
|
|
221
|
+
'declare-function',
|
|
222
|
+
[
|
|
223
|
+
'export-function',
|
|
224
|
+
'function',
|
|
225
|
+
],
|
|
226
|
+
],
|
|
227
|
+
},
|
|
228
|
+
],
|
|
229
|
+
'perfectionist/sort-object-types': [
|
|
230
|
+
'error',
|
|
231
|
+
basePerfectionistSortOptions,
|
|
232
|
+
],
|
|
233
|
+
'perfectionist/sort-objects': [
|
|
234
|
+
'error',
|
|
235
|
+
basePerfectionistSortOptions,
|
|
236
|
+
],
|
|
237
|
+
'perfectionist/sort-sets': [
|
|
238
|
+
'error',
|
|
239
|
+
basePerfectionistSortOptions,
|
|
240
|
+
],
|
|
241
|
+
'perfectionist/sort-switch-case': [
|
|
242
|
+
'error',
|
|
243
|
+
{
|
|
244
|
+
ignoreCase: false,
|
|
245
|
+
type: 'natural',
|
|
246
|
+
},
|
|
247
|
+
],
|
|
248
|
+
'perfectionist/sort-union-types': [
|
|
249
|
+
'error',
|
|
250
|
+
basePerfectionistSortOptions,
|
|
251
|
+
],
|
|
252
|
+
'perfectionist/sort-variable-declarations': [
|
|
253
|
+
'error',
|
|
254
|
+
basePerfectionistSortOptions,
|
|
255
|
+
],
|
|
256
|
+
'promise/no-multiple-resolved': 'error',
|
|
257
|
+
'promise/no-return-in-finally': 'error',
|
|
258
|
+
'promise/no-return-wrap': 'error',
|
|
259
|
+
'require-await': 'error',
|
|
260
|
+
'style/array-bracket-newline': [
|
|
261
|
+
'error',
|
|
262
|
+
{ multiline: true },
|
|
263
|
+
],
|
|
264
|
+
'style/array-element-newline': [
|
|
265
|
+
'error',
|
|
266
|
+
{
|
|
267
|
+
ArrayExpression: {
|
|
268
|
+
consistent: true,
|
|
269
|
+
minItems: 2,
|
|
270
|
+
},
|
|
271
|
+
ArrayPattern: { minItems: 3 },
|
|
272
|
+
},
|
|
273
|
+
],
|
|
274
|
+
'style/arrow-parens': [
|
|
275
|
+
'error',
|
|
276
|
+
'always',
|
|
277
|
+
],
|
|
278
|
+
'style/brace-style': [
|
|
279
|
+
'error',
|
|
280
|
+
'1tbs',
|
|
281
|
+
{ allowSingleLine: false },
|
|
282
|
+
],
|
|
283
|
+
'style/function-call-spacing': [
|
|
284
|
+
'error',
|
|
285
|
+
'never',
|
|
286
|
+
],
|
|
287
|
+
'style/indent': [
|
|
288
|
+
'error',
|
|
289
|
+
4,
|
|
290
|
+
],
|
|
291
|
+
'style/max-len': [
|
|
292
|
+
'warn',
|
|
293
|
+
{
|
|
294
|
+
code: 120,
|
|
295
|
+
comments: 120,
|
|
296
|
+
},
|
|
297
|
+
],
|
|
298
|
+
'style/member-delimiter-style': [
|
|
299
|
+
'error',
|
|
300
|
+
{
|
|
301
|
+
multiline: {
|
|
302
|
+
delimiter: 'semi',
|
|
303
|
+
requireLast: true,
|
|
304
|
+
},
|
|
305
|
+
},
|
|
306
|
+
],
|
|
307
|
+
'style/no-extra-parens': [
|
|
308
|
+
'error',
|
|
309
|
+
'all',
|
|
310
|
+
{ nestedBinaryExpressions: false },
|
|
311
|
+
],
|
|
312
|
+
'style/no-extra-semi': 'error',
|
|
313
|
+
'style/object-curly-newline': [
|
|
314
|
+
'error',
|
|
315
|
+
{
|
|
316
|
+
ExportDeclaration: {
|
|
317
|
+
minProperties: 2,
|
|
318
|
+
multiline: true,
|
|
319
|
+
},
|
|
320
|
+
ImportDeclaration: {
|
|
321
|
+
minProperties: 2,
|
|
322
|
+
multiline: true,
|
|
323
|
+
},
|
|
324
|
+
ObjectExpression: {
|
|
325
|
+
minProperties: 2,
|
|
326
|
+
multiline: true,
|
|
327
|
+
},
|
|
328
|
+
ObjectPattern: {
|
|
329
|
+
minProperties: 3,
|
|
330
|
+
multiline: true,
|
|
331
|
+
},
|
|
332
|
+
},
|
|
333
|
+
],
|
|
334
|
+
'style/operator-linebreak': [
|
|
335
|
+
'error',
|
|
336
|
+
'before',
|
|
337
|
+
{ overrides: { '=': 'after' } },
|
|
338
|
+
],
|
|
339
|
+
'style/padding-line-between-statements': [
|
|
340
|
+
'error',
|
|
341
|
+
{
|
|
342
|
+
blankLine: 'always',
|
|
343
|
+
next: [
|
|
344
|
+
'class',
|
|
345
|
+
'enum',
|
|
346
|
+
'function',
|
|
347
|
+
],
|
|
348
|
+
prev: '*',
|
|
349
|
+
},
|
|
350
|
+
{
|
|
351
|
+
blankLine: 'always',
|
|
352
|
+
next: '*',
|
|
353
|
+
prev: [
|
|
354
|
+
'class',
|
|
355
|
+
'function',
|
|
356
|
+
],
|
|
357
|
+
},
|
|
358
|
+
],
|
|
359
|
+
'style/semi': [
|
|
360
|
+
'error',
|
|
361
|
+
'always',
|
|
362
|
+
],
|
|
363
|
+
};
|
|
364
|
+
}
|
package/dist/json.d.ts
DELETED
package/dist/json.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"json.d.ts","names":[],"sources":["../src/json.ts"],"mappings":";;;iBAEgB,uBAAA,CAAA,GAA2B,mBAAA"}
|
package/dist/json.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
//#region src/json.ts
|
|
2
|
-
function createVsCodeJsonConfigs() {
|
|
3
|
-
return [{
|
|
4
|
-
files: ["**/.vscode/*.json"],
|
|
5
|
-
rules: {
|
|
6
|
-
"jsonc/sort-array-values": ["error", {
|
|
7
|
-
order: {
|
|
8
|
-
natural: true,
|
|
9
|
-
type: "asc"
|
|
10
|
-
},
|
|
11
|
-
pathPattern: "^.*$"
|
|
12
|
-
}],
|
|
13
|
-
"jsonc/sort-keys": [
|
|
14
|
-
"error",
|
|
15
|
-
"asc",
|
|
16
|
-
{
|
|
17
|
-
caseSensitive: true,
|
|
18
|
-
natural: true
|
|
19
|
-
}
|
|
20
|
-
]
|
|
21
|
-
}
|
|
22
|
-
}];
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
//#endregion
|
|
26
|
-
export { createVsCodeJsonConfigs };
|
|
27
|
-
//# sourceMappingURL=json.js.map
|
package/dist/json.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"json.js","names":[],"sources":["../src/json.ts"],"sourcesContent":["import type { TypedFlatConfigItem } from '@antfu/eslint-config';\n\nexport function createVsCodeJsonConfigs(): TypedFlatConfigItem[] {\n return [\n {\n files: ['**/.vscode/*.json'],\n rules: {\n 'jsonc/sort-array-values': [\n 'error',\n {\n order: {\n natural: true,\n type: 'asc',\n },\n pathPattern: '^.*$',\n },\n ],\n 'jsonc/sort-keys': [\n 'error',\n 'asc',\n {\n caseSensitive: true,\n natural: true,\n },\n ],\n },\n },\n ];\n}\n"],"mappings":";AAEA,SAAgB,0BAAiD;AAC7D,QAAO,CACH;EACI,OAAO,CAAC,oBAAoB;EAC5B,OAAO;GACH,2BAA2B,CACvB,SACA;IACI,OAAO;KACH,SAAS;KACT,MAAM;KACT;IACD,aAAa;IAChB,CACJ;GACD,mBAAmB;IACf;IACA;IACA;KACI,eAAe;KACf,SAAS;KACZ;IACJ;GACJ;EACJ,CACJ"}
|
package/src/json.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import type { TypedFlatConfigItem } from '@antfu/eslint-config';
|
|
2
|
-
|
|
3
|
-
export function createVsCodeJsonConfigs(): TypedFlatConfigItem[] {
|
|
4
|
-
return [
|
|
5
|
-
{
|
|
6
|
-
files: ['**/.vscode/*.json'],
|
|
7
|
-
rules: {
|
|
8
|
-
'jsonc/sort-array-values': [
|
|
9
|
-
'error',
|
|
10
|
-
{
|
|
11
|
-
order: {
|
|
12
|
-
natural: true,
|
|
13
|
-
type: 'asc',
|
|
14
|
-
},
|
|
15
|
-
pathPattern: '^.*$',
|
|
16
|
-
},
|
|
17
|
-
],
|
|
18
|
-
'jsonc/sort-keys': [
|
|
19
|
-
'error',
|
|
20
|
-
'asc',
|
|
21
|
-
{
|
|
22
|
-
caseSensitive: true,
|
|
23
|
-
natural: true,
|
|
24
|
-
},
|
|
25
|
-
],
|
|
26
|
-
},
|
|
27
|
-
},
|
|
28
|
-
];
|
|
29
|
-
}
|