@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 CHANGED
@@ -1,416 +1,340 @@
1
- 'use strict';
2
-
3
- Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
4
-
5
- const pluginTs = require('@typescript-eslint/eslint-plugin');
6
- const parserTs = require('@typescript-eslint/parser');
7
- const js = require('@eslint/js');
8
- const globals = require('globals');
9
- const pluginJsdoc = require('eslint-plugin-jsdoc');
10
- const pluginMarkdown = require('eslint-plugin-markdown');
11
- const pluginImport = require('eslint-plugin-import-x');
12
- const pluginStylistic = require('@stylistic/eslint-plugin');
13
- const pluginVue = require('eslint-plugin-vue');
14
- const parserVue = require('vue-eslint-parser');
15
-
16
- function _interopNamespaceDefault(e) {
17
- const n = Object.create(null, { [Symbol.toStringTag]: { value: 'Module' } });
18
- if (e) {
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
- n.default = e;
30
- return Object.freeze(n);
31
- }
32
-
33
- const parserTs__namespace = /*#__PURE__*/_interopNamespaceDefault(parserTs);
34
-
35
- const pickOptions = async (key, options) => {
36
- const configOptions = {
37
- enable: typeof options?.[key] === "boolean" ? options[key] : true,
38
- overrides: {},
39
- ...typeof options?.[key] === "object" ? options[key] : {}
40
- };
41
- const overrides = options?.overrides?.[key] || {};
42
- return {
43
- ...configOptions,
44
- overrides: {
45
- ...configOptions.overrides,
46
- ...overrides
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
- const cleanRules = (key, all, recommended, current) => {
51
- current = JSON.parse(JSON.stringify(current));
52
- const deprecated = [];
53
- const removed = [];
54
- const invaild = [];
55
- const keys = Object.keys(current);
56
- keys.forEach((i) => {
57
- if (all[i] === void 0 && recommended[i] === void 0) {
58
- removed.push(i);
59
- }
60
- if (recommended[i] === void 0 && (all[i] !== 0 && all[i] !== "off") && (current[i] === 0 || current[i] === "off")) {
61
- invaild.push(i);
62
- }
63
- });
64
- Object.keys(recommended).forEach((i) => {
65
- if (all[i] === void 0) {
66
- deprecated.push(i);
67
- delete current[i];
68
- }
69
- });
70
- const isTest = process.env.NODE_ENV === "UNIT" && !process.env.CI;
71
- if (isTest && removed.length) {
72
- console.error(key + ": " + removed.join(",") + " has removed!\n");
73
- }
74
- if (isTest && invaild.length) {
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
- const typescript = async (options$) => {
84
- const options = await pickOptions("typescript", options$);
85
- if (!options.enable) {
86
- return [];
87
- }
88
- const recommendedRules = pluginTs.configs["eslint-recommended"].overrides[0].rules;
89
- const allRules = pluginTs.configs["all"].rules;
90
- const rules = {
91
- ...recommendedRules,
92
- "@typescript-eslint/no-shadow": 2,
93
- // https://github.com/typescript-eslint/typescript-eslint/issues/2483
94
- "@typescript-eslint/no-unused-vars": 1,
95
- // ignore duplicate rules
96
- "no-unused-vars": 0
97
- };
98
- return [
99
- // 单独安装plugins, 方便扩展
100
- {
101
- plugins: {
102
- "@typescript-eslint": pluginTs
103
- }
104
- },
105
- {
106
- files: ["*.ts", "*.tsx", "*.mts", "*.cts"].map((i) => "**/" + i),
107
- languageOptions: {
108
- parser: parserTs__namespace,
109
- parserOptions: {
110
- sourceType: "module"
111
- }
112
- },
113
- rules: {
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
- const javascript = async (options$) => {
128
- const options = await pickOptions("javascript", options$);
129
- if (!options.enable) {
130
- return [];
131
- }
132
- const allRules = js.configs.all.rules;
133
- const recommendedRules = js.configs.recommended.rules;
134
- const rules = {
135
- ...recommendedRules,
136
- "no-undef": 1,
137
- "no-debugger": 1,
138
- "no-unused-vars": 1,
139
- "no-useless-escape": 0,
140
- "prefer-const": [
141
- 2,
142
- {
143
- destructuring: "all",
144
- ignoreReadBeforeAssign: false
145
- }
146
- ]
147
- };
148
- return [
149
- {
150
- languageOptions: {
151
- ecmaVersion: "latest",
152
- globals: {
153
- ...globals.browser,
154
- ...globals.es2021,
155
- ...globals.node
156
- },
157
- parserOptions: {
158
- ecmaFeatures: {
159
- jsx: true
160
- },
161
- ecmaVersion: 2022,
162
- sourceType: "module"
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
- const jsdoc = async (options$) => {
175
- const options = await pickOptions("jsdoc", options$);
176
- if (!options.enable) {
177
- return [];
178
- }
179
- const recommendedRules = pluginJsdoc.configs["flat/recommended-typescript"].rules;
180
- const rules = {
181
- ...recommendedRules,
182
- "jsdoc/check-tag-names": 0
183
- };
184
- return [
185
- // 单独安装plugins,
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
- const markdown = async (options$) => {
201
- const options = await pickOptions("markdown", options$);
202
- if (!options.enable) {
203
- return [];
204
- }
205
- const config = pluginMarkdown.configs.recommended[2];
206
- return [
207
- {
208
- plugins: {
209
- markdown: pluginMarkdown
210
- }
211
- },
212
- {
213
- files: ["**/*.md"],
214
- processor: "markdown/markdown"
215
- },
216
- {
217
- files: ["**/*.md/*.ts"],
218
- rules: {
219
- "@typescript-eslint/no-unused-vars": 0
220
- }
221
- },
222
- {
223
- files: ["**/*.md/**"],
224
- languageOptions: {
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
- const ignores = async (ignores$ = []) => {
241
- let defaults = [
242
- "**/node_modules",
243
- "**/dist",
244
- "**/tmp",
245
- "**/temp",
246
- "**/coverage",
247
- "**/package-lock.json",
248
- "**/yarn.lock",
249
- "**/pnpm-lock.yaml"
250
- ];
251
- if (ignores$ && ignores$.length) {
252
- defaults = defaults.filter((i) => {
253
- if (ignores$.includes(i)) {
254
- return false;
255
- }
256
- const reverse = "!" + i;
257
- if (ignores$.includes(reverse)) {
258
- ignores$ = ignores$?.filter((j) => j !== reverse);
259
- return false;
260
- }
261
- return true;
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
- const imports = async (options$) => {
275
- const options = await pickOptions("import", options$);
276
- if (!options.enable) {
277
- return [];
278
- }
279
- const recommendedRules = pluginImport.configs.recommended.rules;
280
- const rules = {
281
- ...recommendedRules,
282
- "import-x/newline-after-import": 1,
283
- "import-x/no-unresolved": 0,
284
- "import-x/namespace": 0,
285
- "import-x/default": 0,
286
- "import-x/no-named-as-default": 0,
287
- "import-x/no-named-as-default-member": 0
288
- };
289
- return [
290
- // 单独安装plugins,
291
- {
292
- plugins: {
293
- "import-x": pluginImport
294
- },
295
- settings: {
296
- "import/parsers": {
297
- espree: [".js", ".cjs", ".mjs", ".jsx"]
298
- }
299
- }
300
- },
301
- {
302
- rules: {
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
- const stylistic = async (options$) => {
319
- const options = await pickOptions("stylistic", options$);
320
- if (!options.enable) {
321
- return [];
322
- }
323
- const config = pluginStylistic.configs.customize({
324
- indent: "tab",
325
- quotes: "single",
326
- semi: true,
327
- jsx: true
328
- });
329
- const allRules = config.rules;
330
- const rules = {
331
- ...allRules,
332
- "@stylistic/comma-dangle": ["warn", {
333
- arrays: "never",
334
- objects: "ignore",
335
- imports: "never",
336
- exports: "never",
337
- functions: "ignore"
338
- }],
339
- "@stylistic/brace-style": ["error", "1tbs", {
340
- allowSingleLine: true
341
- }],
342
- "@stylistic/member-delimiter-style": 1,
343
- "@stylistic/max-statements-per-line": ["off", { max: 1 }],
344
- "@stylistic/max-len": [1, { code: 150 }]
345
- };
346
- return [
347
- // 单独安装plugins, 方便扩展
348
- {
349
- plugins: {
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
- const vue = async (options$) => {
363
- const options = await pickOptions("vue", options$);
364
- if (!options.enable) {
365
- return [];
366
- }
367
- const essentialRules = pluginVue.configs["essential"].rules;
368
- const rules = {
369
- ...essentialRules,
370
- "vue/html-indent": ["error", "tab"],
371
- "vue/no-multiple-template-root": 0,
372
- "vue/multi-word-component-names": 0,
373
- "vue/no-shared-component-data": 0
374
- };
375
- return [
376
- // 单独安装plugins,
377
- {
378
- plugins: {
379
- vue: pluginVue
380
- }
381
- },
382
- ...pluginVue.configs["flat/base"],
383
- {
384
- files: ["**/*.vue"],
385
- languageOptions: {
386
- parser: parserVue,
387
- parserOptions: {
388
- sourceType: "module"
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
- const configure = async (options, ...userConfigs) => {
400
- const configs = [
401
- ...await ignores(options?.ignores),
402
- ...await javascript(options),
403
- ...await typescript(options),
404
- ...await jsdoc(options),
405
- ...await markdown(options),
406
- ...await imports(options),
407
- ...await stylistic(options),
408
- ...await vue(options)
409
- ];
410
- return configs.concat(userConfigs);
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
- const index = configure();
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 = index;
340
+ exports.default = src_default;