@deot/dev-eslint 2.9.9 → 2.9.10
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.cjs +327 -403
- package/dist/index.d.ts +1 -1
- package/dist/index.js +292 -381
- package/package.json +10 -9
package/dist/index.cjs
CHANGED
|
@@ -1,416 +1,340 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
for (const k in e) {
|
|
20
|
-
if (k !== 'default') {
|
|
21
|
-
const d = Object.getOwnPropertyDescriptor(e, k);
|
|
22
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
23
|
-
enumerable: true,
|
|
24
|
-
get: () => e[k]
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
}
|
|
1
|
+
Object.defineProperties(exports, {
|
|
2
|
+
__esModule: { value: true },
|
|
3
|
+
[Symbol.toStringTag]: { value: "Module" }
|
|
4
|
+
});
|
|
5
|
+
//#region \0rolldown/runtime.js
|
|
6
|
+
var __create = Object.create;
|
|
7
|
+
var __defProp = Object.defineProperty;
|
|
8
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
9
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
10
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
11
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
14
|
+
key = keys[i];
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
16
|
+
get: ((k) => from[k]).bind(null, key),
|
|
17
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
18
|
+
});
|
|
28
19
|
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
20
|
+
return to;
|
|
21
|
+
};
|
|
22
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
23
|
+
value: mod,
|
|
24
|
+
enumerable: true
|
|
25
|
+
}) : target, mod));
|
|
26
|
+
//#endregion
|
|
27
|
+
let _typescript_eslint_eslint_plugin = require("@typescript-eslint/eslint-plugin");
|
|
28
|
+
_typescript_eslint_eslint_plugin = __toESM(_typescript_eslint_eslint_plugin);
|
|
29
|
+
let _typescript_eslint_parser = require("@typescript-eslint/parser");
|
|
30
|
+
_typescript_eslint_parser = __toESM(_typescript_eslint_parser);
|
|
31
|
+
let _eslint_js = require("@eslint/js");
|
|
32
|
+
_eslint_js = __toESM(_eslint_js);
|
|
33
|
+
let globals = require("globals");
|
|
34
|
+
globals = __toESM(globals);
|
|
35
|
+
let eslint_plugin_jsdoc = require("eslint-plugin-jsdoc");
|
|
36
|
+
eslint_plugin_jsdoc = __toESM(eslint_plugin_jsdoc);
|
|
37
|
+
let eslint_plugin_markdown = require("eslint-plugin-markdown");
|
|
38
|
+
eslint_plugin_markdown = __toESM(eslint_plugin_markdown);
|
|
39
|
+
let eslint_plugin_import_x = require("eslint-plugin-import-x");
|
|
40
|
+
eslint_plugin_import_x = __toESM(eslint_plugin_import_x);
|
|
41
|
+
let _stylistic_eslint_plugin = require("@stylistic/eslint-plugin");
|
|
42
|
+
_stylistic_eslint_plugin = __toESM(_stylistic_eslint_plugin);
|
|
43
|
+
let eslint_plugin_vue = require("eslint-plugin-vue");
|
|
44
|
+
eslint_plugin_vue = __toESM(eslint_plugin_vue);
|
|
45
|
+
let vue_eslint_parser = require("vue-eslint-parser");
|
|
46
|
+
vue_eslint_parser = __toESM(vue_eslint_parser);
|
|
47
|
+
//#region packages/eslint/src/configs/_helper.ts
|
|
48
|
+
var pickOptions = async (key, options) => {
|
|
49
|
+
const configOptions = {
|
|
50
|
+
enable: typeof options?.[key] === "boolean" ? options[key] : true,
|
|
51
|
+
overrides: {},
|
|
52
|
+
...typeof options?.[key] === "object" ? options[key] : {}
|
|
53
|
+
};
|
|
54
|
+
const overrides = options?.overrides?.[key] || {};
|
|
55
|
+
return {
|
|
56
|
+
...configOptions,
|
|
57
|
+
overrides: {
|
|
58
|
+
...configOptions.overrides,
|
|
59
|
+
...overrides
|
|
60
|
+
}
|
|
61
|
+
};
|
|
49
62
|
};
|
|
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
|
-
console.error(key + ": " + invaild.join(",") + " has off default!\n");
|
|
76
|
-
}
|
|
77
|
-
if (isTest && deprecated.length) {
|
|
78
|
-
console.error(key + ": " + deprecated.join(",") + " has deprecated!\n");
|
|
79
|
-
}
|
|
80
|
-
return current;
|
|
63
|
+
var cleanRules = (key, all, recommended, current) => {
|
|
64
|
+
current = JSON.parse(JSON.stringify(current));
|
|
65
|
+
const deprecated = [];
|
|
66
|
+
const removed = [];
|
|
67
|
+
const invaild = [];
|
|
68
|
+
Object.keys(current).forEach((i) => {
|
|
69
|
+
/* istanbul ignore next -- @preserve */
|
|
70
|
+
if (all[i] === void 0 && recommended[i] === void 0) removed.push(i);
|
|
71
|
+
/* istanbul ignore next -- @preserve */
|
|
72
|
+
if (recommended[i] === void 0 && all[i] !== 0 && all[i] !== "off" && (current[i] === 0 || current[i] === "off")) invaild.push(i);
|
|
73
|
+
});
|
|
74
|
+
Object.keys(recommended).forEach((i) => {
|
|
75
|
+
if (all[i] === void 0) {
|
|
76
|
+
deprecated.push(i);
|
|
77
|
+
delete current[i];
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
const isTest = process.env.NODE_ENV === "UNIT" && !process.env.CI;
|
|
81
|
+
/* istanbul ignore next -- @preserve */
|
|
82
|
+
if (isTest && removed.length) console.error(key + ": " + removed.join(",") + " has removed!\n");
|
|
83
|
+
/* istanbul ignore next -- @preserve */
|
|
84
|
+
if (isTest && invaild.length) console.error(key + ": " + invaild.join(",") + " has off default!\n");
|
|
85
|
+
/* istanbul ignore next -- @preserve */
|
|
86
|
+
if (isTest && deprecated.length) console.error(key + ": " + deprecated.join(",") + " has deprecated!\n");
|
|
87
|
+
return current;
|
|
81
88
|
};
|
|
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
|
-
...cleanRules(
|
|
115
|
-
"typescript",
|
|
116
|
-
{ ...allRules, ...recommendedRules },
|
|
117
|
-
// all使用了extends, 但这里使用flat config
|
|
118
|
-
recommendedRules,
|
|
119
|
-
rules
|
|
120
|
-
),
|
|
121
|
-
...options.overrides
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
];
|
|
89
|
+
//#endregion
|
|
90
|
+
//#region packages/eslint/src/configs/typescript.ts
|
|
91
|
+
var typescript = async (options$) => {
|
|
92
|
+
const options = await pickOptions("typescript", options$);
|
|
93
|
+
if (!options.enable) return [];
|
|
94
|
+
const recommendedRules = _typescript_eslint_eslint_plugin.default.configs["eslint-recommended"].overrides[0].rules;
|
|
95
|
+
const allRules = _typescript_eslint_eslint_plugin.default.configs["all"].rules;
|
|
96
|
+
const rules = {
|
|
97
|
+
...recommendedRules,
|
|
98
|
+
"@typescript-eslint/no-shadow": 2,
|
|
99
|
+
"@typescript-eslint/no-unused-vars": 1,
|
|
100
|
+
"no-unused-vars": 0
|
|
101
|
+
};
|
|
102
|
+
return [{ plugins: { "@typescript-eslint": _typescript_eslint_eslint_plugin.default } }, {
|
|
103
|
+
files: [
|
|
104
|
+
"*.ts",
|
|
105
|
+
"*.tsx",
|
|
106
|
+
"*.mts",
|
|
107
|
+
"*.cts"
|
|
108
|
+
].map((i) => "**/" + i),
|
|
109
|
+
languageOptions: {
|
|
110
|
+
parser: _typescript_eslint_parser,
|
|
111
|
+
parserOptions: { sourceType: "module" }
|
|
112
|
+
},
|
|
113
|
+
rules: {
|
|
114
|
+
...cleanRules("typescript", {
|
|
115
|
+
...allRules,
|
|
116
|
+
...recommendedRules
|
|
117
|
+
}, recommendedRules, rules),
|
|
118
|
+
...options.overrides
|
|
119
|
+
}
|
|
120
|
+
}];
|
|
125
121
|
};
|
|
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
|
-
sourceType: "module"
|
|
165
|
-
},
|
|
166
|
-
rules: {
|
|
167
|
-
...cleanRules("javascript", allRules, recommendedRules, rules),
|
|
168
|
-
...options.overrides
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
];
|
|
122
|
+
//#endregion
|
|
123
|
+
//#region packages/eslint/src/configs/javascript.ts
|
|
124
|
+
var javascript = async (options$) => {
|
|
125
|
+
const options = await pickOptions("javascript", options$);
|
|
126
|
+
if (!options.enable) return [];
|
|
127
|
+
const allRules = _eslint_js.default.configs.all.rules;
|
|
128
|
+
const recommendedRules = _eslint_js.default.configs.recommended.rules;
|
|
129
|
+
const rules = {
|
|
130
|
+
...recommendedRules,
|
|
131
|
+
"no-undef": 1,
|
|
132
|
+
"no-debugger": 1,
|
|
133
|
+
"no-unused-vars": 1,
|
|
134
|
+
"no-useless-escape": 0,
|
|
135
|
+
"prefer-const": [2, {
|
|
136
|
+
destructuring: "all",
|
|
137
|
+
ignoreReadBeforeAssign: false
|
|
138
|
+
}]
|
|
139
|
+
};
|
|
140
|
+
return [{
|
|
141
|
+
languageOptions: {
|
|
142
|
+
ecmaVersion: "latest",
|
|
143
|
+
globals: {
|
|
144
|
+
...globals.default.browser,
|
|
145
|
+
...globals.default.es2021,
|
|
146
|
+
...globals.default.node
|
|
147
|
+
},
|
|
148
|
+
parserOptions: {
|
|
149
|
+
ecmaFeatures: { jsx: true },
|
|
150
|
+
ecmaVersion: 2022,
|
|
151
|
+
sourceType: "module"
|
|
152
|
+
},
|
|
153
|
+
sourceType: "module"
|
|
154
|
+
},
|
|
155
|
+
rules: {
|
|
156
|
+
...cleanRules("javascript", allRules, recommendedRules, rules),
|
|
157
|
+
...options.overrides
|
|
158
|
+
}
|
|
159
|
+
}];
|
|
172
160
|
};
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
plugins: {
|
|
188
|
-
jsdoc: pluginJsdoc
|
|
189
|
-
}
|
|
190
|
-
},
|
|
191
|
-
{
|
|
192
|
-
rules: {
|
|
193
|
-
...cleanRules("jsdoc", recommendedRules, recommendedRules, rules),
|
|
194
|
-
...options.overrides
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
];
|
|
161
|
+
//#endregion
|
|
162
|
+
//#region packages/eslint/src/configs/jsdoc.ts
|
|
163
|
+
var jsdoc = async (options$) => {
|
|
164
|
+
const options = await pickOptions("jsdoc", options$);
|
|
165
|
+
if (!options.enable) return [];
|
|
166
|
+
const recommendedRules = eslint_plugin_jsdoc.default.configs["flat/recommended-typescript"].rules;
|
|
167
|
+
const rules = {
|
|
168
|
+
...recommendedRules,
|
|
169
|
+
"jsdoc/check-tag-names": 0
|
|
170
|
+
};
|
|
171
|
+
return [{ plugins: { jsdoc: eslint_plugin_jsdoc.default } }, { rules: {
|
|
172
|
+
...cleanRules("jsdoc", recommendedRules, recommendedRules, rules),
|
|
173
|
+
...options.overrides
|
|
174
|
+
} }];
|
|
198
175
|
};
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
parserOptions: {
|
|
226
|
-
ecmaFeatures: {
|
|
227
|
-
impliedStrict: true
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
},
|
|
231
|
-
rules: {
|
|
232
|
-
...config.rules,
|
|
233
|
-
"no-console": 1,
|
|
234
|
-
...options.overrides
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
];
|
|
176
|
+
//#endregion
|
|
177
|
+
//#region packages/eslint/src/configs/markdown.ts
|
|
178
|
+
var markdown = async (options$) => {
|
|
179
|
+
const options = await pickOptions("markdown", options$);
|
|
180
|
+
if (!options.enable) return [];
|
|
181
|
+
const config = eslint_plugin_markdown.default.configs.recommended[2];
|
|
182
|
+
return [
|
|
183
|
+
{ plugins: { markdown: eslint_plugin_markdown.default } },
|
|
184
|
+
{
|
|
185
|
+
files: ["**/*.md"],
|
|
186
|
+
processor: "markdown/markdown"
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
files: ["**/*.md/*.ts"],
|
|
190
|
+
rules: { "@typescript-eslint/no-unused-vars": 0 }
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
files: ["**/*.md/**"],
|
|
194
|
+
languageOptions: { parserOptions: { ecmaFeatures: { impliedStrict: true } } },
|
|
195
|
+
rules: {
|
|
196
|
+
...config.rules,
|
|
197
|
+
"no-console": 1,
|
|
198
|
+
...options.overrides
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
];
|
|
238
202
|
};
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
});
|
|
263
|
-
}
|
|
264
|
-
return [
|
|
265
|
-
{
|
|
266
|
-
ignores: [
|
|
267
|
-
...defaults,
|
|
268
|
-
...ignores$
|
|
269
|
-
]
|
|
270
|
-
}
|
|
271
|
-
];
|
|
203
|
+
//#endregion
|
|
204
|
+
//#region packages/eslint/src/configs/ignores.ts
|
|
205
|
+
var ignores = async (ignores$ = []) => {
|
|
206
|
+
let defaults = [
|
|
207
|
+
"**/node_modules",
|
|
208
|
+
"**/dist",
|
|
209
|
+
"**/tmp",
|
|
210
|
+
"**/temp",
|
|
211
|
+
"**/coverage",
|
|
212
|
+
"**/package-lock.json",
|
|
213
|
+
"**/yarn.lock",
|
|
214
|
+
"**/pnpm-lock.yaml"
|
|
215
|
+
];
|
|
216
|
+
if (ignores$ && ignores$.length) defaults = defaults.filter((i) => {
|
|
217
|
+
if (ignores$.includes(i)) return false;
|
|
218
|
+
const reverse = "!" + i;
|
|
219
|
+
if (ignores$.includes(reverse)) {
|
|
220
|
+
ignores$ = ignores$?.filter((j) => j !== reverse);
|
|
221
|
+
return false;
|
|
222
|
+
}
|
|
223
|
+
return true;
|
|
224
|
+
});
|
|
225
|
+
return [{ ignores: [...defaults, ...ignores$] }];
|
|
272
226
|
};
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
...cleanRules(
|
|
304
|
-
"import",
|
|
305
|
-
Object.keys(pluginImport.rules).reduce((pre, key) => {
|
|
306
|
-
pre[`import-x/${key}`] = 2;
|
|
307
|
-
return pre;
|
|
308
|
-
}, {}),
|
|
309
|
-
recommendedRules,
|
|
310
|
-
rules
|
|
311
|
-
),
|
|
312
|
-
...options.overrides
|
|
313
|
-
}
|
|
314
|
-
}
|
|
315
|
-
];
|
|
227
|
+
//#endregion
|
|
228
|
+
//#region packages/eslint/src/configs/imports.ts
|
|
229
|
+
var imports = async (options$) => {
|
|
230
|
+
const options = await pickOptions("import", options$);
|
|
231
|
+
if (!options.enable) return [];
|
|
232
|
+
const recommendedRules = eslint_plugin_import_x.default.configs.recommended.rules;
|
|
233
|
+
const rules = {
|
|
234
|
+
...recommendedRules,
|
|
235
|
+
"import-x/newline-after-import": 1,
|
|
236
|
+
"import-x/no-unresolved": 0,
|
|
237
|
+
"import-x/namespace": 0,
|
|
238
|
+
"import-x/default": 0,
|
|
239
|
+
"import-x/no-named-as-default": 0,
|
|
240
|
+
"import-x/no-named-as-default-member": 0
|
|
241
|
+
};
|
|
242
|
+
return [{
|
|
243
|
+
plugins: { "import-x": eslint_plugin_import_x.default },
|
|
244
|
+
settings: { "import/parsers": { espree: [
|
|
245
|
+
".js",
|
|
246
|
+
".cjs",
|
|
247
|
+
".mjs",
|
|
248
|
+
".jsx"
|
|
249
|
+
] } }
|
|
250
|
+
}, { rules: {
|
|
251
|
+
...cleanRules("import", Object.keys(eslint_plugin_import_x.default.rules).reduce((pre, key) => {
|
|
252
|
+
pre[`import-x/${key}`] = 2;
|
|
253
|
+
return pre;
|
|
254
|
+
}, {}), recommendedRules, rules),
|
|
255
|
+
...options.overrides
|
|
256
|
+
} }];
|
|
316
257
|
};
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
"@stylistic": pluginStylistic
|
|
351
|
-
}
|
|
352
|
-
},
|
|
353
|
-
{
|
|
354
|
-
rules: {
|
|
355
|
-
...cleanRules("stylistic", allRules, allRules, rules),
|
|
356
|
-
...options.overrides
|
|
357
|
-
}
|
|
358
|
-
}
|
|
359
|
-
];
|
|
258
|
+
//#endregion
|
|
259
|
+
//#region packages/eslint/src/configs/stylistic.ts
|
|
260
|
+
var stylistic = async (options$) => {
|
|
261
|
+
const options = await pickOptions("stylistic", options$);
|
|
262
|
+
if (!options.enable) return [];
|
|
263
|
+
const allRules = _stylistic_eslint_plugin.default.configs.customize({
|
|
264
|
+
indent: "tab",
|
|
265
|
+
quotes: "single",
|
|
266
|
+
semi: true,
|
|
267
|
+
jsx: true
|
|
268
|
+
}).rules;
|
|
269
|
+
const rules = {
|
|
270
|
+
...allRules,
|
|
271
|
+
"@stylistic/comma-dangle": ["warn", {
|
|
272
|
+
arrays: "never",
|
|
273
|
+
objects: "ignore",
|
|
274
|
+
imports: "never",
|
|
275
|
+
exports: "never",
|
|
276
|
+
functions: "ignore"
|
|
277
|
+
}],
|
|
278
|
+
"@stylistic/brace-style": [
|
|
279
|
+
"error",
|
|
280
|
+
"1tbs",
|
|
281
|
+
{ allowSingleLine: true }
|
|
282
|
+
],
|
|
283
|
+
"@stylistic/member-delimiter-style": 1,
|
|
284
|
+
"@stylistic/max-statements-per-line": ["off", { max: 1 }],
|
|
285
|
+
"@stylistic/max-len": [1, { code: 150 }]
|
|
286
|
+
};
|
|
287
|
+
return [{ plugins: { "@stylistic": _stylistic_eslint_plugin.default } }, { rules: {
|
|
288
|
+
...cleanRules("stylistic", allRules, allRules, rules),
|
|
289
|
+
...options.overrides
|
|
290
|
+
} }];
|
|
360
291
|
};
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
}
|
|
390
|
-
},
|
|
391
|
-
rules: {
|
|
392
|
-
...cleanRules("vue", essentialRules, essentialRules, rules),
|
|
393
|
-
...options.overrides
|
|
394
|
-
}
|
|
395
|
-
}
|
|
396
|
-
];
|
|
292
|
+
//#endregion
|
|
293
|
+
//#region packages/eslint/src/configs/vue.ts
|
|
294
|
+
var vue = async (options$) => {
|
|
295
|
+
const options = await pickOptions("vue", options$);
|
|
296
|
+
if (!options.enable) return [];
|
|
297
|
+
const essentialRules = eslint_plugin_vue.default.configs["essential"].rules;
|
|
298
|
+
const rules = {
|
|
299
|
+
...essentialRules,
|
|
300
|
+
"vue/html-indent": ["error", "tab"],
|
|
301
|
+
"vue/no-multiple-template-root": 0,
|
|
302
|
+
"vue/multi-word-component-names": 0,
|
|
303
|
+
"vue/no-shared-component-data": 0
|
|
304
|
+
};
|
|
305
|
+
return [
|
|
306
|
+
{ plugins: { vue: eslint_plugin_vue.default } },
|
|
307
|
+
...eslint_plugin_vue.default.configs["flat/base"],
|
|
308
|
+
{
|
|
309
|
+
files: ["**/*.vue"],
|
|
310
|
+
languageOptions: {
|
|
311
|
+
parser: vue_eslint_parser.default,
|
|
312
|
+
parserOptions: { sourceType: "module" }
|
|
313
|
+
},
|
|
314
|
+
rules: {
|
|
315
|
+
...cleanRules("vue", essentialRules, essentialRules, rules),
|
|
316
|
+
...options.overrides
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
];
|
|
397
320
|
};
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
321
|
+
//#endregion
|
|
322
|
+
//#region packages/eslint/src/configure.ts
|
|
323
|
+
var configure = async (options, ...userConfigs) => {
|
|
324
|
+
return [
|
|
325
|
+
...await ignores(options?.ignores),
|
|
326
|
+
...await javascript(options),
|
|
327
|
+
...await typescript(options),
|
|
328
|
+
...await jsdoc(options),
|
|
329
|
+
...await markdown(options),
|
|
330
|
+
...await imports(options),
|
|
331
|
+
...await stylistic(options),
|
|
332
|
+
...await vue(options)
|
|
333
|
+
].concat(userConfigs);
|
|
411
334
|
};
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
335
|
+
//#endregion
|
|
336
|
+
//#region packages/eslint/src/index.ts
|
|
337
|
+
var src_default = configure();
|
|
338
|
+
//#endregion
|
|
415
339
|
exports.configure = configure;
|
|
416
|
-
exports.default =
|
|
340
|
+
exports.default = src_default;
|