@ntnyq/eslint-config 2.0.0-beta.9 → 2.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/README.md +6 -6
- package/dist/index.cjs +1561 -0
- package/dist/index.d.cts +132 -0
- package/dist/index.d.ts +90 -38
- package/dist/index.js +874 -438
- package/package.json +57 -48
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,1561 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// src/index.ts
|
|
31
|
+
var src_exports = {};
|
|
32
|
+
__export(src_exports, {
|
|
33
|
+
GLOB_ALL_SRC: () => GLOB_ALL_SRC,
|
|
34
|
+
GLOB_CSS: () => GLOB_CSS,
|
|
35
|
+
GLOB_DIST: () => GLOB_DIST,
|
|
36
|
+
GLOB_EXCLUDE: () => GLOB_EXCLUDE,
|
|
37
|
+
GLOB_HTML: () => GLOB_HTML,
|
|
38
|
+
GLOB_JS: () => GLOB_JS,
|
|
39
|
+
GLOB_JSON: () => GLOB_JSON,
|
|
40
|
+
GLOB_JSON5: () => GLOB_JSON5,
|
|
41
|
+
GLOB_JSONC: () => GLOB_JSONC,
|
|
42
|
+
GLOB_JSX: () => GLOB_JSX,
|
|
43
|
+
GLOB_LESS: () => GLOB_LESS,
|
|
44
|
+
GLOB_LOCKFILE: () => GLOB_LOCKFILE,
|
|
45
|
+
GLOB_MARKDOWN: () => GLOB_MARKDOWN,
|
|
46
|
+
GLOB_NODE_MODULES: () => GLOB_NODE_MODULES,
|
|
47
|
+
GLOB_SCSS: () => GLOB_SCSS,
|
|
48
|
+
GLOB_SRC: () => GLOB_SRC,
|
|
49
|
+
GLOB_SRC_EXT: () => GLOB_SRC_EXT,
|
|
50
|
+
GLOB_STYLE: () => GLOB_STYLE,
|
|
51
|
+
GLOB_TS: () => GLOB_TS,
|
|
52
|
+
GLOB_TSX: () => GLOB_TSX,
|
|
53
|
+
GLOB_VUE: () => GLOB_VUE,
|
|
54
|
+
GLOB_YAML: () => GLOB_YAML,
|
|
55
|
+
comments: () => comments,
|
|
56
|
+
getVueVersion: () => getVueVersion,
|
|
57
|
+
hasTypeScript: () => hasTypeScript,
|
|
58
|
+
hasUnoCSS: () => hasUnoCSS,
|
|
59
|
+
hasVue: () => hasVue,
|
|
60
|
+
ignores: () => ignores,
|
|
61
|
+
imports: () => imports,
|
|
62
|
+
interopDefault: () => interopDefault,
|
|
63
|
+
javascript: () => javascript,
|
|
64
|
+
jsdoc: () => jsdoc,
|
|
65
|
+
jsonc: () => jsonc,
|
|
66
|
+
jsx: () => jsx,
|
|
67
|
+
markdown: () => markdown,
|
|
68
|
+
node: () => node,
|
|
69
|
+
ntnyq: () => ntnyq,
|
|
70
|
+
parserJsonc: () => parserJsonc,
|
|
71
|
+
parserVue: () => parserVue,
|
|
72
|
+
parserYaml: () => parserYaml,
|
|
73
|
+
pluginComments: () => import_eslint_plugin_eslint_comments.default,
|
|
74
|
+
pluginImport: () => import_eslint_plugin_import_x.default,
|
|
75
|
+
pluginJsdoc: () => import_eslint_plugin_jsdoc.default,
|
|
76
|
+
pluginJsonc: () => import_eslint_plugin_jsonc.default,
|
|
77
|
+
pluginMarkdown: () => import_eslint_plugin_markdown.default,
|
|
78
|
+
pluginNode: () => import_eslint_plugin_n.default,
|
|
79
|
+
pluginPrettier: () => import_eslint_plugin_prettier.default,
|
|
80
|
+
pluginUnicorn: () => import_eslint_plugin_unicorn.default,
|
|
81
|
+
pluginUnoCSS: () => import_eslint_plugin.default,
|
|
82
|
+
pluginVue: () => import_eslint_plugin_vue.default,
|
|
83
|
+
pluginYaml: () => import_eslint_plugin_yml.default,
|
|
84
|
+
presetAll: () => presetAll,
|
|
85
|
+
presetBasic: () => presetBasic,
|
|
86
|
+
presetCommon: () => presetCommon,
|
|
87
|
+
presetJavaScript: () => presetJavaScript,
|
|
88
|
+
presetJsonc: () => presetJsonc,
|
|
89
|
+
presetLanguageExtensions: () => presetLanguageExtensions,
|
|
90
|
+
prettier: () => prettier,
|
|
91
|
+
sortPackageJson: () => sortPackageJson,
|
|
92
|
+
sortTsConfig: () => sortTsConfig,
|
|
93
|
+
tseslint: () => import_typescript_eslint.default,
|
|
94
|
+
typescript: () => typescript,
|
|
95
|
+
typescriptCore: () => typescriptCore,
|
|
96
|
+
unicorn: () => unicorn,
|
|
97
|
+
unocss: () => unocss,
|
|
98
|
+
vue: () => vue,
|
|
99
|
+
yml: () => yml
|
|
100
|
+
});
|
|
101
|
+
module.exports = __toCommonJS(src_exports);
|
|
102
|
+
|
|
103
|
+
// src/env.ts
|
|
104
|
+
var import_local_pkg = require("local-pkg");
|
|
105
|
+
var hasTypeScript = (0, import_local_pkg.isPackageExists)("typescript");
|
|
106
|
+
var hasVue = (0, import_local_pkg.isPackageExists)("vue") || (0, import_local_pkg.isPackageExists)("nuxt") || (0, import_local_pkg.isPackageExists)("vitepress") || (0, import_local_pkg.isPackageExists)("@slidev/cli");
|
|
107
|
+
var hasUnoCSS = (0, import_local_pkg.isPackageExists)("unocss") || (0, import_local_pkg.isPackageExists)("@unocss/webpack") || (0, import_local_pkg.isPackageExists)("@unocss/nuxt");
|
|
108
|
+
|
|
109
|
+
// src/globs.ts
|
|
110
|
+
var GLOB_SRC_EXT = "?([cm])[jt]s?(x)";
|
|
111
|
+
var GLOB_SRC = "**/*.?([cm])[jt]s?(x)";
|
|
112
|
+
var GLOB_JS = "**/*.?([cm])js";
|
|
113
|
+
var GLOB_JSX = "**/*.?([cm])jsx";
|
|
114
|
+
var GLOB_TS = "**/*.?([cm])ts";
|
|
115
|
+
var GLOB_TSX = "**/*.?([cm])tsx";
|
|
116
|
+
var GLOB_STYLE = "**/*.{c,le,sc}ss";
|
|
117
|
+
var GLOB_CSS = "**/*.css";
|
|
118
|
+
var GLOB_LESS = "**/*.less";
|
|
119
|
+
var GLOB_SCSS = "**/*.scss";
|
|
120
|
+
var GLOB_JSON = "**/*.json";
|
|
121
|
+
var GLOB_JSON5 = "**/*.json5";
|
|
122
|
+
var GLOB_JSONC = "**/*.jsonc";
|
|
123
|
+
var GLOB_VUE = "**/*.vue";
|
|
124
|
+
var GLOB_MARKDOWN = "**/*.md";
|
|
125
|
+
var GLOB_YAML = "**/*.y?(a)ml";
|
|
126
|
+
var GLOB_HTML = "**/*.htm?(l)";
|
|
127
|
+
var GLOB_ALL_SRC = [
|
|
128
|
+
GLOB_SRC,
|
|
129
|
+
GLOB_STYLE,
|
|
130
|
+
GLOB_JSON,
|
|
131
|
+
GLOB_JSON5,
|
|
132
|
+
GLOB_MARKDOWN,
|
|
133
|
+
GLOB_VUE,
|
|
134
|
+
GLOB_YAML,
|
|
135
|
+
GLOB_HTML
|
|
136
|
+
];
|
|
137
|
+
var GLOB_NODE_MODULES = "**/node_modules/**";
|
|
138
|
+
var GLOB_DIST = "**/dist/**";
|
|
139
|
+
var GLOB_LOCKFILE = [
|
|
140
|
+
"**/package-lock.json",
|
|
141
|
+
"**/yarn.lock",
|
|
142
|
+
"**/pnpm-lock.yaml",
|
|
143
|
+
"**/bun.lockb"
|
|
144
|
+
];
|
|
145
|
+
var GLOB_EXCLUDE = [
|
|
146
|
+
GLOB_NODE_MODULES,
|
|
147
|
+
GLOB_DIST,
|
|
148
|
+
...GLOB_LOCKFILE,
|
|
149
|
+
"**/CHANGELOG*.md",
|
|
150
|
+
"**/*.min.*",
|
|
151
|
+
"**/LICENSE*",
|
|
152
|
+
"**/__snapshots__",
|
|
153
|
+
"**/auto-import?(s).d.ts",
|
|
154
|
+
"**/components.d.ts",
|
|
155
|
+
"**/coverage",
|
|
156
|
+
"**/fixtures",
|
|
157
|
+
"**/output",
|
|
158
|
+
"**/public",
|
|
159
|
+
"**/static",
|
|
160
|
+
"**/temp",
|
|
161
|
+
"**/cache",
|
|
162
|
+
"**/.vitepress/cache",
|
|
163
|
+
"**/.eslintcache",
|
|
164
|
+
"**/.stylelintcache",
|
|
165
|
+
"**/.vite-inspect",
|
|
166
|
+
"**/.nuxt",
|
|
167
|
+
"**/.output",
|
|
168
|
+
"**/.tsup",
|
|
169
|
+
"**/.nitro",
|
|
170
|
+
"**/.vercel",
|
|
171
|
+
"**/.changeset",
|
|
172
|
+
"**/.npmrc",
|
|
173
|
+
"**/.yarnrc",
|
|
174
|
+
// Force lint
|
|
175
|
+
"!.github",
|
|
176
|
+
"!.vitepress",
|
|
177
|
+
"!.vuepress",
|
|
178
|
+
"!.vscode"
|
|
179
|
+
];
|
|
180
|
+
|
|
181
|
+
// src/presets.ts
|
|
182
|
+
var import_eslint_define_config16 = require("eslint-define-config");
|
|
183
|
+
|
|
184
|
+
// src/configs/ignores.ts
|
|
185
|
+
var import_eslint_define_config = require("eslint-define-config");
|
|
186
|
+
var ignores = (0, import_eslint_define_config.defineFlatConfig)([
|
|
187
|
+
{
|
|
188
|
+
ignores: GLOB_EXCLUDE
|
|
189
|
+
}
|
|
190
|
+
]);
|
|
191
|
+
|
|
192
|
+
// src/configs/node.ts
|
|
193
|
+
var import_eslint_define_config2 = require("eslint-define-config");
|
|
194
|
+
|
|
195
|
+
// src/plugins.ts
|
|
196
|
+
var import_eslint_plugin_n = __toESM(require("eslint-plugin-n"), 1);
|
|
197
|
+
var import_eslint_plugin_vue = __toESM(require("eslint-plugin-vue"), 1);
|
|
198
|
+
var import_eslint_plugin = __toESM(require("@unocss/eslint-plugin"), 1);
|
|
199
|
+
var import_eslint_plugin_unicorn = __toESM(require("eslint-plugin-unicorn"), 1);
|
|
200
|
+
var import_eslint_plugin_prettier = __toESM(require("eslint-plugin-prettier"), 1);
|
|
201
|
+
var import_eslint_plugin_markdown = __toESM(require("eslint-plugin-markdown"), 1);
|
|
202
|
+
var import_eslint_plugin_eslint_comments = __toESM(require("eslint-plugin-eslint-comments"), 1);
|
|
203
|
+
var import_eslint_plugin_yml = __toESM(require("eslint-plugin-yml"), 1);
|
|
204
|
+
var import_eslint_plugin_jsonc = __toESM(require("eslint-plugin-jsonc"), 1);
|
|
205
|
+
var import_eslint_plugin_import_x = __toESM(require("eslint-plugin-import-x"), 1);
|
|
206
|
+
var import_eslint_plugin_jsdoc = __toESM(require("eslint-plugin-jsdoc"), 1);
|
|
207
|
+
var import_typescript_eslint = __toESM(require("typescript-eslint"), 1);
|
|
208
|
+
var parserYaml = __toESM(require("yaml-eslint-parser"), 1);
|
|
209
|
+
var parserVue = __toESM(require("vue-eslint-parser"), 1);
|
|
210
|
+
var parserJsonc = __toESM(require("jsonc-eslint-parser"), 1);
|
|
211
|
+
// @__NO_SIDE_EFFECTS__
|
|
212
|
+
function interopDefault(m) {
|
|
213
|
+
return m.default || m;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
// src/configs/node.ts
|
|
217
|
+
var node = (0, import_eslint_define_config2.defineFlatConfig)([
|
|
218
|
+
{
|
|
219
|
+
plugins: {
|
|
220
|
+
node: import_eslint_plugin_n.default
|
|
221
|
+
},
|
|
222
|
+
rules: {
|
|
223
|
+
"node/handle-callback-err": ["error", "^(err|error)$"],
|
|
224
|
+
"node/no-deprecated-api": "error",
|
|
225
|
+
"node/no-exports-assign": "error",
|
|
226
|
+
"node/no-new-require": "error",
|
|
227
|
+
"node/no-path-concat": "error",
|
|
228
|
+
"node/prefer-global/buffer": ["error", "never"],
|
|
229
|
+
"node/prefer-global/process": ["error", "never"],
|
|
230
|
+
"node/process-exit-as-throw": "error"
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
]);
|
|
234
|
+
|
|
235
|
+
// src/configs/jsdoc.ts
|
|
236
|
+
var import_eslint_define_config3 = require("eslint-define-config");
|
|
237
|
+
var jsdoc = (0, import_eslint_define_config3.defineFlatConfig)([
|
|
238
|
+
{
|
|
239
|
+
plugins: {
|
|
240
|
+
jsdoc: import_eslint_plugin_jsdoc.default
|
|
241
|
+
},
|
|
242
|
+
rules: {
|
|
243
|
+
"jsdoc/check-access": "warn",
|
|
244
|
+
"jsdoc/check-param-names": "warn",
|
|
245
|
+
"jsdoc/check-property-names": "warn",
|
|
246
|
+
"jsdoc/check-types": "warn",
|
|
247
|
+
"jsdoc/empty-tags": "warn",
|
|
248
|
+
"jsdoc/implements-on-classes": "warn",
|
|
249
|
+
"jsdoc/no-defaults": "warn",
|
|
250
|
+
"jsdoc/no-multi-asterisks": "warn",
|
|
251
|
+
"jsdoc/require-param-name": "warn",
|
|
252
|
+
"jsdoc/require-property": "warn",
|
|
253
|
+
"jsdoc/require-property-description": "warn",
|
|
254
|
+
"jsdoc/require-property-name": "warn",
|
|
255
|
+
"jsdoc/require-returns-check": "warn",
|
|
256
|
+
"jsdoc/require-returns-description": "warn",
|
|
257
|
+
"jsdoc/require-yields-check": "warn",
|
|
258
|
+
"jsdoc/check-alignment": "warn",
|
|
259
|
+
"jsdoc/multiline-blocks": "warn"
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
]);
|
|
263
|
+
|
|
264
|
+
// src/configs/imports.ts
|
|
265
|
+
var import_eslint_define_config4 = require("eslint-define-config");
|
|
266
|
+
var imports = (0, import_eslint_define_config4.defineFlatConfig)([
|
|
267
|
+
{
|
|
268
|
+
plugins: {
|
|
269
|
+
import: import_eslint_plugin_import_x.default
|
|
270
|
+
},
|
|
271
|
+
settings: {
|
|
272
|
+
"import/resolver": {
|
|
273
|
+
node: { extensions: [".js", ".mjs", ".ts", ".mts", ".d.ts"] }
|
|
274
|
+
}
|
|
275
|
+
},
|
|
276
|
+
rules: {
|
|
277
|
+
"import/no-unresolved": "off",
|
|
278
|
+
"import/no-absolute-path": "off",
|
|
279
|
+
"import/no-named-as-default-member": "off",
|
|
280
|
+
"import/first": "error",
|
|
281
|
+
"import/export": "error",
|
|
282
|
+
"import/no-duplicates": "error",
|
|
283
|
+
"import/no-mutable-exports": "error",
|
|
284
|
+
"import/newline-after-import": "error",
|
|
285
|
+
"import/order": [
|
|
286
|
+
"error",
|
|
287
|
+
{
|
|
288
|
+
groups: [
|
|
289
|
+
"builtin",
|
|
290
|
+
"external",
|
|
291
|
+
"internal",
|
|
292
|
+
"parent",
|
|
293
|
+
"sibling",
|
|
294
|
+
"index",
|
|
295
|
+
"object",
|
|
296
|
+
"type"
|
|
297
|
+
],
|
|
298
|
+
"newlines-between": "never",
|
|
299
|
+
pathGroups: [{ pattern: "{{@,~}/,#}**", group: "internal" }],
|
|
300
|
+
pathGroupsExcludedImportTypes: ["type"]
|
|
301
|
+
}
|
|
302
|
+
]
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
]);
|
|
306
|
+
|
|
307
|
+
// src/configs/unicorn.ts
|
|
308
|
+
var import_eslint_define_config5 = require("eslint-define-config");
|
|
309
|
+
var unicorn = (0, import_eslint_define_config5.defineFlatConfig)([
|
|
310
|
+
{
|
|
311
|
+
plugins: {
|
|
312
|
+
unicorn: import_eslint_plugin_unicorn.default
|
|
313
|
+
},
|
|
314
|
+
rules: {
|
|
315
|
+
"unicorn/no-unsafe-regex": "off",
|
|
316
|
+
"unicorn/error-message": "error",
|
|
317
|
+
"unicorn/escape-case": "error",
|
|
318
|
+
"unicorn/no-new-buffer": "error",
|
|
319
|
+
"unicorn/number-literal-case": "error",
|
|
320
|
+
"unicorn/prefer-includes": "error",
|
|
321
|
+
"unicorn/prefer-type-error": "error",
|
|
322
|
+
"unicorn/throw-new-error": "error",
|
|
323
|
+
"unicorn/no-unnecessary-await": "error",
|
|
324
|
+
"unicorn/switch-case-braces": ["error", "avoid"],
|
|
325
|
+
"unicorn/no-typeof-undefined": "error",
|
|
326
|
+
"unicorn/prefer-set-size": "error",
|
|
327
|
+
"unicorn/better-regex": "error",
|
|
328
|
+
"unicorn/prefer-regexp-test": "error",
|
|
329
|
+
"unicorn/prefer-top-level-await": "error",
|
|
330
|
+
"unicorn/no-static-only-class": "error",
|
|
331
|
+
"unicorn/no-zero-fractions": "error",
|
|
332
|
+
"unicorn/custom-error-definition": "error",
|
|
333
|
+
"unicorn/prefer-modern-math-apis": "error",
|
|
334
|
+
"unicorn/explicit-length-check": "error",
|
|
335
|
+
"unicorn/new-for-builtins": "error",
|
|
336
|
+
"unicorn/no-console-spaces": "error",
|
|
337
|
+
"unicorn/no-for-loop": "error",
|
|
338
|
+
"unicorn/no-hex-escape": "error",
|
|
339
|
+
"unicorn/no-lonely-if": "error",
|
|
340
|
+
"unicorn/prefer-keyboard-event-key": "error",
|
|
341
|
+
"unicorn/prefer-math-trunc": "error",
|
|
342
|
+
"unicorn/prefer-negative-index": "error",
|
|
343
|
+
"unicorn/prefer-node-protocol": "error",
|
|
344
|
+
"unicorn/prefer-number-properties": "error",
|
|
345
|
+
"unicorn/prefer-optional-catch-binding": "error",
|
|
346
|
+
"unicorn/prefer-prototype-methods": "error",
|
|
347
|
+
"unicorn/prefer-reflect-apply": "error",
|
|
348
|
+
"unicorn/catch-error-name": [
|
|
349
|
+
"error",
|
|
350
|
+
{
|
|
351
|
+
name: "err",
|
|
352
|
+
ignore: ["^_."]
|
|
353
|
+
}
|
|
354
|
+
],
|
|
355
|
+
"unicorn/prefer-date-now": "error",
|
|
356
|
+
// String
|
|
357
|
+
"unicorn/prefer-string-slice": "error",
|
|
358
|
+
"unicorn/prefer-string-trim-start-end": "error",
|
|
359
|
+
"unicorn/prefer-string-starts-ends-with": "error",
|
|
360
|
+
// DOM
|
|
361
|
+
"unicorn/prefer-add-event-listener": "error",
|
|
362
|
+
"unicorn/no-invalid-remove-event-listener": "error",
|
|
363
|
+
"unicorn/prefer-query-selector": "error",
|
|
364
|
+
"unicorn/prefer-modern-dom-apis": "error",
|
|
365
|
+
"unicorn/prefer-dom-node-append": "error",
|
|
366
|
+
"unicorn/prefer-dom-node-dataset": "error",
|
|
367
|
+
"unicorn/prefer-dom-node-remove": "error",
|
|
368
|
+
"unicorn/prefer-dom-node-text-content": "error",
|
|
369
|
+
// Array
|
|
370
|
+
"unicorn/no-new-array": "error",
|
|
371
|
+
"unicorn/no-instanceof-array": "error",
|
|
372
|
+
"unicorn/no-array-push-push": "error",
|
|
373
|
+
"unicorn/no-array-callback-reference": "error",
|
|
374
|
+
"unicorn/no-array-method-this-argument": "error",
|
|
375
|
+
"unicorn/prefer-array-find": "error",
|
|
376
|
+
"unicorn/prefer-array-some": "error",
|
|
377
|
+
"unicorn/prefer-array-flat-map": "error",
|
|
378
|
+
"unicorn/prefer-array-index-of": "error"
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
]);
|
|
382
|
+
|
|
383
|
+
// src/configs/prettier.ts
|
|
384
|
+
var import_eslint_config_prettier = __toESM(require("eslint-config-prettier"), 1);
|
|
385
|
+
var import_eslint_define_config6 = require("eslint-define-config");
|
|
386
|
+
var prettier = (0, import_eslint_define_config6.defineFlatConfig)([
|
|
387
|
+
{
|
|
388
|
+
plugins: {
|
|
389
|
+
prettier: import_eslint_plugin_prettier.default
|
|
390
|
+
},
|
|
391
|
+
rules: {
|
|
392
|
+
...import_eslint_config_prettier.default.rules,
|
|
393
|
+
...import_eslint_plugin_prettier.default.configs.recommended.rules,
|
|
394
|
+
"prettier/prettier": "warn"
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
]);
|
|
398
|
+
|
|
399
|
+
// src/configs/comments.ts
|
|
400
|
+
var import_eslint_define_config7 = require("eslint-define-config");
|
|
401
|
+
var comments = (0, import_eslint_define_config7.defineFlatConfig)([
|
|
402
|
+
{
|
|
403
|
+
plugins: {
|
|
404
|
+
"eslint-comments": import_eslint_plugin_eslint_comments.default
|
|
405
|
+
},
|
|
406
|
+
rules: {
|
|
407
|
+
...import_eslint_plugin_eslint_comments.default.configs.recommended.rules,
|
|
408
|
+
"eslint-comments/disable-enable-pair": ["error", { allowWholeFile: true }]
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
]);
|
|
412
|
+
|
|
413
|
+
// src/configs/javascript.ts
|
|
414
|
+
var import_globals = __toESM(require("globals"), 1);
|
|
415
|
+
var import_js = __toESM(require("@eslint/js"), 1);
|
|
416
|
+
var import_eslint_define_config8 = require("eslint-define-config");
|
|
417
|
+
var javascript = (0, import_eslint_define_config8.defineFlatConfig)([
|
|
418
|
+
import_js.default.configs.recommended,
|
|
419
|
+
{
|
|
420
|
+
languageOptions: {
|
|
421
|
+
globals: {
|
|
422
|
+
...import_globals.default.browser,
|
|
423
|
+
...import_globals.default.es2021,
|
|
424
|
+
...import_globals.default.node
|
|
425
|
+
},
|
|
426
|
+
sourceType: "module"
|
|
427
|
+
},
|
|
428
|
+
rules: {
|
|
429
|
+
// standard v17.0.0
|
|
430
|
+
"accessor-pairs": ["error", { setWithoutGet: true, enforceForClassMembers: true }],
|
|
431
|
+
"array-bracket-spacing": ["error", "never"],
|
|
432
|
+
"arrow-spacing": ["error", { before: true, after: true }],
|
|
433
|
+
"block-spacing": ["error", "always"],
|
|
434
|
+
"brace-style": ["error", "1tbs", { allowSingleLine: true }],
|
|
435
|
+
camelcase: [
|
|
436
|
+
"error",
|
|
437
|
+
{
|
|
438
|
+
allow: ["^UNSAFE_"],
|
|
439
|
+
properties: "never",
|
|
440
|
+
ignoreGlobals: true
|
|
441
|
+
}
|
|
442
|
+
],
|
|
443
|
+
"comma-spacing": ["error", { before: false, after: true }],
|
|
444
|
+
"comma-style": ["error", "last"],
|
|
445
|
+
"computed-property-spacing": ["error", "never", { enforceForClassMembers: true }],
|
|
446
|
+
"constructor-super": "error",
|
|
447
|
+
curly: ["error", "multi-line"],
|
|
448
|
+
"default-case-last": "error",
|
|
449
|
+
"dot-location": ["error", "property"],
|
|
450
|
+
"dot-notation": ["error", { allowKeywords: true }],
|
|
451
|
+
"eol-last": "error",
|
|
452
|
+
"func-call-spacing": ["error", "never"],
|
|
453
|
+
indent: [
|
|
454
|
+
"error",
|
|
455
|
+
2,
|
|
456
|
+
{
|
|
457
|
+
SwitchCase: 1,
|
|
458
|
+
VariableDeclarator: 1,
|
|
459
|
+
outerIIFEBody: 1,
|
|
460
|
+
MemberExpression: 1,
|
|
461
|
+
FunctionDeclaration: { parameters: 1, body: 1 },
|
|
462
|
+
FunctionExpression: { parameters: 1, body: 1 },
|
|
463
|
+
CallExpression: { arguments: 1 },
|
|
464
|
+
ArrayExpression: 1,
|
|
465
|
+
ObjectExpression: 1,
|
|
466
|
+
ImportDeclaration: 1,
|
|
467
|
+
flatTernaryExpressions: false,
|
|
468
|
+
ignoreComments: false,
|
|
469
|
+
ignoredNodes: [
|
|
470
|
+
"TemplateLiteral *",
|
|
471
|
+
"JSXElement",
|
|
472
|
+
"JSXElement > *",
|
|
473
|
+
"JSXAttribute",
|
|
474
|
+
"JSXIdentifier",
|
|
475
|
+
"JSXNamespacedName",
|
|
476
|
+
"JSXMemberExpression",
|
|
477
|
+
"JSXSpreadAttribute",
|
|
478
|
+
"JSXExpressionContainer",
|
|
479
|
+
"JSXOpeningElement",
|
|
480
|
+
"JSXClosingElement",
|
|
481
|
+
"JSXFragment",
|
|
482
|
+
"JSXOpeningFragment",
|
|
483
|
+
"JSXClosingFragment",
|
|
484
|
+
"JSXText",
|
|
485
|
+
"JSXEmptyExpression",
|
|
486
|
+
"JSXSpreadChild"
|
|
487
|
+
],
|
|
488
|
+
offsetTernaryExpressions: true
|
|
489
|
+
}
|
|
490
|
+
],
|
|
491
|
+
"key-spacing": ["error", { beforeColon: false, afterColon: true }],
|
|
492
|
+
"keyword-spacing": ["error", { before: true, after: true }],
|
|
493
|
+
"lines-between-class-members": ["error", "always", { exceptAfterSingleLine: true }],
|
|
494
|
+
"multiline-ternary": ["error", "always-multiline"],
|
|
495
|
+
"new-cap": ["error", { newIsCap: true, capIsNew: false, properties: true }],
|
|
496
|
+
"new-parens": "error",
|
|
497
|
+
"no-array-constructor": "error",
|
|
498
|
+
"no-async-promise-executor": "error",
|
|
499
|
+
"no-caller": "error",
|
|
500
|
+
"no-class-assign": "error",
|
|
501
|
+
"no-compare-neg-zero": "error",
|
|
502
|
+
"no-cond-assign": "error",
|
|
503
|
+
"no-const-assign": "error",
|
|
504
|
+
"no-constant-condition": ["error", { checkLoops: false }],
|
|
505
|
+
"no-control-regex": "error",
|
|
506
|
+
"no-debugger": "error",
|
|
507
|
+
"no-delete-var": "error",
|
|
508
|
+
"no-dupe-args": "error",
|
|
509
|
+
"no-dupe-class-members": "error",
|
|
510
|
+
"no-dupe-keys": "error",
|
|
511
|
+
"no-duplicate-case": "error",
|
|
512
|
+
"no-useless-backreference": "error",
|
|
513
|
+
"no-empty": ["error", { allowEmptyCatch: true }],
|
|
514
|
+
"no-empty-character-class": "error",
|
|
515
|
+
"no-empty-pattern": "error",
|
|
516
|
+
"no-eval": "error",
|
|
517
|
+
"no-ex-assign": "error",
|
|
518
|
+
"no-extend-native": "error",
|
|
519
|
+
"no-extra-bind": "error",
|
|
520
|
+
"no-extra-boolean-cast": "error",
|
|
521
|
+
"no-extra-parens": ["error", "functions"],
|
|
522
|
+
"no-fallthrough": "error",
|
|
523
|
+
"no-floating-decimal": "error",
|
|
524
|
+
"no-func-assign": "error",
|
|
525
|
+
"no-global-assign": "error",
|
|
526
|
+
"no-implied-eval": "error",
|
|
527
|
+
"no-import-assign": "error",
|
|
528
|
+
"no-invalid-regexp": "error",
|
|
529
|
+
"no-irregular-whitespace": "error",
|
|
530
|
+
"no-iterator": "error",
|
|
531
|
+
"no-labels": ["error", { allowLoop: false, allowSwitch: false }],
|
|
532
|
+
"no-lone-blocks": "error",
|
|
533
|
+
"no-loss-of-precision": "error",
|
|
534
|
+
"no-misleading-character-class": "error",
|
|
535
|
+
"no-prototype-builtins": "error",
|
|
536
|
+
"no-useless-catch": "error",
|
|
537
|
+
"no-mixed-operators": [
|
|
538
|
+
"error",
|
|
539
|
+
{
|
|
540
|
+
groups: [
|
|
541
|
+
["==", "!=", "===", "!==", ">", ">=", "<", "<="],
|
|
542
|
+
["&&", "||"],
|
|
543
|
+
["in", "instanceof"]
|
|
544
|
+
],
|
|
545
|
+
allowSamePrecedence: true
|
|
546
|
+
}
|
|
547
|
+
],
|
|
548
|
+
"no-mixed-spaces-and-tabs": "error",
|
|
549
|
+
"no-multiple-empty-lines": ["error", { max: 1, maxBOF: 0, maxEOF: 0 }],
|
|
550
|
+
"no-new": "error",
|
|
551
|
+
"no-new-func": "error",
|
|
552
|
+
"no-new-object": "error",
|
|
553
|
+
"no-new-symbol": "error",
|
|
554
|
+
"no-new-wrappers": "error",
|
|
555
|
+
"no-obj-calls": "error",
|
|
556
|
+
"no-octal": "error",
|
|
557
|
+
"no-octal-escape": "error",
|
|
558
|
+
"no-proto": "error",
|
|
559
|
+
"no-redeclare": ["error", { builtinGlobals: false }],
|
|
560
|
+
"no-regex-spaces": "error",
|
|
561
|
+
"no-self-assign": ["error", { props: true }],
|
|
562
|
+
"no-self-compare": "error",
|
|
563
|
+
"no-sequences": "error",
|
|
564
|
+
"no-shadow-restricted-names": "error",
|
|
565
|
+
"no-sparse-arrays": "error",
|
|
566
|
+
"no-tabs": "error",
|
|
567
|
+
"no-template-curly-in-string": "error",
|
|
568
|
+
"no-this-before-super": "error",
|
|
569
|
+
"no-throw-literal": "error",
|
|
570
|
+
"no-trailing-spaces": "error",
|
|
571
|
+
"no-undef": "error",
|
|
572
|
+
"no-undef-init": "error",
|
|
573
|
+
"no-unexpected-multiline": "error",
|
|
574
|
+
"no-unmodified-loop-condition": "error",
|
|
575
|
+
"no-unneeded-ternary": ["error", { defaultAssignment: false }],
|
|
576
|
+
"no-unreachable": "error",
|
|
577
|
+
"no-unreachable-loop": "error",
|
|
578
|
+
"no-unsafe-finally": "error",
|
|
579
|
+
"no-unsafe-negation": "error",
|
|
580
|
+
"no-unused-expressions": [
|
|
581
|
+
"error",
|
|
582
|
+
{
|
|
583
|
+
allowShortCircuit: true,
|
|
584
|
+
allowTernary: true,
|
|
585
|
+
allowTaggedTemplates: true
|
|
586
|
+
}
|
|
587
|
+
],
|
|
588
|
+
"no-unused-vars": [
|
|
589
|
+
"error",
|
|
590
|
+
{
|
|
591
|
+
args: "none",
|
|
592
|
+
caughtErrors: "none",
|
|
593
|
+
ignoreRestSiblings: true,
|
|
594
|
+
vars: "all"
|
|
595
|
+
}
|
|
596
|
+
],
|
|
597
|
+
"no-useless-call": "error",
|
|
598
|
+
"no-useless-computed-key": "error",
|
|
599
|
+
"no-useless-constructor": "error",
|
|
600
|
+
"no-useless-rename": "error",
|
|
601
|
+
"no-useless-return": "error",
|
|
602
|
+
"no-whitespace-before-property": "error",
|
|
603
|
+
"object-curly-newline": ["error", { multiline: true, consistent: true }],
|
|
604
|
+
"object-curly-spacing": ["error", "always"],
|
|
605
|
+
"object-property-newline": ["error", { allowMultiplePropertiesPerLine: true }],
|
|
606
|
+
"padded-blocks": ["error", { blocks: "never", switches: "never", classes: "never" }],
|
|
607
|
+
"prefer-promise-reject-errors": "error",
|
|
608
|
+
"prefer-regex-literals": ["error", { disallowRedundantWrapping: true }],
|
|
609
|
+
"quote-props": ["error", "as-needed"],
|
|
610
|
+
"rest-spread-spacing": ["error", "never"],
|
|
611
|
+
semi: ["error", "never"],
|
|
612
|
+
"semi-spacing": ["error", { before: false, after: true }],
|
|
613
|
+
"space-before-blocks": ["error", "always"],
|
|
614
|
+
"space-before-function-paren": ["error", "never"],
|
|
615
|
+
"space-in-parens": ["error", "never"],
|
|
616
|
+
"space-infix-ops": "error",
|
|
617
|
+
"space-unary-ops": ["error", { words: true, nonwords: false }],
|
|
618
|
+
"symbol-description": "error",
|
|
619
|
+
"template-tag-spacing": ["error", "never"],
|
|
620
|
+
"unicode-bom": ["error", "never"],
|
|
621
|
+
"use-isnan": [
|
|
622
|
+
"error",
|
|
623
|
+
{
|
|
624
|
+
enforceForSwitchCase: true,
|
|
625
|
+
enforceForIndexOf: true
|
|
626
|
+
}
|
|
627
|
+
],
|
|
628
|
+
"valid-typeof": ["error", { requireStringLiterals: true }],
|
|
629
|
+
"wrap-iife": ["error", "any", { functionPrototypeMethods: true }],
|
|
630
|
+
"yield-star-spacing": ["error", "both"],
|
|
631
|
+
yoda: ["error", "never"],
|
|
632
|
+
// es6+
|
|
633
|
+
"no-var": "error",
|
|
634
|
+
"prefer-rest-params": "error",
|
|
635
|
+
"prefer-spread": "error",
|
|
636
|
+
"prefer-template": "error",
|
|
637
|
+
"template-curly-spacing": "error",
|
|
638
|
+
"generator-star-spacing": "off",
|
|
639
|
+
"no-empty-static-block": "error",
|
|
640
|
+
"no-new-native-nonconstructor": "error",
|
|
641
|
+
"arrow-parens": [
|
|
642
|
+
"error",
|
|
643
|
+
"as-needed",
|
|
644
|
+
{
|
|
645
|
+
requireForBlockBody: false
|
|
646
|
+
}
|
|
647
|
+
],
|
|
648
|
+
quotes: [
|
|
649
|
+
"error",
|
|
650
|
+
"single",
|
|
651
|
+
{
|
|
652
|
+
avoidEscape: true,
|
|
653
|
+
allowTemplateLiterals: false
|
|
654
|
+
}
|
|
655
|
+
],
|
|
656
|
+
"prefer-const": [
|
|
657
|
+
"error",
|
|
658
|
+
{
|
|
659
|
+
destructuring: "all",
|
|
660
|
+
ignoreReadBeforeAssign: true
|
|
661
|
+
}
|
|
662
|
+
],
|
|
663
|
+
"prefer-arrow-callback": [
|
|
664
|
+
"error",
|
|
665
|
+
{
|
|
666
|
+
allowNamedFunctions: false,
|
|
667
|
+
allowUnboundThis: true
|
|
668
|
+
}
|
|
669
|
+
],
|
|
670
|
+
"object-shorthand": [
|
|
671
|
+
"error",
|
|
672
|
+
"always",
|
|
673
|
+
{
|
|
674
|
+
ignoreConstructors: false,
|
|
675
|
+
avoidQuotes: true
|
|
676
|
+
}
|
|
677
|
+
],
|
|
678
|
+
"spaced-comment": [
|
|
679
|
+
"error",
|
|
680
|
+
"always",
|
|
681
|
+
{
|
|
682
|
+
line: {
|
|
683
|
+
markers: ["/"],
|
|
684
|
+
exceptions: ["/", "#"]
|
|
685
|
+
},
|
|
686
|
+
block: {
|
|
687
|
+
markers: ["!"],
|
|
688
|
+
exceptions: ["*"],
|
|
689
|
+
balanced: true
|
|
690
|
+
}
|
|
691
|
+
}
|
|
692
|
+
],
|
|
693
|
+
// best-practice
|
|
694
|
+
eqeqeq: ["error", "smart"],
|
|
695
|
+
complexity: ["error", { max: 30 }],
|
|
696
|
+
"array-callback-return": "error",
|
|
697
|
+
"block-scoped-var": "error",
|
|
698
|
+
"consistent-return": "off",
|
|
699
|
+
"no-alert": "error",
|
|
700
|
+
"no-case-declarations": "error",
|
|
701
|
+
"no-multi-spaces": "error",
|
|
702
|
+
"no-multi-str": "error",
|
|
703
|
+
"no-with": "error",
|
|
704
|
+
"no-void": "error",
|
|
705
|
+
"no-useless-escape": "off",
|
|
706
|
+
"vars-on-top": "error",
|
|
707
|
+
"require-await": "off",
|
|
708
|
+
"no-return-assign": "off",
|
|
709
|
+
"one-var": ["error", "never"],
|
|
710
|
+
"operator-linebreak": ["error", "before"],
|
|
711
|
+
"comma-dangle": ["error", "always-multiline"],
|
|
712
|
+
"max-params": ["error", { max: 5 }],
|
|
713
|
+
"max-depth": ["error", { max: 5 }],
|
|
714
|
+
"max-nested-callbacks": ["error", { max: 10 }],
|
|
715
|
+
"max-statements-per-line": ["error", { max: 2 }],
|
|
716
|
+
"max-lines": [
|
|
717
|
+
"error",
|
|
718
|
+
{
|
|
719
|
+
max: 1e3,
|
|
720
|
+
skipComments: true,
|
|
721
|
+
skipBlankLines: true
|
|
722
|
+
}
|
|
723
|
+
],
|
|
724
|
+
"max-lines-per-function": [
|
|
725
|
+
"error",
|
|
726
|
+
{
|
|
727
|
+
max: 100,
|
|
728
|
+
skipComments: true,
|
|
729
|
+
skipBlankLines: true
|
|
730
|
+
}
|
|
731
|
+
],
|
|
732
|
+
"no-use-before-define": [
|
|
733
|
+
"error",
|
|
734
|
+
{
|
|
735
|
+
functions: false,
|
|
736
|
+
classes: false,
|
|
737
|
+
variables: true
|
|
738
|
+
}
|
|
739
|
+
],
|
|
740
|
+
"max-len": [
|
|
741
|
+
"error",
|
|
742
|
+
{
|
|
743
|
+
code: 200,
|
|
744
|
+
tabWidth: 2,
|
|
745
|
+
comments: 200,
|
|
746
|
+
ignoreUrls: true,
|
|
747
|
+
ignoreStrings: true,
|
|
748
|
+
ignoreRegExpLiterals: true,
|
|
749
|
+
ignoreTemplateLiterals: true,
|
|
750
|
+
ignoreTrailingComments: true
|
|
751
|
+
}
|
|
752
|
+
],
|
|
753
|
+
"sort-imports": [
|
|
754
|
+
"error",
|
|
755
|
+
{
|
|
756
|
+
ignoreCase: false,
|
|
757
|
+
ignoreDeclarationSort: true,
|
|
758
|
+
ignoreMemberSort: false,
|
|
759
|
+
memberSyntaxSortOrder: ["none", "all", "multiple", "single"],
|
|
760
|
+
allowSeparatedGroups: false
|
|
761
|
+
}
|
|
762
|
+
]
|
|
763
|
+
}
|
|
764
|
+
},
|
|
765
|
+
{
|
|
766
|
+
files: ["**/scripts/*", "**/cli.*"],
|
|
767
|
+
rules: {
|
|
768
|
+
"no-console": "off"
|
|
769
|
+
}
|
|
770
|
+
},
|
|
771
|
+
{
|
|
772
|
+
files: ["**/*.{test,spec}.js?(x)"],
|
|
773
|
+
rules: {
|
|
774
|
+
"no-unused-expressions": "off",
|
|
775
|
+
"max-lines-per-function": "off"
|
|
776
|
+
}
|
|
777
|
+
}
|
|
778
|
+
]);
|
|
779
|
+
var jsx = (0, import_eslint_define_config8.defineFlatConfig)([
|
|
780
|
+
{
|
|
781
|
+
files: ["**/*.jsx"],
|
|
782
|
+
languageOptions: {
|
|
783
|
+
parserOptions: {
|
|
784
|
+
ecmaFeatures: {
|
|
785
|
+
jsx: true
|
|
786
|
+
}
|
|
787
|
+
}
|
|
788
|
+
}
|
|
789
|
+
}
|
|
790
|
+
]);
|
|
791
|
+
|
|
792
|
+
// src/configs/typescript.ts
|
|
793
|
+
var import_eslint_define_config9 = require("eslint-define-config");
|
|
794
|
+
var typescriptCore = import_typescript_eslint.default.config({
|
|
795
|
+
extends: [...import_typescript_eslint.default.configs.recommended],
|
|
796
|
+
files: [GLOB_TS, GLOB_TSX],
|
|
797
|
+
languageOptions: {
|
|
798
|
+
parser: import_typescript_eslint.default.parser,
|
|
799
|
+
parserOptions: {
|
|
800
|
+
sourceType: "module"
|
|
801
|
+
}
|
|
802
|
+
},
|
|
803
|
+
rules: {
|
|
804
|
+
"@typescript-eslint/no-unused-vars": "error",
|
|
805
|
+
"@typescript-eslint/no-redeclare": "error",
|
|
806
|
+
"@typescript-eslint/consistent-type-imports": [
|
|
807
|
+
"error",
|
|
808
|
+
{
|
|
809
|
+
prefer: "type-imports",
|
|
810
|
+
fixStyle: "separate-type-imports",
|
|
811
|
+
disallowTypeAnnotations: false
|
|
812
|
+
}
|
|
813
|
+
],
|
|
814
|
+
"@typescript-eslint/consistent-type-assertions": [
|
|
815
|
+
"error",
|
|
816
|
+
{
|
|
817
|
+
assertionStyle: "as",
|
|
818
|
+
objectLiteralTypeAssertions: "allow-as-parameter"
|
|
819
|
+
}
|
|
820
|
+
],
|
|
821
|
+
"@typescript-eslint/prefer-as-const": "warn",
|
|
822
|
+
"@typescript-eslint/ban-types": "off",
|
|
823
|
+
"@typescript-eslint/camelcase": "off",
|
|
824
|
+
"@typescript-eslint/no-namespace": "off",
|
|
825
|
+
"@typescript-eslint/ban-ts-ignore": "off",
|
|
826
|
+
"@typescript-eslint/ban-ts-comment": "off",
|
|
827
|
+
"@typescript-eslint/no-explicit-any": "off",
|
|
828
|
+
"@typescript-eslint/no-empty-function": "off",
|
|
829
|
+
"@typescript-eslint/naming-convention": "off",
|
|
830
|
+
"@typescript-eslint/no-empty-interface": "off",
|
|
831
|
+
"@typescript-eslint/no-non-null-assertion": "off",
|
|
832
|
+
"@typescript-eslint/triple-slash-reference": "off",
|
|
833
|
+
"@typescript-eslint/no-parameter-properties": "off",
|
|
834
|
+
"@typescript-eslint/explicit-member-accessibility": "off",
|
|
835
|
+
"@typescript-eslint/explicit-function-return-type": "off",
|
|
836
|
+
"@typescript-eslint/explicit-module-boundary-types": "off",
|
|
837
|
+
"@typescript-eslint/consistent-indexed-object-style": "off"
|
|
838
|
+
}
|
|
839
|
+
});
|
|
840
|
+
var typescript = (0, import_eslint_define_config9.defineFlatConfig)([
|
|
841
|
+
...typescriptCore,
|
|
842
|
+
{
|
|
843
|
+
files: ["**/*.d.ts"],
|
|
844
|
+
rules: {
|
|
845
|
+
"import/no-duplicates": "off",
|
|
846
|
+
"import/newline-after-import": "off"
|
|
847
|
+
}
|
|
848
|
+
},
|
|
849
|
+
{
|
|
850
|
+
files: ["**/*.{spec,test}.ts?(x)"],
|
|
851
|
+
rules: {
|
|
852
|
+
"no-unused-expressions": "off",
|
|
853
|
+
"max-lines-per-function": "off"
|
|
854
|
+
}
|
|
855
|
+
},
|
|
856
|
+
{
|
|
857
|
+
files: [GLOB_JS, "**/*.cjs"],
|
|
858
|
+
rules: {
|
|
859
|
+
"@typescript-eslint/no-var-requires": "off"
|
|
860
|
+
}
|
|
861
|
+
}
|
|
862
|
+
]);
|
|
863
|
+
|
|
864
|
+
// src/configs/unocss.ts
|
|
865
|
+
var import_eslint_define_config10 = require("eslint-define-config");
|
|
866
|
+
var unocss = (0, import_eslint_define_config10.defineFlatConfig)([
|
|
867
|
+
{
|
|
868
|
+
plugins: {
|
|
869
|
+
unocss: import_eslint_plugin.default
|
|
870
|
+
},
|
|
871
|
+
rules: {
|
|
872
|
+
"unocss/order": "error",
|
|
873
|
+
// We don't use this
|
|
874
|
+
"unocss/order-attributify": "off"
|
|
875
|
+
}
|
|
876
|
+
}
|
|
877
|
+
]);
|
|
878
|
+
|
|
879
|
+
// src/configs/yml.ts
|
|
880
|
+
var import_eslint_define_config11 = require("eslint-define-config");
|
|
881
|
+
var yml = (0, import_eslint_define_config11.defineFlatConfig)([
|
|
882
|
+
{
|
|
883
|
+
files: [GLOB_YAML],
|
|
884
|
+
languageOptions: {
|
|
885
|
+
parser: parserYaml
|
|
886
|
+
},
|
|
887
|
+
plugins: {
|
|
888
|
+
yml: import_eslint_plugin_yml.default
|
|
889
|
+
},
|
|
890
|
+
rules: {
|
|
891
|
+
...import_eslint_plugin_yml.default.configs.standard.rules,
|
|
892
|
+
...import_eslint_plugin_yml.default.configs.prettier.rules,
|
|
893
|
+
"yml/no-empty-mapping-value": "off",
|
|
894
|
+
"yml/quotes": ["error", { avoidEscape: false, prefer: "single" }]
|
|
895
|
+
}
|
|
896
|
+
}
|
|
897
|
+
]);
|
|
898
|
+
|
|
899
|
+
// src/configs/sort.ts
|
|
900
|
+
var import_eslint_define_config12 = require("eslint-define-config");
|
|
901
|
+
var sortPackageJson = (0, import_eslint_define_config12.defineFlatConfig)([
|
|
902
|
+
{
|
|
903
|
+
files: ["**/package.json"],
|
|
904
|
+
rules: {
|
|
905
|
+
"jsonc/sort-keys": [
|
|
906
|
+
"error",
|
|
907
|
+
{
|
|
908
|
+
pathPattern: "^$",
|
|
909
|
+
order: [
|
|
910
|
+
"publisher",
|
|
911
|
+
"name",
|
|
912
|
+
"displayName",
|
|
913
|
+
"type",
|
|
914
|
+
"version",
|
|
915
|
+
"private",
|
|
916
|
+
"packageManager",
|
|
917
|
+
"description",
|
|
918
|
+
"keywords",
|
|
919
|
+
"license",
|
|
920
|
+
"author",
|
|
921
|
+
"homepage",
|
|
922
|
+
"repository",
|
|
923
|
+
"funding",
|
|
924
|
+
"exports",
|
|
925
|
+
"main",
|
|
926
|
+
"module",
|
|
927
|
+
"unpkg",
|
|
928
|
+
"jsdelivr",
|
|
929
|
+
// workaround for `type: "module"` with TS `moduleResolution: "node16"`
|
|
930
|
+
"types",
|
|
931
|
+
"typesVersions",
|
|
932
|
+
"bin",
|
|
933
|
+
"icon",
|
|
934
|
+
"files",
|
|
935
|
+
"sideEffects",
|
|
936
|
+
"scripts",
|
|
937
|
+
"peerDependencies",
|
|
938
|
+
"peerDependenciesMeta",
|
|
939
|
+
"dependencies",
|
|
940
|
+
"optionalDependencies",
|
|
941
|
+
"devDependencies",
|
|
942
|
+
"activationEvents",
|
|
943
|
+
"contributes",
|
|
944
|
+
"categories",
|
|
945
|
+
"engines",
|
|
946
|
+
"pnpm",
|
|
947
|
+
"overrides",
|
|
948
|
+
"resolutions",
|
|
949
|
+
"husky",
|
|
950
|
+
"prettier",
|
|
951
|
+
"nano-staged",
|
|
952
|
+
"lint-staged",
|
|
953
|
+
"eslintConfig"
|
|
954
|
+
]
|
|
955
|
+
},
|
|
956
|
+
{
|
|
957
|
+
pathPattern: "^(?:dev|peer|optional|bundled)?[Dd]ependencies(Meta)?$",
|
|
958
|
+
order: { type: "asc" }
|
|
959
|
+
},
|
|
960
|
+
{
|
|
961
|
+
order: { type: "asc" },
|
|
962
|
+
pathPattern: "^(?:resolutions|overrides|pnpm.overrides)$"
|
|
963
|
+
},
|
|
964
|
+
{
|
|
965
|
+
pathPattern: "^exports.*$",
|
|
966
|
+
order: ["types", "import", "require", "default"]
|
|
967
|
+
},
|
|
968
|
+
{
|
|
969
|
+
pathPattern: "^scripts$",
|
|
970
|
+
order: { type: "asc" }
|
|
971
|
+
},
|
|
972
|
+
{
|
|
973
|
+
order: [
|
|
974
|
+
// client hooks only
|
|
975
|
+
"pre-commit",
|
|
976
|
+
"prepare-commit-msg",
|
|
977
|
+
"commit-msg",
|
|
978
|
+
"post-commit",
|
|
979
|
+
"pre-rebase",
|
|
980
|
+
"post-rewrite",
|
|
981
|
+
"post-checkout",
|
|
982
|
+
"post-merge",
|
|
983
|
+
"pre-push",
|
|
984
|
+
"pre-auto-gc"
|
|
985
|
+
],
|
|
986
|
+
pathPattern: "^(?:gitHooks|husky|simple-git-hooks)$"
|
|
987
|
+
}
|
|
988
|
+
],
|
|
989
|
+
"jsonc/sort-array-values": [
|
|
990
|
+
"error",
|
|
991
|
+
{
|
|
992
|
+
pathPattern: "^files$",
|
|
993
|
+
order: { type: "asc" }
|
|
994
|
+
}
|
|
995
|
+
]
|
|
996
|
+
}
|
|
997
|
+
}
|
|
998
|
+
]);
|
|
999
|
+
var sortTsConfig = (0, import_eslint_define_config12.defineFlatConfig)([
|
|
1000
|
+
{
|
|
1001
|
+
files: ["**/tsconfig.json", "**/tsconfig.*.json"],
|
|
1002
|
+
rules: {
|
|
1003
|
+
"jsonc/sort-keys": [
|
|
1004
|
+
"error",
|
|
1005
|
+
{
|
|
1006
|
+
order: ["extends", "compilerOptions", "references", "files", "include", "exclude"],
|
|
1007
|
+
pathPattern: "^$"
|
|
1008
|
+
},
|
|
1009
|
+
{
|
|
1010
|
+
order: [
|
|
1011
|
+
/* Projects */
|
|
1012
|
+
"incremental",
|
|
1013
|
+
"composite",
|
|
1014
|
+
"tsBuildInfoFile",
|
|
1015
|
+
"disableSourceOfProjectReferenceRedirect",
|
|
1016
|
+
"disableSolutionSearching",
|
|
1017
|
+
"disableReferencedProjectLoad",
|
|
1018
|
+
/* Language and Environment */
|
|
1019
|
+
"target",
|
|
1020
|
+
"lib",
|
|
1021
|
+
"jsx",
|
|
1022
|
+
"experimentalDecorators",
|
|
1023
|
+
"emitDecoratorMetadata",
|
|
1024
|
+
"jsxFactory",
|
|
1025
|
+
"jsxFragmentFactory",
|
|
1026
|
+
"jsxImportSource",
|
|
1027
|
+
"reactNamespace",
|
|
1028
|
+
"noLib",
|
|
1029
|
+
"useDefineForClassFields",
|
|
1030
|
+
"moduleDetection",
|
|
1031
|
+
/* Modules */
|
|
1032
|
+
"module",
|
|
1033
|
+
"rootDir",
|
|
1034
|
+
"moduleResolution",
|
|
1035
|
+
"baseUrl",
|
|
1036
|
+
"paths",
|
|
1037
|
+
"rootDirs",
|
|
1038
|
+
"typeRoots",
|
|
1039
|
+
"types",
|
|
1040
|
+
"allowUmdGlobalAccess",
|
|
1041
|
+
"moduleSuffixes",
|
|
1042
|
+
"allowImportingTsExtensions",
|
|
1043
|
+
"resolvePackageJsonExports",
|
|
1044
|
+
"resolvePackageJsonImports",
|
|
1045
|
+
"customConditions",
|
|
1046
|
+
"resolveJsonModule",
|
|
1047
|
+
"allowArbitraryExtensions",
|
|
1048
|
+
"noResolve",
|
|
1049
|
+
/* JavaScript Support */
|
|
1050
|
+
"allowJs",
|
|
1051
|
+
"checkJs",
|
|
1052
|
+
"maxNodeModuleJsDepth",
|
|
1053
|
+
/* Emit */
|
|
1054
|
+
"declaration",
|
|
1055
|
+
"declarationMap",
|
|
1056
|
+
"emitDeclarationOnly",
|
|
1057
|
+
"sourceMap",
|
|
1058
|
+
"inlineSourceMap",
|
|
1059
|
+
"outFile",
|
|
1060
|
+
"outDir",
|
|
1061
|
+
"removeComments",
|
|
1062
|
+
"noEmit",
|
|
1063
|
+
"importHelpers",
|
|
1064
|
+
"importsNotUsedAsValues",
|
|
1065
|
+
"downlevelIteration",
|
|
1066
|
+
"sourceRoot",
|
|
1067
|
+
"mapRoot",
|
|
1068
|
+
"inlineSources",
|
|
1069
|
+
"emitBOM",
|
|
1070
|
+
"newLine",
|
|
1071
|
+
"stripInternal",
|
|
1072
|
+
"noEmitHelpers",
|
|
1073
|
+
"noEmitOnError",
|
|
1074
|
+
"preserveConstEnums",
|
|
1075
|
+
"declarationDir",
|
|
1076
|
+
"preserveValueImports",
|
|
1077
|
+
/* Interop Constraints */
|
|
1078
|
+
"isolatedModules",
|
|
1079
|
+
"verbatimModuleSyntax",
|
|
1080
|
+
"allowSyntheticDefaultImports",
|
|
1081
|
+
"esModuleInterop",
|
|
1082
|
+
"preserveSymlinks",
|
|
1083
|
+
"forceConsistentCasingInFileNames",
|
|
1084
|
+
/* Type Checking */
|
|
1085
|
+
"strict",
|
|
1086
|
+
"strictBindCallApply",
|
|
1087
|
+
"strictFunctionTypes",
|
|
1088
|
+
"strictNullChecks",
|
|
1089
|
+
"strictPropertyInitialization",
|
|
1090
|
+
"allowUnreachableCode",
|
|
1091
|
+
"allowUnusedLabels",
|
|
1092
|
+
"alwaysStrict",
|
|
1093
|
+
"exactOptionalPropertyTypes",
|
|
1094
|
+
"noFallthroughCasesInSwitch",
|
|
1095
|
+
"noImplicitAny",
|
|
1096
|
+
"noImplicitOverride",
|
|
1097
|
+
"noImplicitReturns",
|
|
1098
|
+
"noImplicitThis",
|
|
1099
|
+
"noPropertyAccessFromIndexSignature",
|
|
1100
|
+
"noUncheckedIndexedAccess",
|
|
1101
|
+
"noUnusedLocals",
|
|
1102
|
+
"noUnusedParameters",
|
|
1103
|
+
"useUnknownInCatchVariables",
|
|
1104
|
+
/* Completeness */
|
|
1105
|
+
"skipDefaultLibCheck",
|
|
1106
|
+
"skipLibCheck"
|
|
1107
|
+
],
|
|
1108
|
+
pathPattern: "^compilerOptions$"
|
|
1109
|
+
}
|
|
1110
|
+
]
|
|
1111
|
+
}
|
|
1112
|
+
}
|
|
1113
|
+
]);
|
|
1114
|
+
|
|
1115
|
+
// src/configs/jsonc.ts
|
|
1116
|
+
var import_eslint_define_config13 = require("eslint-define-config");
|
|
1117
|
+
var jsonc = (0, import_eslint_define_config13.defineFlatConfig)([
|
|
1118
|
+
{
|
|
1119
|
+
files: [GLOB_JSON, GLOB_JSON5, GLOB_JSONC, "**/*rc"],
|
|
1120
|
+
plugins: {
|
|
1121
|
+
jsonc: import_eslint_plugin_jsonc.default
|
|
1122
|
+
},
|
|
1123
|
+
languageOptions: {
|
|
1124
|
+
parser: parserJsonc
|
|
1125
|
+
},
|
|
1126
|
+
rules: {
|
|
1127
|
+
...import_eslint_plugin_jsonc.default.configs["recommended-with-jsonc"].rules,
|
|
1128
|
+
"jsonc/array-bracket-spacing": ["error", "never"],
|
|
1129
|
+
"jsonc/comma-dangle": ["error", "never"],
|
|
1130
|
+
"jsonc/comma-style": ["error", "last"],
|
|
1131
|
+
"jsonc/indent": ["error", 2],
|
|
1132
|
+
"jsonc/key-spacing": [
|
|
1133
|
+
"error",
|
|
1134
|
+
{
|
|
1135
|
+
beforeColon: false,
|
|
1136
|
+
afterColon: true
|
|
1137
|
+
}
|
|
1138
|
+
],
|
|
1139
|
+
"jsonc/no-octal-escape": "error",
|
|
1140
|
+
"jsonc/object-curly-newline": [
|
|
1141
|
+
"error",
|
|
1142
|
+
{
|
|
1143
|
+
multiline: true,
|
|
1144
|
+
consistent: true
|
|
1145
|
+
}
|
|
1146
|
+
],
|
|
1147
|
+
"jsonc/object-curly-spacing": ["error", "always"],
|
|
1148
|
+
"jsonc/object-property-newline": [
|
|
1149
|
+
"error",
|
|
1150
|
+
{
|
|
1151
|
+
allowMultiplePropertiesPerLine: true
|
|
1152
|
+
}
|
|
1153
|
+
]
|
|
1154
|
+
}
|
|
1155
|
+
}
|
|
1156
|
+
]);
|
|
1157
|
+
|
|
1158
|
+
// src/configs/markdown.ts
|
|
1159
|
+
var import_eslint_define_config14 = require("eslint-define-config");
|
|
1160
|
+
var markdown = (0, import_eslint_define_config14.defineFlatConfig)([
|
|
1161
|
+
...import_eslint_plugin_markdown.default.configs.recommended,
|
|
1162
|
+
{
|
|
1163
|
+
files: [`${GLOB_MARKDOWN}/${GLOB_SRC}`, `${GLOB_MARKDOWN}/${GLOB_VUE}`],
|
|
1164
|
+
rules: {
|
|
1165
|
+
"no-undef": "off",
|
|
1166
|
+
"no-alert": "off",
|
|
1167
|
+
"no-console": "off",
|
|
1168
|
+
"no-unused-vars": "off",
|
|
1169
|
+
"no-unused-expressions": "off",
|
|
1170
|
+
"no-restricted-imports": "off",
|
|
1171
|
+
"node/prefer-global/buffer": "off",
|
|
1172
|
+
"node/prefer-global/process": "off",
|
|
1173
|
+
"import/no-unresolved": "off",
|
|
1174
|
+
"unused-imports/no-unused-imports": "off",
|
|
1175
|
+
"unused-imports/no-unused-vars": "off",
|
|
1176
|
+
"@typescript-eslint/comma-dangle": "off",
|
|
1177
|
+
"@typescript-eslint/no-redeclare": "off",
|
|
1178
|
+
"@typescript-eslint/no-namespace": "off",
|
|
1179
|
+
"@typescript-eslint/no-unused-vars": "off",
|
|
1180
|
+
"@typescript-eslint/no-var-requires": "off",
|
|
1181
|
+
"@typescript-eslint/no-extraneous-class": "off",
|
|
1182
|
+
"@typescript-eslint/no-use-before-define": "off"
|
|
1183
|
+
}
|
|
1184
|
+
}
|
|
1185
|
+
]);
|
|
1186
|
+
|
|
1187
|
+
// src/configs/vue.ts
|
|
1188
|
+
var import_node_process = __toESM(require("process"), 1);
|
|
1189
|
+
var import_local_pkg2 = require("local-pkg");
|
|
1190
|
+
var import_eslint_define_config15 = require("eslint-define-config");
|
|
1191
|
+
function getVueVersion() {
|
|
1192
|
+
const pkg = (0, import_local_pkg2.getPackageInfoSync)("vue", { paths: [import_node_process.default.cwd()] });
|
|
1193
|
+
if (pkg && typeof pkg.version === "string" && !Number.isNaN(+pkg.version[0])) {
|
|
1194
|
+
return +pkg.version[0];
|
|
1195
|
+
}
|
|
1196
|
+
return 3;
|
|
1197
|
+
}
|
|
1198
|
+
var isVue3 = getVueVersion() === 3;
|
|
1199
|
+
var vue2Rules = {
|
|
1200
|
+
...import_eslint_plugin_vue.default.configs.base.rules,
|
|
1201
|
+
...import_eslint_plugin_vue.default.configs.essential.rules,
|
|
1202
|
+
...import_eslint_plugin_vue.default.configs["strongly-recommended"].rules,
|
|
1203
|
+
...import_eslint_plugin_vue.default.configs.recommended.rules
|
|
1204
|
+
};
|
|
1205
|
+
var vue3Rules = {
|
|
1206
|
+
...import_eslint_plugin_vue.default.configs.base.rules,
|
|
1207
|
+
...import_eslint_plugin_vue.default.configs["vue3-essential"].rules,
|
|
1208
|
+
...import_eslint_plugin_vue.default.configs["vue3-strongly-recommended"].rules,
|
|
1209
|
+
...import_eslint_plugin_vue.default.configs["vue3-recommended"].rules
|
|
1210
|
+
};
|
|
1211
|
+
var vue = (0, import_eslint_define_config15.defineFlatConfig)([
|
|
1212
|
+
...import_typescript_eslint.default.config({
|
|
1213
|
+
files: [GLOB_VUE],
|
|
1214
|
+
extends: typescriptCore
|
|
1215
|
+
}),
|
|
1216
|
+
{
|
|
1217
|
+
files: [GLOB_VUE],
|
|
1218
|
+
plugins: {
|
|
1219
|
+
vue: import_eslint_plugin_vue.default,
|
|
1220
|
+
"@typescript-eslint": import_typescript_eslint.default.plugin
|
|
1221
|
+
},
|
|
1222
|
+
languageOptions: {
|
|
1223
|
+
parser: parserVue,
|
|
1224
|
+
parserOptions: {
|
|
1225
|
+
parser: "@typescript-eslint/parser",
|
|
1226
|
+
sourceType: "module",
|
|
1227
|
+
extraFileExtensions: [".vue"],
|
|
1228
|
+
ecmaFeatures: {
|
|
1229
|
+
jsx: true
|
|
1230
|
+
}
|
|
1231
|
+
}
|
|
1232
|
+
},
|
|
1233
|
+
processor: import_eslint_plugin_vue.default.processors[".vue"],
|
|
1234
|
+
rules: {
|
|
1235
|
+
...isVue3 ? vue3Rules : vue2Rules,
|
|
1236
|
+
// OFF
|
|
1237
|
+
"vue/no-v-html": "off",
|
|
1238
|
+
"vue/require-prop-types": "off",
|
|
1239
|
+
"vue/require-default-prop": "off",
|
|
1240
|
+
"vue/multi-word-component-names": "off",
|
|
1241
|
+
"vue/no-setup-props-reactivity-loss": "off",
|
|
1242
|
+
"vue/html-self-closing": [
|
|
1243
|
+
"error",
|
|
1244
|
+
{
|
|
1245
|
+
html: {
|
|
1246
|
+
void: "always",
|
|
1247
|
+
normal: "always",
|
|
1248
|
+
component: "always"
|
|
1249
|
+
},
|
|
1250
|
+
svg: "always",
|
|
1251
|
+
math: "always"
|
|
1252
|
+
}
|
|
1253
|
+
],
|
|
1254
|
+
"vue/block-tag-newline": [
|
|
1255
|
+
"error",
|
|
1256
|
+
{
|
|
1257
|
+
singleline: "always",
|
|
1258
|
+
multiline: "always"
|
|
1259
|
+
}
|
|
1260
|
+
],
|
|
1261
|
+
"vue/component-name-in-template-casing": [
|
|
1262
|
+
"error",
|
|
1263
|
+
"PascalCase",
|
|
1264
|
+
{
|
|
1265
|
+
// Force auto-import components to be PascalCase
|
|
1266
|
+
registeredComponentsOnly: false,
|
|
1267
|
+
ignores: ["slot", "component"]
|
|
1268
|
+
}
|
|
1269
|
+
],
|
|
1270
|
+
"vue/component-options-name-casing": ["error", "PascalCase"],
|
|
1271
|
+
"vue/custom-event-name-casing": ["error", "camelCase"],
|
|
1272
|
+
"vue/define-macros-order": [
|
|
1273
|
+
"error",
|
|
1274
|
+
{
|
|
1275
|
+
order: ["defineProps", "defineEmits", "defineOptions", "defineSlots"]
|
|
1276
|
+
}
|
|
1277
|
+
],
|
|
1278
|
+
"vue/html-comment-content-spacing": [
|
|
1279
|
+
"error",
|
|
1280
|
+
"always",
|
|
1281
|
+
{
|
|
1282
|
+
exceptions: ["-"]
|
|
1283
|
+
}
|
|
1284
|
+
],
|
|
1285
|
+
"vue/array-bracket-spacing": ["error", "never"],
|
|
1286
|
+
"vue/arrow-spacing": ["error", { before: true, after: true }],
|
|
1287
|
+
"vue/block-spacing": ["error", "always"],
|
|
1288
|
+
"vue/brace-style": ["error", "stroustrup", { allowSingleLine: true }],
|
|
1289
|
+
"vue/comma-dangle": ["error", "always-multiline"],
|
|
1290
|
+
"vue/comma-spacing": ["error", { before: false, after: true }],
|
|
1291
|
+
"vue/comma-style": ["error", "last"],
|
|
1292
|
+
"vue/dot-location": ["error", "property"],
|
|
1293
|
+
"vue/dot-notation": ["error", { allowKeywords: true }],
|
|
1294
|
+
"vue/eqeqeq": ["error", "smart"],
|
|
1295
|
+
"vue/key-spacing": ["error", { beforeColon: false, afterColon: true }],
|
|
1296
|
+
"vue/keyword-spacing": ["error", { before: true, after: true }],
|
|
1297
|
+
"vue/no-empty-pattern": "error",
|
|
1298
|
+
"vue/no-loss-of-precision": "error",
|
|
1299
|
+
"vue/no-irregular-whitespace": "error",
|
|
1300
|
+
"vue/no-use-v-else-with-v-for": "error",
|
|
1301
|
+
"vue/require-typed-object-prop": "error",
|
|
1302
|
+
"vue/no-extra-parens": ["error", "functions"],
|
|
1303
|
+
"vue/no-restricted-syntax": [
|
|
1304
|
+
"error",
|
|
1305
|
+
"DebuggerStatement",
|
|
1306
|
+
"LabeledStatement",
|
|
1307
|
+
"WithStatement"
|
|
1308
|
+
],
|
|
1309
|
+
"vue/no-sparse-arrays": "error",
|
|
1310
|
+
"vue/no-deprecated-model-definition": [
|
|
1311
|
+
"error",
|
|
1312
|
+
{
|
|
1313
|
+
allowVue3Compat: true
|
|
1314
|
+
}
|
|
1315
|
+
],
|
|
1316
|
+
"vue/object-curly-newline": [
|
|
1317
|
+
"error",
|
|
1318
|
+
{
|
|
1319
|
+
multiline: true,
|
|
1320
|
+
consistent: true
|
|
1321
|
+
}
|
|
1322
|
+
],
|
|
1323
|
+
"vue/no-static-inline-styles": [
|
|
1324
|
+
"error",
|
|
1325
|
+
{
|
|
1326
|
+
allowBinding: true
|
|
1327
|
+
}
|
|
1328
|
+
],
|
|
1329
|
+
"vue/object-curly-spacing": ["error", "always"],
|
|
1330
|
+
"vue/object-property-newline": [
|
|
1331
|
+
"error",
|
|
1332
|
+
{
|
|
1333
|
+
allowMultiplePropertiesPerLine: true
|
|
1334
|
+
}
|
|
1335
|
+
],
|
|
1336
|
+
"vue/object-shorthand": [
|
|
1337
|
+
"error",
|
|
1338
|
+
"always",
|
|
1339
|
+
{
|
|
1340
|
+
ignoreConstructors: false,
|
|
1341
|
+
avoidQuotes: true
|
|
1342
|
+
}
|
|
1343
|
+
],
|
|
1344
|
+
"vue/operator-linebreak": ["error", "before"],
|
|
1345
|
+
"vue/prefer-template": "error",
|
|
1346
|
+
"vue/prop-name-casing": ["error", "camelCase"],
|
|
1347
|
+
"vue/quote-props": ["error", "consistent-as-needed"],
|
|
1348
|
+
"vue/space-in-parens": ["error", "never"],
|
|
1349
|
+
"vue/space-infix-ops": "error",
|
|
1350
|
+
"vue/space-unary-ops": [
|
|
1351
|
+
"error",
|
|
1352
|
+
{
|
|
1353
|
+
words: true,
|
|
1354
|
+
nonwords: false
|
|
1355
|
+
}
|
|
1356
|
+
],
|
|
1357
|
+
"vue/template-curly-spacing": "error",
|
|
1358
|
+
"vue/block-order": [
|
|
1359
|
+
"error",
|
|
1360
|
+
{
|
|
1361
|
+
order: ["script", "template", "style"]
|
|
1362
|
+
}
|
|
1363
|
+
],
|
|
1364
|
+
"vue/attributes-order": [
|
|
1365
|
+
"error",
|
|
1366
|
+
{
|
|
1367
|
+
order: [
|
|
1368
|
+
"EVENTS",
|
|
1369
|
+
// `@click="functionCall"`, `v-on="event"`
|
|
1370
|
+
"TWO_WAY_BINDING",
|
|
1371
|
+
// `v-model`
|
|
1372
|
+
"OTHER_DIRECTIVES",
|
|
1373
|
+
// `v-custom-directive`
|
|
1374
|
+
"LIST_RENDERING",
|
|
1375
|
+
// `v-for item in items`
|
|
1376
|
+
"CONDITIONALS",
|
|
1377
|
+
// `v-if`, `v-show`, `v-cloak`
|
|
1378
|
+
"CONTENT",
|
|
1379
|
+
// `v-text`, `v-html`
|
|
1380
|
+
"SLOT",
|
|
1381
|
+
// `v-slot`, `slot`
|
|
1382
|
+
"UNIQUE",
|
|
1383
|
+
// `ref`, `key`
|
|
1384
|
+
"DEFINITION",
|
|
1385
|
+
// `is`, `v-is`
|
|
1386
|
+
"ATTR_DYNAMIC",
|
|
1387
|
+
// `v-bind:prop="foo"`, `:prop="foo"`
|
|
1388
|
+
// `OTHER_ATTR`, // `custom-prop="foo"`, `:prop="foo"`, `disabled`
|
|
1389
|
+
"RENDER_MODIFIERS",
|
|
1390
|
+
// `v-once`, `v-pre`
|
|
1391
|
+
"GLOBAL",
|
|
1392
|
+
// `id`
|
|
1393
|
+
"ATTR_STATIC",
|
|
1394
|
+
// `prop="foo", `static attributes
|
|
1395
|
+
"ATTR_SHORTHAND_BOOL"
|
|
1396
|
+
// `disabled`, prop shorthand
|
|
1397
|
+
],
|
|
1398
|
+
alphabetical: false
|
|
1399
|
+
}
|
|
1400
|
+
],
|
|
1401
|
+
"vue/order-in-components": [
|
|
1402
|
+
"error",
|
|
1403
|
+
{
|
|
1404
|
+
order: [
|
|
1405
|
+
"el",
|
|
1406
|
+
"name",
|
|
1407
|
+
"key",
|
|
1408
|
+
"parent",
|
|
1409
|
+
"functional",
|
|
1410
|
+
["provide", "inject"],
|
|
1411
|
+
["delimiters", "comments"],
|
|
1412
|
+
["components", "directives", "filters"],
|
|
1413
|
+
"extends",
|
|
1414
|
+
"mixins",
|
|
1415
|
+
"layout",
|
|
1416
|
+
"middleware",
|
|
1417
|
+
"validate",
|
|
1418
|
+
"scrollToTop",
|
|
1419
|
+
"transition",
|
|
1420
|
+
"loading",
|
|
1421
|
+
"inheritAttrs",
|
|
1422
|
+
"model",
|
|
1423
|
+
["props", "propsData"],
|
|
1424
|
+
"emits",
|
|
1425
|
+
"setup",
|
|
1426
|
+
"asyncData",
|
|
1427
|
+
"computed",
|
|
1428
|
+
"data",
|
|
1429
|
+
"fetch",
|
|
1430
|
+
"head",
|
|
1431
|
+
"methods",
|
|
1432
|
+
["template", "render"],
|
|
1433
|
+
"watch",
|
|
1434
|
+
"watchQuery",
|
|
1435
|
+
"LIFECYCLE_HOOKS",
|
|
1436
|
+
"renderError",
|
|
1437
|
+
"ROUTER_GUARDS"
|
|
1438
|
+
]
|
|
1439
|
+
}
|
|
1440
|
+
],
|
|
1441
|
+
"vue/max-attributes-per-line": [
|
|
1442
|
+
"error",
|
|
1443
|
+
{
|
|
1444
|
+
singleline: 1,
|
|
1445
|
+
multiline: 1
|
|
1446
|
+
}
|
|
1447
|
+
]
|
|
1448
|
+
}
|
|
1449
|
+
}
|
|
1450
|
+
]);
|
|
1451
|
+
|
|
1452
|
+
// src/presets.ts
|
|
1453
|
+
var presetJavaScript = [
|
|
1454
|
+
...ignores,
|
|
1455
|
+
...jsdoc,
|
|
1456
|
+
...jsx,
|
|
1457
|
+
...node,
|
|
1458
|
+
...imports,
|
|
1459
|
+
...unicorn,
|
|
1460
|
+
...comments,
|
|
1461
|
+
...javascript
|
|
1462
|
+
];
|
|
1463
|
+
var presetBasic = [...presetJavaScript, ...typescript];
|
|
1464
|
+
var presetJsonc = [...jsonc, ...sortPackageJson, ...sortTsConfig];
|
|
1465
|
+
var presetLanguageExtensions = [...presetJsonc, ...yml, ...markdown];
|
|
1466
|
+
var presetCommon = [...presetBasic, ...presetLanguageExtensions, ...prettier];
|
|
1467
|
+
var presetAll = [...presetCommon, ...vue, ...unocss];
|
|
1468
|
+
function ntnyq(config = [], {
|
|
1469
|
+
vue: enableVue = hasVue,
|
|
1470
|
+
unocss: enableUnoCSS = hasUnoCSS,
|
|
1471
|
+
prettier: enablePrettier = true,
|
|
1472
|
+
markdown: enableMarkdown = true
|
|
1473
|
+
} = {}) {
|
|
1474
|
+
const configs = (0, import_eslint_define_config16.defineFlatConfig)([...presetBasic, ...yml, ...presetJsonc]);
|
|
1475
|
+
if (enableVue) {
|
|
1476
|
+
configs.push(...vue);
|
|
1477
|
+
}
|
|
1478
|
+
if (enableUnoCSS) {
|
|
1479
|
+
configs.push(...unocss);
|
|
1480
|
+
}
|
|
1481
|
+
if (enablePrettier) {
|
|
1482
|
+
configs.push(...prettier);
|
|
1483
|
+
}
|
|
1484
|
+
if (enableMarkdown) {
|
|
1485
|
+
configs.push(...markdown);
|
|
1486
|
+
}
|
|
1487
|
+
if (Object.keys(config).length > 0) {
|
|
1488
|
+
configs.push(...Array.isArray(config) ? config : [config]);
|
|
1489
|
+
}
|
|
1490
|
+
return configs;
|
|
1491
|
+
}
|
|
1492
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
1493
|
+
0 && (module.exports = {
|
|
1494
|
+
GLOB_ALL_SRC,
|
|
1495
|
+
GLOB_CSS,
|
|
1496
|
+
GLOB_DIST,
|
|
1497
|
+
GLOB_EXCLUDE,
|
|
1498
|
+
GLOB_HTML,
|
|
1499
|
+
GLOB_JS,
|
|
1500
|
+
GLOB_JSON,
|
|
1501
|
+
GLOB_JSON5,
|
|
1502
|
+
GLOB_JSONC,
|
|
1503
|
+
GLOB_JSX,
|
|
1504
|
+
GLOB_LESS,
|
|
1505
|
+
GLOB_LOCKFILE,
|
|
1506
|
+
GLOB_MARKDOWN,
|
|
1507
|
+
GLOB_NODE_MODULES,
|
|
1508
|
+
GLOB_SCSS,
|
|
1509
|
+
GLOB_SRC,
|
|
1510
|
+
GLOB_SRC_EXT,
|
|
1511
|
+
GLOB_STYLE,
|
|
1512
|
+
GLOB_TS,
|
|
1513
|
+
GLOB_TSX,
|
|
1514
|
+
GLOB_VUE,
|
|
1515
|
+
GLOB_YAML,
|
|
1516
|
+
comments,
|
|
1517
|
+
getVueVersion,
|
|
1518
|
+
hasTypeScript,
|
|
1519
|
+
hasUnoCSS,
|
|
1520
|
+
hasVue,
|
|
1521
|
+
ignores,
|
|
1522
|
+
imports,
|
|
1523
|
+
interopDefault,
|
|
1524
|
+
javascript,
|
|
1525
|
+
jsdoc,
|
|
1526
|
+
jsonc,
|
|
1527
|
+
jsx,
|
|
1528
|
+
markdown,
|
|
1529
|
+
node,
|
|
1530
|
+
ntnyq,
|
|
1531
|
+
parserJsonc,
|
|
1532
|
+
parserVue,
|
|
1533
|
+
parserYaml,
|
|
1534
|
+
pluginComments,
|
|
1535
|
+
pluginImport,
|
|
1536
|
+
pluginJsdoc,
|
|
1537
|
+
pluginJsonc,
|
|
1538
|
+
pluginMarkdown,
|
|
1539
|
+
pluginNode,
|
|
1540
|
+
pluginPrettier,
|
|
1541
|
+
pluginUnicorn,
|
|
1542
|
+
pluginUnoCSS,
|
|
1543
|
+
pluginVue,
|
|
1544
|
+
pluginYaml,
|
|
1545
|
+
presetAll,
|
|
1546
|
+
presetBasic,
|
|
1547
|
+
presetCommon,
|
|
1548
|
+
presetJavaScript,
|
|
1549
|
+
presetJsonc,
|
|
1550
|
+
presetLanguageExtensions,
|
|
1551
|
+
prettier,
|
|
1552
|
+
sortPackageJson,
|
|
1553
|
+
sortTsConfig,
|
|
1554
|
+
tseslint,
|
|
1555
|
+
typescript,
|
|
1556
|
+
typescriptCore,
|
|
1557
|
+
unicorn,
|
|
1558
|
+
unocss,
|
|
1559
|
+
vue,
|
|
1560
|
+
yml
|
|
1561
|
+
});
|