@ntnyq/eslint-config 2.0.0-beta.17 → 2.0.0-beta.19

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
@@ -56,27 +56,41 @@ __export(src_exports, {
56
56
  all: () => all,
57
57
  astro: () => astro,
58
58
  basic: () => basic,
59
- eslintComments: () => eslintComments,
59
+ comments: () => comments,
60
+ common: () => common,
60
61
  getVueVersion: () => getVueVersion,
62
+ ignores: () => ignores,
61
63
  imports: () => imports,
62
- js: () => js,
64
+ javascript: () => javascript,
65
+ jsonOrder: () => jsonOrder,
63
66
  jsonc: () => jsonc,
64
67
  jsx: () => jsx,
65
68
  markdown: () => markdown,
66
69
  ntnyq: () => ntnyq,
67
- pkgOrder: () => pkgOrder,
70
+ parserAstro: () => parserAstro,
71
+ parserJsonc: () => parserJsonc,
72
+ parserTypescript: () => parserTypescript,
73
+ parserVue: () => parserVue,
74
+ parserYml: () => parserYml,
75
+ pluginAstro: () => pluginAstro,
76
+ pluginComments: () => pluginComments,
77
+ pluginImport: () => pluginImport,
78
+ pluginJsonc: () => pluginJsonc,
79
+ pluginMarkdown: () => pluginMarkdown,
80
+ pluginPrettier: () => pluginPrettier,
81
+ pluginReact: () => pluginReact,
82
+ pluginReactHooks: () => pluginReactHooks,
83
+ pluginTypescript: () => pluginTypescript,
84
+ pluginUnicorn: () => pluginUnicorn,
85
+ pluginUnoCSS: () => pluginUnoCSS,
86
+ pluginVue: () => pluginVue,
87
+ pluginYml: () => pluginYml,
68
88
  prettier: () => prettier,
69
89
  react: () => react,
70
- reactHooksPlugin: () => import_eslint_plugin_react_hooks.default,
71
- reactPlugin: () => import_eslint_plugin_react.default,
72
- ts: () => ts,
73
- tsParser: () => tsParser,
74
- tsPlugin: () => import_eslint_plugin.default,
90
+ typescript: () => typescript,
75
91
  unicorn: () => unicorn,
76
92
  unocss: () => unocss,
77
93
  vue: () => vue,
78
- vueParser: () => import_vue_eslint_parser.default,
79
- vuePlugin: () => import_eslint_plugin_vue.default,
80
94
  yml: () => yml
81
95
  });
82
96
  module.exports = __toCommonJS(src_exports);
@@ -112,7 +126,12 @@ var GLOB_ALL_SRC = [
112
126
  ];
113
127
  var GLOB_NODE_MODULES = "**/node_modules/**";
114
128
  var GLOB_DIST = "**/dist/**";
115
- var GLOB_LOCKFILE = ["**/package-lock.json", "**/yarn.lock", "**/pnpm-lock.yaml"];
129
+ var GLOB_LOCKFILE = [
130
+ "**/package-lock.json",
131
+ "**/yarn.lock",
132
+ "**/pnpm-lock.yaml",
133
+ "**/bun.lockb"
134
+ ];
116
135
  var GLOB_EXCLUDE = [
117
136
  GLOB_NODE_MODULES,
118
137
  GLOB_DIST,
@@ -136,436 +155,417 @@ var GLOB_EXCLUDE = [
136
155
  "**/.yarnrc"
137
156
  ];
138
157
 
139
- // src/configs/js.ts
140
- var import_globals = __toESM(require("globals"), 1);
141
- var import_js = __toESM(require("@eslint/js"), 1);
142
- var import_eslint_plugin_import = __toESM(require("eslint-plugin-import"), 1);
143
- var import_eslint_plugin_unicorn = __toESM(require("eslint-plugin-unicorn"), 1);
144
- var js = [
145
- import_js.default.configs.recommended,
158
+ // src/configs/vue.ts
159
+ var import_local_pkg = require("local-pkg");
160
+
161
+ // src/parsers.ts
162
+ var parserYml = __toESM(require("yaml-eslint-parser"), 1);
163
+ var parserVue = __toESM(require("vue-eslint-parser"), 1);
164
+ var parserJsonc = __toESM(require("jsonc-eslint-parser"), 1);
165
+ var parserAstro = __toESM(require("astro-eslint-parser"), 1);
166
+ var parserTypescript = __toESM(require("@typescript-eslint/parser"), 1);
167
+
168
+ // src/plugins.ts
169
+ var _pluginVue = __toESM(require("eslint-plugin-vue"), 1);
170
+ var _pluginReact = __toESM(require("eslint-plugin-react"), 1);
171
+ var _pluginUnoCSS = __toESM(require("@unocss/eslint-plugin"), 1);
172
+ var _pluginUnicorn = __toESM(require("eslint-plugin-unicorn"), 1);
173
+ var _pluginPrettier = __toESM(require("eslint-plugin-prettier"), 1);
174
+ var _pluginMarkdown = __toESM(require("eslint-plugin-markdown"), 1);
175
+ var _pluginReactHooks = __toESM(require("eslint-plugin-react-hooks"), 1);
176
+ var _pluginComments = __toESM(require("eslint-plugin-eslint-comments"), 1);
177
+ var _pluginTypeScript = __toESM(require("@typescript-eslint/eslint-plugin"), 1);
178
+ var pluginYml = __toESM(require("eslint-plugin-yml"), 1);
179
+ var pluginAstro = __toESM(require("eslint-plugin-astro"), 1);
180
+ var pluginJsonc = __toESM(require("eslint-plugin-jsonc"), 1);
181
+ var pluginImport = __toESM(require("eslint-plugin-import"), 1);
182
+ function interopDefault(mod) {
183
+ return mod.default || mod;
184
+ }
185
+ var pluginVue = interopDefault(_pluginVue);
186
+ var pluginReact = interopDefault(_pluginReact);
187
+ var pluginUnoCSS = interopDefault(_pluginUnoCSS);
188
+ var pluginUnicorn = interopDefault(_pluginUnicorn);
189
+ var pluginPrettier = interopDefault(_pluginPrettier);
190
+ var pluginMarkdown = interopDefault(_pluginMarkdown);
191
+ var pluginComments = interopDefault(_pluginComments);
192
+ var pluginReactHooks = interopDefault(_pluginReactHooks);
193
+ var pluginTypescript = interopDefault(_pluginTypeScript);
194
+
195
+ // src/configs/typescript.ts
196
+ var typescript = [
146
197
  {
198
+ files: [GLOB_TS, GLOB_TSX],
147
199
  languageOptions: {
148
- globals: {
149
- ...import_globals.default.browser,
150
- ...import_globals.default.es2021,
151
- ...import_globals.default.node
152
- },
153
- sourceType: "module"
200
+ parser: parserTypescript,
201
+ parserOptions: {
202
+ sourceType: "module"
203
+ }
204
+ },
205
+ plugins: {
206
+ "@typescript-eslint": pluginTypescript
154
207
  },
155
208
  rules: {
156
- // standard v 17.0.0
157
- "accessor-pairs": ["error", { setWithoutGet: true, enforceForClassMembers: true }],
158
- "array-bracket-spacing": ["error", "never"],
159
- "arrow-spacing": ["error", { before: true, after: true }],
160
- "block-spacing": ["error", "always"],
161
- "brace-style": ["error", "1tbs", { allowSingleLine: true }],
162
- camelcase: [
163
- "error",
164
- {
165
- allow: ["^UNSAFE_"],
166
- properties: "never",
167
- ignoreGlobals: true
168
- }
169
- ],
170
- "comma-spacing": ["error", { before: false, after: true }],
171
- "comma-style": ["error", "last"],
172
- "computed-property-spacing": ["error", "never", { enforceForClassMembers: true }],
173
- "constructor-super": "error",
174
- curly: ["error", "multi-line"],
175
- "default-case-last": "error",
176
- "dot-location": ["error", "property"],
177
- "dot-notation": ["error", { allowKeywords: true }],
178
- "eol-last": "error",
179
- "func-call-spacing": ["error", "never"],
180
- indent: [
181
- "error",
182
- 2,
183
- {
184
- SwitchCase: 1,
185
- VariableDeclarator: 1,
186
- outerIIFEBody: 1,
187
- MemberExpression: 1,
188
- FunctionDeclaration: { parameters: 1, body: 1 },
189
- FunctionExpression: { parameters: 1, body: 1 },
190
- CallExpression: { arguments: 1 },
191
- ArrayExpression: 1,
192
- ObjectExpression: 1,
193
- ImportDeclaration: 1,
194
- flatTernaryExpressions: false,
195
- ignoreComments: false,
196
- ignoredNodes: [
197
- "TemplateLiteral *",
198
- "JSXElement",
199
- "JSXElement > *",
200
- "JSXAttribute",
201
- "JSXIdentifier",
202
- "JSXNamespacedName",
203
- "JSXMemberExpression",
204
- "JSXSpreadAttribute",
205
- "JSXExpressionContainer",
206
- "JSXOpeningElement",
207
- "JSXClosingElement",
208
- "JSXFragment",
209
- "JSXOpeningFragment",
210
- "JSXClosingFragment",
211
- "JSXText",
212
- "JSXEmptyExpression",
213
- "JSXSpreadChild"
214
- ],
215
- offsetTernaryExpressions: true
216
- }
217
- ],
218
- "key-spacing": ["error", { beforeColon: false, afterColon: true }],
219
- "keyword-spacing": ["error", { before: true, after: true }],
220
- "lines-between-class-members": ["error", "always", { exceptAfterSingleLine: true }],
221
- "multiline-ternary": ["error", "always-multiline"],
222
- "new-cap": ["error", { newIsCap: true, capIsNew: false, properties: true }],
223
- "new-parens": "error",
224
- "no-array-constructor": "error",
225
- "no-async-promise-executor": "error",
226
- "no-caller": "error",
227
- "no-class-assign": "error",
228
- "no-compare-neg-zero": "error",
229
- "no-cond-assign": "error",
230
- "no-const-assign": "error",
231
- "no-constant-condition": ["error", { checkLoops: false }],
232
- "no-control-regex": "error",
233
- "no-debugger": "error",
234
- "no-delete-var": "error",
235
- "no-dupe-args": "error",
236
- "no-dupe-class-members": "error",
237
- "no-dupe-keys": "error",
238
- "no-duplicate-case": "error",
239
- "no-useless-backreference": "error",
240
- "no-empty": ["error", { allowEmptyCatch: true }],
241
- "no-empty-character-class": "error",
242
- "no-empty-pattern": "error",
243
- "no-eval": "error",
244
- "no-ex-assign": "error",
245
- "no-extend-native": "error",
246
- "no-extra-bind": "error",
247
- "no-extra-boolean-cast": "error",
248
- "no-extra-parens": ["error", "functions"],
249
- "no-fallthrough": "error",
250
- "no-floating-decimal": "error",
251
- "no-func-assign": "error",
252
- "no-global-assign": "error",
253
- "no-implied-eval": "error",
254
- "no-import-assign": "error",
255
- "no-invalid-regexp": "error",
256
- "no-irregular-whitespace": "error",
257
- "no-iterator": "error",
258
- "no-labels": ["error", { allowLoop: false, allowSwitch: false }],
259
- "no-lone-blocks": "error",
260
- "no-loss-of-precision": "error",
261
- "no-misleading-character-class": "error",
262
- "no-prototype-builtins": "error",
263
- "no-useless-catch": "error",
264
- "no-mixed-operators": [
209
+ ...pluginTypescript.configs.recommended.rules,
210
+ ...pluginTypescript.configs.stylistic.rules,
211
+ "@typescript-eslint/no-unused-vars": "error",
212
+ "@typescript-eslint/no-redeclare": "error",
213
+ "@typescript-eslint/consistent-type-imports": [
265
214
  "error",
266
215
  {
267
- groups: [
268
- ["==", "!=", "===", "!==", ">", ">=", "<", "<="],
269
- ["&&", "||"],
270
- ["in", "instanceof"]
271
- ],
272
- allowSamePrecedence: true
216
+ prefer: "type-imports",
217
+ fixStyle: "separate-type-imports",
218
+ disallowTypeAnnotations: false
273
219
  }
274
220
  ],
275
- "no-mixed-spaces-and-tabs": "error",
276
- "no-multiple-empty-lines": ["error", { max: 1, maxBOF: 0, maxEOF: 0 }],
277
- "no-new": "error",
278
- "no-new-func": "error",
279
- "no-new-object": "error",
280
- "no-new-symbol": "error",
281
- "no-new-wrappers": "error",
282
- "no-obj-calls": "error",
283
- "no-octal": "error",
284
- "no-octal-escape": "error",
285
- "no-proto": "error",
286
- "no-redeclare": ["error", { builtinGlobals: false }],
287
- "no-regex-spaces": "error",
288
- "no-self-assign": ["error", { props: true }],
289
- "no-self-compare": "error",
290
- "no-sequences": "error",
291
- "no-shadow-restricted-names": "error",
292
- "no-sparse-arrays": "error",
293
- "no-tabs": "error",
294
- "no-template-curly-in-string": "error",
295
- "no-this-before-super": "error",
296
- "no-throw-literal": "error",
297
- "no-trailing-spaces": "error",
298
- "no-undef": "error",
299
- "no-undef-init": "error",
300
- "no-unexpected-multiline": "error",
301
- "no-unmodified-loop-condition": "error",
302
- "no-unneeded-ternary": ["error", { defaultAssignment: false }],
303
- "no-unreachable": "error",
304
- "no-unreachable-loop": "error",
305
- "no-unsafe-finally": "error",
306
- "no-unsafe-negation": "error",
307
- "no-unused-expressions": [
221
+ "@typescript-eslint/consistent-type-assertions": [
308
222
  "error",
309
223
  {
310
- allowShortCircuit: true,
311
- allowTernary: true,
312
- allowTaggedTemplates: true
224
+ assertionStyle: "as",
225
+ objectLiteralTypeAssertions: "allow-as-parameter"
313
226
  }
314
227
  ],
315
- "no-unused-vars": [
316
- "error",
317
- {
318
- args: "none",
319
- caughtErrors: "none",
320
- ignoreRestSiblings: true,
321
- vars: "all"
228
+ "@typescript-eslint/prefer-as-const": "warn",
229
+ "@typescript-eslint/ban-types": "off",
230
+ "@typescript-eslint/camelcase": "off",
231
+ "@typescript-eslint/no-namespace": "off",
232
+ "@typescript-eslint/ban-ts-ignore": "off",
233
+ "@typescript-eslint/ban-ts-comment": "off",
234
+ "@typescript-eslint/no-explicit-any": "off",
235
+ "@typescript-eslint/no-empty-function": "off",
236
+ "@typescript-eslint/naming-convention": "off",
237
+ "@typescript-eslint/no-empty-interface": "off",
238
+ "@typescript-eslint/no-non-null-assertion": "off",
239
+ "@typescript-eslint/triple-slash-reference": "off",
240
+ "@typescript-eslint/no-parameter-properties": "off",
241
+ "@typescript-eslint/explicit-member-accessibility": "off",
242
+ "@typescript-eslint/explicit-function-return-type": "off",
243
+ "@typescript-eslint/explicit-module-boundary-types": "off",
244
+ "@typescript-eslint/consistent-indexed-object-style": "off"
245
+ }
246
+ },
247
+ {
248
+ files: ["**/*.d.ts"],
249
+ rules: {
250
+ "import/no-duplicates": "off",
251
+ "import/newline-after-import": "off"
252
+ }
253
+ },
254
+ {
255
+ files: ["**/*.{spec,test}.ts?(x)"],
256
+ rules: {
257
+ "no-unused-expressions": "off",
258
+ "max-lines-per-function": "off"
259
+ }
260
+ },
261
+ {
262
+ files: ["**/*.js", "**/*.cjs"],
263
+ rules: {
264
+ "@typescript-eslint/no-var-requires": "off"
265
+ }
266
+ }
267
+ ];
268
+
269
+ // src/configs/vue.ts
270
+ function getVueVersion() {
271
+ const pkg = (0, import_local_pkg.getPackageInfoSync)("vue", { paths: [process.cwd()] });
272
+ if (pkg && typeof pkg.version === "string" && !Number.isNaN(+pkg.version[0])) {
273
+ return +pkg.version[0];
274
+ }
275
+ return 3;
276
+ }
277
+ var isVue3 = getVueVersion() === 3;
278
+ var vueBaseRules = {};
279
+ var vue2Rules = {
280
+ ...vueBaseRules
281
+ };
282
+ var vue3Rules = {
283
+ ...vueBaseRules
284
+ };
285
+ var vue = [
286
+ {
287
+ files: [GLOB_VUE],
288
+ plugins: {
289
+ vue: pluginVue,
290
+ "@typescript-eslint": pluginTypescript
291
+ },
292
+ languageOptions: {
293
+ parser: parserVue,
294
+ parserOptions: {
295
+ parser: "@typescript-eslint/parser",
296
+ sourceType: "module",
297
+ extraFileExtensions: [".vue"],
298
+ ecmaFeatures: {
299
+ jsx: true
322
300
  }
323
- ],
324
- "no-useless-call": "error",
325
- "no-useless-computed-key": "error",
326
- "no-useless-constructor": "error",
327
- "no-useless-rename": "error",
328
- "no-useless-return": "error",
329
- "no-whitespace-before-property": "error",
330
- "object-curly-newline": ["error", { multiline: true, consistent: true }],
331
- "object-curly-spacing": ["error", "always"],
332
- "object-property-newline": ["error", { allowMultiplePropertiesPerLine: true }],
333
- "padded-blocks": ["error", { blocks: "never", switches: "never", classes: "never" }],
334
- "prefer-promise-reject-errors": "error",
335
- "prefer-regex-literals": ["error", { disallowRedundantWrapping: true }],
336
- "quote-props": ["error", "as-needed"],
337
- "rest-spread-spacing": ["error", "never"],
338
- semi: ["error", "never"],
339
- "semi-spacing": ["error", { before: false, after: true }],
340
- "space-before-blocks": ["error", "always"],
341
- "space-before-function-paren": ["error", "always"],
342
- "space-in-parens": ["error", "never"],
343
- "space-infix-ops": "error",
344
- "space-unary-ops": ["error", { words: true, nonwords: false }],
345
- "symbol-description": "error",
346
- "template-tag-spacing": ["error", "never"],
347
- "unicode-bom": ["error", "never"],
348
- "use-isnan": [
349
- "error",
350
- {
351
- enforceForSwitchCase: true,
352
- enforceForIndexOf: true
353
- }
354
- ],
355
- "valid-typeof": ["error", { requireStringLiterals: true }],
356
- "wrap-iife": ["error", "any", { functionPrototypeMethods: true }],
357
- "yield-star-spacing": ["error", "both"],
358
- yoda: ["error", "never"],
359
- // es6+
360
- "no-var": "error",
361
- "prefer-rest-params": "error",
362
- "prefer-spread": "error",
363
- "prefer-template": "error",
364
- "template-curly-spacing": "error",
365
- "generator-star-spacing": "off",
366
- "no-empty-static-block": "error",
367
- "no-new-native-nonconstructor": "error",
368
- "arrow-parens": [
369
- "error",
370
- "as-needed",
371
- {
372
- requireForBlockBody: false
373
- }
374
- ],
375
- quotes: [
376
- "error",
377
- "single",
378
- {
379
- avoidEscape: true,
380
- allowTemplateLiterals: false
381
- }
382
- ],
383
- "prefer-const": [
384
- "error",
385
- {
386
- destructuring: "all",
387
- ignoreReadBeforeAssign: true
388
- }
389
- ],
390
- "prefer-arrow-callback": [
391
- "error",
392
- {
393
- allowNamedFunctions: false,
394
- allowUnboundThis: true
395
- }
396
- ],
397
- "object-shorthand": [
398
- "error",
399
- "always",
400
- {
401
- ignoreConstructors: false,
402
- avoidQuotes: true
403
- }
404
- ],
405
- "spaced-comment": [
406
- "error",
407
- "always",
408
- {
409
- line: {
410
- markers: ["/"],
411
- exceptions: ["/", "#"]
412
- },
413
- block: {
414
- markers: ["!"],
415
- exceptions: ["*"],
416
- balanced: true
417
- }
418
- }
419
- ],
420
- // best-practice
421
- eqeqeq: ["error", "smart"],
422
- complexity: ["error", { max: 30 }],
423
- "array-callback-return": "error",
424
- "block-scoped-var": "error",
425
- "consistent-return": "off",
426
- "no-alert": "error",
427
- "no-case-declarations": "error",
428
- "no-multi-spaces": "error",
429
- "no-multi-str": "error",
430
- "no-with": "error",
431
- "no-void": "error",
432
- "no-useless-escape": "off",
433
- "vars-on-top": "error",
434
- "require-await": "off",
435
- "no-return-assign": "off",
436
- "one-var": ["error", "never"],
437
- "operator-linebreak": ["error", "before"],
438
- "comma-dangle": ["error", "always-multiline"],
439
- "max-params": ["error", { max: 5 }],
440
- "max-depth": ["error", { max: 5 }],
441
- "max-nested-callbacks": ["error", { max: 10 }],
442
- "max-statements-per-line": ["error", { max: 2 }],
443
- "max-lines": [
444
- "error",
445
- {
446
- max: 1e3,
447
- skipComments: true,
448
- skipBlankLines: true
449
- }
450
- ],
451
- "max-lines-per-function": [
452
- "error",
453
- {
454
- max: 100,
455
- skipComments: true,
456
- skipBlankLines: true
457
- }
458
- ],
459
- "no-use-before-define": [
460
- "error",
461
- {
462
- functions: false,
463
- classes: false,
464
- variables: true
465
- }
466
- ],
467
- "max-len": [
468
- "error",
469
- {
470
- code: 200,
471
- tabWidth: 2,
472
- comments: 200,
473
- ignoreUrls: true,
474
- ignoreStrings: true,
475
- ignoreRegExpLiterals: true,
476
- ignoreTemplateLiterals: true,
477
- ignoreTrailingComments: true
478
- }
479
- ],
480
- "sort-imports": [
481
- "error",
482
- {
483
- ignoreCase: false,
484
- ignoreDeclarationSort: true,
485
- ignoreMemberSort: false,
486
- memberSyntaxSortOrder: ["none", "all", "multiple", "single"],
487
- allowSeparatedGroups: false
488
- }
489
- ]
490
- }
491
- },
492
- {
493
- files: ["**/scripts/*", "**/cli.*"],
301
+ }
302
+ },
303
+ processor: pluginVue.processors[".vue"],
494
304
  rules: {
495
- "no-console": "off"
305
+ ...typescript[0].rules
496
306
  }
497
307
  },
498
308
  {
499
- files: ["**/*.{test,spec}.js?(x)"],
309
+ plugins: {
310
+ vue: pluginVue
311
+ },
312
+ rules: isVue3 ? vue3Rules : vue2Rules
313
+ }
314
+ ];
315
+
316
+ // src/configs/yml.ts
317
+ var yml = [
318
+ {
319
+ files: [GLOB_YAML],
320
+ languageOptions: {
321
+ parser: parserYml
322
+ },
323
+ plugins: {
324
+ yml: pluginYml
325
+ },
500
326
  rules: {
501
- "no-unused-expressions": "off",
502
- "max-lines-per-function": "off"
327
+ ...pluginYml.configs.standard.rules,
328
+ ...pluginYml.configs.prettier.rules,
329
+ "yml/no-empty-mapping-value": "off"
503
330
  }
504
331
  }
505
332
  ];
506
- var jsx = [
333
+
334
+ // src/configs/react.ts
335
+ var react = [
507
336
  {
508
- files: ["**/*.jsx"],
337
+ files: [GLOB_JSX, GLOB_TSX],
338
+ plugins: {
339
+ react: pluginReact,
340
+ "react-hooks": pluginReactHooks
341
+ },
342
+ settings: {
343
+ react: {
344
+ version: "18.0"
345
+ }
346
+ },
509
347
  languageOptions: {
510
348
  parserOptions: {
511
349
  ecmaFeatures: {
512
350
  jsx: true
513
351
  }
514
352
  }
353
+ },
354
+ rules: {
355
+ ...pluginReact.configs.recommended.rules,
356
+ ...pluginReactHooks.configs.recommended.rules,
357
+ "jsx-quotes": ["error", "prefer-double"],
358
+ "react/react-in-jsx-scope": "off"
515
359
  }
516
360
  }
517
361
  ];
518
- var imports = [
362
+
363
+ // src/configs/astro.ts
364
+ var astro = [
519
365
  {
366
+ files: [GLOB_ASTRO],
520
367
  plugins: {
521
- import: import_eslint_plugin_import.default
368
+ astro: pluginAstro
522
369
  },
523
- settings: {
524
- "import/resolver": {
525
- node: { extensions: [".js", ".mjs", ".ts", ".mts", ".d.ts"] }
370
+ languageOptions: {
371
+ parser: parserAstro,
372
+ parserOptions: {
373
+ parser: "@typescript-eslint/parser",
374
+ extraFileExtensions: [".astro"]
526
375
  }
527
376
  },
528
377
  rules: {
529
- "import/no-unresolved": "off",
530
- "import/no-absolute-path": "off",
531
- "import/no-named-as-default-member": "off",
532
- "import/first": "error",
533
- "import/no-duplicates": "error",
534
- "import/no-mutable-exports": "error",
535
- "import/newline-after-import": "error",
536
- "import/order": [
537
- "error",
538
- {
539
- groups: [
540
- "builtin",
541
- "external",
542
- "internal",
543
- "parent",
544
- "sibling",
545
- "index",
546
- "object",
547
- "type"
548
- ],
549
- "newlines-between": "never",
550
- pathGroups: [{ pattern: "@/**", group: "internal" }],
551
- pathGroupsExcludedImportTypes: ["type"]
552
- }
553
- ]
378
+ ...pluginAstro.configs.recommended.rules
554
379
  }
555
380
  }
556
381
  ];
557
- var unicorn = [
382
+
383
+ // src/configs/jsonc.ts
384
+ var jsonc = [
558
385
  {
386
+ files: [GLOB_JSON, GLOB_JSON5, GLOB_JSONC, "**/*rc"],
559
387
  plugins: {
560
- unicorn: import_eslint_plugin_unicorn.default
388
+ jsonc: pluginJsonc
389
+ },
390
+ languageOptions: {
391
+ parser: parserJsonc
561
392
  },
562
393
  rules: {
563
- "unicorn/no-unsafe-regex": "off",
564
- "unicorn/error-message": "error",
565
- "unicorn/escape-case": "error",
566
- "unicorn/no-new-buffer": "error",
567
- "unicorn/number-literal-case": "error",
568
- "unicorn/prefer-includes": "error",
394
+ ...pluginJsonc.configs["recommended-with-jsonc"].rules,
395
+ "jsonc/array-bracket-spacing": ["error", "never"],
396
+ "jsonc/comma-dangle": ["error", "never"],
397
+ "jsonc/comma-style": ["error", "last"],
398
+ "jsonc/indent": ["error", 2],
399
+ "jsonc/key-spacing": [
400
+ "error",
401
+ {
402
+ beforeColon: false,
403
+ afterColon: true
404
+ }
405
+ ],
406
+ "jsonc/no-octal-escape": "error",
407
+ "jsonc/object-curly-newline": [
408
+ "error",
409
+ {
410
+ multiline: true,
411
+ consistent: true
412
+ }
413
+ ],
414
+ "jsonc/object-curly-spacing": ["error", "always"],
415
+ "jsonc/object-property-newline": [
416
+ "error",
417
+ {
418
+ allowMultiplePropertiesPerLine: true
419
+ }
420
+ ]
421
+ }
422
+ }
423
+ ];
424
+ var jsonOrder = [
425
+ {
426
+ files: ["**/package.json"],
427
+ rules: {
428
+ "jsonc/sort-keys": [
429
+ "error",
430
+ {
431
+ pathPattern: "^$",
432
+ order: [
433
+ "publisher",
434
+ "name",
435
+ "displayName",
436
+ "type",
437
+ "version",
438
+ "private",
439
+ "packageManager",
440
+ "description",
441
+ "keywords",
442
+ "license",
443
+ "author",
444
+ "homepage",
445
+ "repository",
446
+ "funding",
447
+ "exports",
448
+ "main",
449
+ "module",
450
+ "unpkg",
451
+ "jsdelivr",
452
+ // workaround for `type: "module"` with TS `moduleResolution: "node16"`
453
+ "types",
454
+ "typesVersions",
455
+ "bin",
456
+ "icon",
457
+ "files",
458
+ "sideEffects",
459
+ "scripts",
460
+ "peerDependencies",
461
+ "peerDependenciesMeta",
462
+ "dependencies",
463
+ "optionalDependencies",
464
+ "devDependencies",
465
+ "activationEvents",
466
+ "contributes",
467
+ "categories",
468
+ "engines",
469
+ "pnpm",
470
+ "overrides",
471
+ "resolutions",
472
+ "husky",
473
+ "prettier",
474
+ "nano-staged",
475
+ "lint-staged",
476
+ "eslintConfig"
477
+ ]
478
+ },
479
+ {
480
+ pathPattern: "^(?:dev|peer|optional|bundled)?[Dd]ependencies$",
481
+ order: { type: "asc" }
482
+ },
483
+ {
484
+ pathPattern: "^exports.*$",
485
+ order: ["types", "import", "require", "default"]
486
+ },
487
+ {
488
+ pathPattern: "^scripts$",
489
+ order: { type: "asc" }
490
+ }
491
+ ],
492
+ "jsonc/sort-array-values": [
493
+ "error",
494
+ {
495
+ pathPattern: "^files$",
496
+ order: { type: "asc" }
497
+ }
498
+ ]
499
+ }
500
+ }
501
+ ];
502
+
503
+ // src/configs/imports.ts
504
+ var imports = [
505
+ {
506
+ plugins: {
507
+ import: pluginImport
508
+ },
509
+ settings: {
510
+ "import/resolver": {
511
+ node: { extensions: [".js", ".mjs", ".ts", ".mts", ".d.ts"] }
512
+ }
513
+ },
514
+ rules: {
515
+ "import/no-unresolved": "off",
516
+ "import/no-absolute-path": "off",
517
+ "import/no-named-as-default-member": "off",
518
+ "import/first": "error",
519
+ "import/no-duplicates": "error",
520
+ "import/no-mutable-exports": "error",
521
+ "import/newline-after-import": "error",
522
+ "import/order": [
523
+ "error",
524
+ {
525
+ groups: [
526
+ "builtin",
527
+ "external",
528
+ "internal",
529
+ "parent",
530
+ "sibling",
531
+ "index",
532
+ "object",
533
+ "type"
534
+ ],
535
+ "newlines-between": "never",
536
+ pathGroups: [{ pattern: "{{@,~}/,#}**", group: "internal" }],
537
+ pathGroupsExcludedImportTypes: ["type"]
538
+ }
539
+ ]
540
+ }
541
+ }
542
+ ];
543
+
544
+ // src/configs/unocss.ts
545
+ var unocss = [
546
+ {
547
+ plugins: {
548
+ "@unocss": pluginUnoCSS
549
+ },
550
+ rules: {
551
+ ...pluginUnoCSS.configs.recommended.rules
552
+ }
553
+ }
554
+ ];
555
+
556
+ // src/configs/unicorn.ts
557
+ var unicorn = [
558
+ {
559
+ plugins: {
560
+ unicorn: pluginUnicorn
561
+ },
562
+ rules: {
563
+ "unicorn/no-unsafe-regex": "off",
564
+ "unicorn/error-message": "error",
565
+ "unicorn/escape-case": "error",
566
+ "unicorn/no-new-buffer": "error",
567
+ "unicorn/number-literal-case": "error",
568
+ "unicorn/prefer-includes": "error",
569
569
  "unicorn/prefer-type-error": "error",
570
570
  "unicorn/throw-new-error": "error",
571
571
  "unicorn/no-unnecessary-await": "error",
@@ -628,466 +628,503 @@ var unicorn = [
628
628
  }
629
629
  ];
630
630
 
631
- // src/configs/ts.ts
632
- var tsParser = __toESM(require("@typescript-eslint/parser"), 1);
633
- var import_eslint_plugin = __toESM(require("@typescript-eslint/eslint-plugin"), 1);
634
- var ts = [
631
+ // src/configs/prettier.ts
632
+ var import_eslint_config_prettier = __toESM(require("eslint-config-prettier"), 1);
633
+ var prettier = [
635
634
  {
636
- files: [GLOB_TS, GLOB_TSX],
637
- languageOptions: {
638
- parser: tsParser,
639
- parserOptions: {
640
- sourceType: "module"
641
- }
642
- },
643
635
  plugins: {
644
- "@typescript-eslint": import_eslint_plugin.default
636
+ prettier: pluginPrettier
645
637
  },
646
638
  rules: {
647
- ...import_eslint_plugin.default.configs.recommended.rules,
648
- ...import_eslint_plugin.default.configs.stylistic.rules,
649
- "@typescript-eslint/no-unused-vars": "error",
650
- "@typescript-eslint/no-redeclare": "error",
651
- "@typescript-eslint/consistent-type-imports": [
652
- "error",
653
- {
654
- prefer: "type-imports",
655
- fixStyle: "separate-type-imports",
656
- disallowTypeAnnotations: false
657
- }
658
- ],
659
- "@typescript-eslint/prefer-as-const": "warn",
660
- "@typescript-eslint/ban-types": "off",
661
- "@typescript-eslint/camelcase": "off",
662
- "@typescript-eslint/no-namespace": "off",
663
- "@typescript-eslint/ban-ts-ignore": "off",
664
- "@typescript-eslint/ban-ts-comment": "off",
665
- "@typescript-eslint/no-explicit-any": "off",
666
- "@typescript-eslint/no-empty-function": "off",
667
- "@typescript-eslint/naming-convention": "off",
668
- "@typescript-eslint/no-empty-interface": "off",
669
- "@typescript-eslint/no-non-null-assertion": "off",
670
- "@typescript-eslint/triple-slash-reference": "off",
671
- "@typescript-eslint/no-parameter-properties": "off",
672
- "@typescript-eslint/explicit-member-accessibility": "off",
673
- "@typescript-eslint/explicit-function-return-type": "off",
674
- "@typescript-eslint/explicit-module-boundary-types": "off",
675
- "@typescript-eslint/consistent-indexed-object-style": "off"
676
- }
677
- },
678
- {
679
- files: ["**/*.d.ts"],
680
- rules: {
681
- "import/no-duplicates": "off",
682
- "import/newline-after-import": "off"
683
- }
684
- },
685
- {
686
- files: ["**/*.{spec,test}.ts?(x)"],
687
- rules: {
688
- "no-unused-expressions": "off",
689
- "max-lines-per-function": "off"
690
- }
691
- },
692
- {
693
- files: ["**/*.js", "**/*.cjs"],
694
- rules: {
695
- "@typescript-eslint/no-var-requires": "off"
639
+ ...import_eslint_config_prettier.default.rules,
640
+ ...pluginPrettier.configs.recommended.rules,
641
+ "prettier/prettier": "warn"
696
642
  }
697
643
  }
698
644
  ];
699
645
 
700
- // src/configs/vue.ts
701
- var import_local_pkg = require("local-pkg");
702
- var import_eslint_plugin_vue = __toESM(require("eslint-plugin-vue"), 1);
703
- var import_vue_eslint_parser = __toESM(require("vue-eslint-parser"), 1);
704
- var import_eslint_plugin2 = __toESM(require("@typescript-eslint/eslint-plugin"), 1);
705
- function getVueVersion() {
706
- const pkg = (0, import_local_pkg.getPackageInfoSync)("vue", { paths: [process.cwd()] });
707
- if (pkg && typeof pkg.version === "string" && !Number.isNaN(+pkg.version[0])) {
708
- return +pkg.version[0];
709
- }
710
- return 3;
711
- }
712
- var isVue3 = getVueVersion() === 3;
713
- var vueBaseRules = {};
714
- var vue2Rules = {
715
- ...vueBaseRules
716
- };
717
- var vue3Rules = {
718
- ...vueBaseRules
719
- };
720
- var vue = [
646
+ // src/configs/markdown.ts
647
+ var markdown = [
721
648
  {
722
- files: [GLOB_VUE],
649
+ files: [GLOB_MARKDOWN],
723
650
  plugins: {
724
- vue: import_eslint_plugin_vue.default,
725
- "@typescript-eslint": import_eslint_plugin2.default
651
+ markdown: pluginMarkdown
726
652
  },
653
+ processor: "markdown/markdown"
654
+ },
655
+ {
656
+ files: [`${GLOB_MARKDOWN}/${GLOB_SRC}`, `${GLOB_MARKDOWN}/${GLOB_VUE}`],
727
657
  languageOptions: {
728
- parser: import_vue_eslint_parser.default,
729
658
  parserOptions: {
730
- parser: "@typescript-eslint/parser",
731
- sourceType: "module",
732
- extraFileExtensions: [".vue"],
733
659
  ecmaFeatures: {
734
- jsx: true
660
+ impliedStrict: true
735
661
  }
736
662
  }
737
663
  },
738
- processor: import_eslint_plugin_vue.default.processors[".vue"],
739
- rules: {
740
- // @ts-expect-error 2339
741
- ...ts[0].rules
742
- }
743
- },
744
- {
745
- plugins: {
746
- vue: import_eslint_plugin_vue.default
747
- },
748
- rules: isVue3 ? vue3Rules : vue2Rules
749
- }
750
- ];
751
-
752
- // src/configs/yml.ts
753
- var import_eslint_plugin_yml = __toESM(require("eslint-plugin-yml"), 1);
754
- var ymlParser = __toESM(require("yaml-eslint-parser"), 1);
755
- var yml = [
756
- {
757
- files: [GLOB_YAML],
758
- languageOptions: {
759
- parser: ymlParser
760
- },
761
664
  plugins: {
762
- yml: import_eslint_plugin_yml.default
665
+ "@typescript-eslint": pluginTypescript
763
666
  },
764
- // @ts-expect-error 2322
765
667
  rules: {
766
- ...import_eslint_plugin_yml.configs.standard.rules,
767
- ...import_eslint_plugin_yml.configs.prettier.rules,
768
- "yml/no-empty-mapping-value": "off"
769
- }
770
- }
771
- ];
772
-
773
- // src/configs/react.ts
774
- var import_eslint_plugin_react = __toESM(require("eslint-plugin-react"), 1);
775
- var import_eslint_plugin_react_hooks = __toESM(require("eslint-plugin-react-hooks"), 1);
776
- var react = [
777
- {
778
- files: [GLOB_JSX, GLOB_TSX],
779
- plugins: {
780
- react: import_eslint_plugin_react.default,
781
- "react-hooks": import_eslint_plugin_react_hooks.default
782
- },
783
- settings: {
784
- react: {
785
- version: "18.0"
786
- }
787
- },
788
- languageOptions: {
789
- parserOptions: {
790
- ecmaFeatures: {
791
- jsx: true
792
- }
793
- }
794
- },
795
- rules: {
796
- ...import_eslint_plugin_react.default.configs.recommended.rules,
797
- ...import_eslint_plugin_react_hooks.default.configs.recommended.rules,
798
- "jsx-quotes": ["error", "prefer-double"],
799
- "react/react-in-jsx-scope": "off"
668
+ ...pluginMarkdown.configs.recommended.overrides[1].rules,
669
+ "no-undef": "off",
670
+ "no-alert": "off",
671
+ "no-console": "off",
672
+ "no-unused-vars": "off",
673
+ "no-unused-expressions": "off",
674
+ "no-restricted-imports": "off",
675
+ "import/no-unresolved": "off",
676
+ "@typescript-eslint/comma-dangle": "off",
677
+ "@typescript-eslint/no-redeclare": "off",
678
+ "@typescript-eslint/no-unused-vars": "off",
679
+ "@typescript-eslint/no-var-requires": "off",
680
+ "@typescript-eslint/no-extraneous-class": "off",
681
+ "@typescript-eslint/no-use-before-define": "off",
682
+ "unused-imports/no-unused-imports": "off",
683
+ "unused-imports/no-unused-vars": "off"
800
684
  }
801
685
  }
802
686
  ];
803
687
 
804
- // src/configs/astro.ts
805
- var import_eslint_plugin_astro = __toESM(require("eslint-plugin-astro"), 1);
806
- var import_astro_eslint_parser = __toESM(require("astro-eslint-parser"), 1);
807
- var astro = [
688
+ // src/configs/comments.ts
689
+ var comments = [
808
690
  {
809
- files: [GLOB_ASTRO],
810
691
  plugins: {
811
- astro: import_eslint_plugin_astro.default
692
+ "eslint-comments": pluginComments
812
693
  },
813
- languageOptions: {
814
- parser: import_astro_eslint_parser.default,
815
- parserOptions: {
816
- parser: "@typescript-eslint/parser",
817
- extraFileExtensions: [".astro"]
818
- }
819
- },
820
- // @ts-expect-error 2322
821
694
  rules: {
822
- ...import_eslint_plugin_astro.configs.recommended.rules
695
+ ...pluginComments.configs.recommended.rules,
696
+ "eslint-comments/disable-enable-pair": ["error", { allowWholeFile: true }]
823
697
  }
824
698
  }
825
699
  ];
826
700
 
827
- // src/configs/jsonc.ts
828
- var import_eslint_plugin_jsonc = __toESM(require("eslint-plugin-jsonc"), 1);
829
- var import_jsonc_eslint_parser = __toESM(require("jsonc-eslint-parser"), 1);
830
- var jsonc = [
701
+ // src/configs/javascript.ts
702
+ var import_globals = __toESM(require("globals"), 1);
703
+ var import_js = __toESM(require("@eslint/js"), 1);
704
+ var javascript = [
705
+ import_js.default.configs.recommended,
831
706
  {
832
- files: [GLOB_JSON, GLOB_JSON5, GLOB_JSONC, "**/*rc"],
833
- plugins: {
834
- jsonc: import_eslint_plugin_jsonc.default
835
- },
836
707
  languageOptions: {
837
- parser: import_jsonc_eslint_parser.default
708
+ globals: {
709
+ ...import_globals.default.browser,
710
+ ...import_globals.default.es2021,
711
+ ...import_globals.default.node
712
+ },
713
+ sourceType: "module"
838
714
  },
839
- // @ts-expect-error 2322
840
715
  rules: {
841
- ...import_eslint_plugin_jsonc.configs["recommended-with-jsonc"].rules,
842
- "jsonc/array-bracket-spacing": ["error", "never"],
843
- "jsonc/comma-dangle": ["error", "never"],
844
- "jsonc/comma-style": ["error", "last"],
845
- "jsonc/indent": ["error", 2],
846
- "jsonc/key-spacing": [
716
+ // standard v 17.0.0
717
+ "accessor-pairs": ["error", { setWithoutGet: true, enforceForClassMembers: true }],
718
+ "array-bracket-spacing": ["error", "never"],
719
+ "arrow-spacing": ["error", { before: true, after: true }],
720
+ "block-spacing": ["error", "always"],
721
+ "brace-style": ["error", "1tbs", { allowSingleLine: true }],
722
+ camelcase: [
723
+ "error",
724
+ {
725
+ allow: ["^UNSAFE_"],
726
+ properties: "never",
727
+ ignoreGlobals: true
728
+ }
729
+ ],
730
+ "comma-spacing": ["error", { before: false, after: true }],
731
+ "comma-style": ["error", "last"],
732
+ "computed-property-spacing": ["error", "never", { enforceForClassMembers: true }],
733
+ "constructor-super": "error",
734
+ curly: ["error", "multi-line"],
735
+ "default-case-last": "error",
736
+ "dot-location": ["error", "property"],
737
+ "dot-notation": ["error", { allowKeywords: true }],
738
+ "eol-last": "error",
739
+ "func-call-spacing": ["error", "never"],
740
+ indent: [
741
+ "error",
742
+ 2,
743
+ {
744
+ SwitchCase: 1,
745
+ VariableDeclarator: 1,
746
+ outerIIFEBody: 1,
747
+ MemberExpression: 1,
748
+ FunctionDeclaration: { parameters: 1, body: 1 },
749
+ FunctionExpression: { parameters: 1, body: 1 },
750
+ CallExpression: { arguments: 1 },
751
+ ArrayExpression: 1,
752
+ ObjectExpression: 1,
753
+ ImportDeclaration: 1,
754
+ flatTernaryExpressions: false,
755
+ ignoreComments: false,
756
+ ignoredNodes: [
757
+ "TemplateLiteral *",
758
+ "JSXElement",
759
+ "JSXElement > *",
760
+ "JSXAttribute",
761
+ "JSXIdentifier",
762
+ "JSXNamespacedName",
763
+ "JSXMemberExpression",
764
+ "JSXSpreadAttribute",
765
+ "JSXExpressionContainer",
766
+ "JSXOpeningElement",
767
+ "JSXClosingElement",
768
+ "JSXFragment",
769
+ "JSXOpeningFragment",
770
+ "JSXClosingFragment",
771
+ "JSXText",
772
+ "JSXEmptyExpression",
773
+ "JSXSpreadChild"
774
+ ],
775
+ offsetTernaryExpressions: true
776
+ }
777
+ ],
778
+ "key-spacing": ["error", { beforeColon: false, afterColon: true }],
779
+ "keyword-spacing": ["error", { before: true, after: true }],
780
+ "lines-between-class-members": ["error", "always", { exceptAfterSingleLine: true }],
781
+ "multiline-ternary": ["error", "always-multiline"],
782
+ "new-cap": ["error", { newIsCap: true, capIsNew: false, properties: true }],
783
+ "new-parens": "error",
784
+ "no-array-constructor": "error",
785
+ "no-async-promise-executor": "error",
786
+ "no-caller": "error",
787
+ "no-class-assign": "error",
788
+ "no-compare-neg-zero": "error",
789
+ "no-cond-assign": "error",
790
+ "no-const-assign": "error",
791
+ "no-constant-condition": ["error", { checkLoops: false }],
792
+ "no-control-regex": "error",
793
+ "no-debugger": "error",
794
+ "no-delete-var": "error",
795
+ "no-dupe-args": "error",
796
+ "no-dupe-class-members": "error",
797
+ "no-dupe-keys": "error",
798
+ "no-duplicate-case": "error",
799
+ "no-useless-backreference": "error",
800
+ "no-empty": ["error", { allowEmptyCatch: true }],
801
+ "no-empty-character-class": "error",
802
+ "no-empty-pattern": "error",
803
+ "no-eval": "error",
804
+ "no-ex-assign": "error",
805
+ "no-extend-native": "error",
806
+ "no-extra-bind": "error",
807
+ "no-extra-boolean-cast": "error",
808
+ "no-extra-parens": ["error", "functions"],
809
+ "no-fallthrough": "error",
810
+ "no-floating-decimal": "error",
811
+ "no-func-assign": "error",
812
+ "no-global-assign": "error",
813
+ "no-implied-eval": "error",
814
+ "no-import-assign": "error",
815
+ "no-invalid-regexp": "error",
816
+ "no-irregular-whitespace": "error",
817
+ "no-iterator": "error",
818
+ "no-labels": ["error", { allowLoop: false, allowSwitch: false }],
819
+ "no-lone-blocks": "error",
820
+ "no-loss-of-precision": "error",
821
+ "no-misleading-character-class": "error",
822
+ "no-prototype-builtins": "error",
823
+ "no-useless-catch": "error",
824
+ "no-mixed-operators": [
825
+ "error",
826
+ {
827
+ groups: [
828
+ ["==", "!=", "===", "!==", ">", ">=", "<", "<="],
829
+ ["&&", "||"],
830
+ ["in", "instanceof"]
831
+ ],
832
+ allowSamePrecedence: true
833
+ }
834
+ ],
835
+ "no-mixed-spaces-and-tabs": "error",
836
+ "no-multiple-empty-lines": ["error", { max: 1, maxBOF: 0, maxEOF: 0 }],
837
+ "no-new": "error",
838
+ "no-new-func": "error",
839
+ "no-new-object": "error",
840
+ "no-new-symbol": "error",
841
+ "no-new-wrappers": "error",
842
+ "no-obj-calls": "error",
843
+ "no-octal": "error",
844
+ "no-octal-escape": "error",
845
+ "no-proto": "error",
846
+ "no-redeclare": ["error", { builtinGlobals: false }],
847
+ "no-regex-spaces": "error",
848
+ "no-self-assign": ["error", { props: true }],
849
+ "no-self-compare": "error",
850
+ "no-sequences": "error",
851
+ "no-shadow-restricted-names": "error",
852
+ "no-sparse-arrays": "error",
853
+ "no-tabs": "error",
854
+ "no-template-curly-in-string": "error",
855
+ "no-this-before-super": "error",
856
+ "no-throw-literal": "error",
857
+ "no-trailing-spaces": "error",
858
+ "no-undef": "error",
859
+ "no-undef-init": "error",
860
+ "no-unexpected-multiline": "error",
861
+ "no-unmodified-loop-condition": "error",
862
+ "no-unneeded-ternary": ["error", { defaultAssignment: false }],
863
+ "no-unreachable": "error",
864
+ "no-unreachable-loop": "error",
865
+ "no-unsafe-finally": "error",
866
+ "no-unsafe-negation": "error",
867
+ "no-unused-expressions": [
868
+ "error",
869
+ {
870
+ allowShortCircuit: true,
871
+ allowTernary: true,
872
+ allowTaggedTemplates: true
873
+ }
874
+ ],
875
+ "no-unused-vars": [
876
+ "error",
877
+ {
878
+ args: "none",
879
+ caughtErrors: "none",
880
+ ignoreRestSiblings: true,
881
+ vars: "all"
882
+ }
883
+ ],
884
+ "no-useless-call": "error",
885
+ "no-useless-computed-key": "error",
886
+ "no-useless-constructor": "error",
887
+ "no-useless-rename": "error",
888
+ "no-useless-return": "error",
889
+ "no-whitespace-before-property": "error",
890
+ "object-curly-newline": ["error", { multiline: true, consistent: true }],
891
+ "object-curly-spacing": ["error", "always"],
892
+ "object-property-newline": ["error", { allowMultiplePropertiesPerLine: true }],
893
+ "padded-blocks": ["error", { blocks: "never", switches: "never", classes: "never" }],
894
+ "prefer-promise-reject-errors": "error",
895
+ "prefer-regex-literals": ["error", { disallowRedundantWrapping: true }],
896
+ "quote-props": ["error", "as-needed"],
897
+ "rest-spread-spacing": ["error", "never"],
898
+ semi: ["error", "never"],
899
+ "semi-spacing": ["error", { before: false, after: true }],
900
+ "space-before-blocks": ["error", "always"],
901
+ "space-before-function-paren": ["error", "never"],
902
+ "space-in-parens": ["error", "never"],
903
+ "space-infix-ops": "error",
904
+ "space-unary-ops": ["error", { words: true, nonwords: false }],
905
+ "symbol-description": "error",
906
+ "template-tag-spacing": ["error", "never"],
907
+ "unicode-bom": ["error", "never"],
908
+ "use-isnan": [
909
+ "error",
910
+ {
911
+ enforceForSwitchCase: true,
912
+ enforceForIndexOf: true
913
+ }
914
+ ],
915
+ "valid-typeof": ["error", { requireStringLiterals: true }],
916
+ "wrap-iife": ["error", "any", { functionPrototypeMethods: true }],
917
+ "yield-star-spacing": ["error", "both"],
918
+ yoda: ["error", "never"],
919
+ // es6+
920
+ "no-var": "error",
921
+ "prefer-rest-params": "error",
922
+ "prefer-spread": "error",
923
+ "prefer-template": "error",
924
+ "template-curly-spacing": "error",
925
+ "generator-star-spacing": "off",
926
+ "no-empty-static-block": "error",
927
+ "no-new-native-nonconstructor": "error",
928
+ "arrow-parens": [
847
929
  "error",
930
+ "as-needed",
848
931
  {
849
- beforeColon: false,
850
- afterColon: true
932
+ requireForBlockBody: false
851
933
  }
852
934
  ],
853
- "jsonc/no-octal-escape": "error",
854
- "jsonc/object-curly-newline": [
935
+ quotes: [
855
936
  "error",
937
+ "single",
856
938
  {
857
- multiline: true,
858
- consistent: true
939
+ avoidEscape: true,
940
+ allowTemplateLiterals: false
859
941
  }
860
942
  ],
861
- "jsonc/object-curly-spacing": ["error", "always"],
862
- "jsonc/object-property-newline": [
943
+ "prefer-const": [
863
944
  "error",
864
945
  {
865
- allowMultiplePropertiesPerLine: true
946
+ destructuring: "all",
947
+ ignoreReadBeforeAssign: true
866
948
  }
867
- ]
868
- }
869
- }
870
- ];
871
- var pkgOrder = [
872
- {
873
- files: ["**/package.json"],
874
- rules: {
875
- "jsonc/sort-keys": [
949
+ ],
950
+ "prefer-arrow-callback": [
876
951
  "error",
877
952
  {
878
- pathPattern: "^$",
879
- order: [
880
- "publisher",
881
- "name",
882
- "displayName",
883
- "type",
884
- "version",
885
- "private",
886
- "packageManager",
887
- "description",
888
- "keywords",
889
- "license",
890
- "author",
891
- "homepage",
892
- "repository",
893
- "funding",
894
- "exports",
895
- "main",
896
- "module",
897
- "unpkg",
898
- "jsdelivr",
899
- // workaround for `type: "module"` with TS `moduleResolution: "node16"`
900
- "types",
901
- "typesVersions",
902
- "bin",
903
- "icon",
904
- "files",
905
- "sideEffects",
906
- "scripts",
907
- "peerDependencies",
908
- "peerDependenciesMeta",
909
- "dependencies",
910
- "optionalDependencies",
911
- "devDependencies",
912
- "activationEvents",
913
- "contributes",
914
- "categories",
915
- "engines",
916
- "pnpm",
917
- "overrides",
918
- "resolutions",
919
- "husky",
920
- "prettier",
921
- "nano-staged",
922
- "lint-staged",
923
- "eslintConfig"
924
- ]
925
- },
953
+ allowNamedFunctions: false,
954
+ allowUnboundThis: true
955
+ }
956
+ ],
957
+ "object-shorthand": [
958
+ "error",
959
+ "always",
926
960
  {
927
- pathPattern: "^(?:dev|peer|optional|bundled)?[Dd]ependencies$",
928
- order: { type: "asc" }
929
- },
961
+ ignoreConstructors: false,
962
+ avoidQuotes: true
963
+ }
964
+ ],
965
+ "spaced-comment": [
966
+ "error",
967
+ "always",
930
968
  {
931
- pathPattern: "^exports.*$",
932
- order: ["types", "import", "require", "default"]
933
- },
969
+ line: {
970
+ markers: ["/"],
971
+ exceptions: ["/", "#"]
972
+ },
973
+ block: {
974
+ markers: ["!"],
975
+ exceptions: ["*"],
976
+ balanced: true
977
+ }
978
+ }
979
+ ],
980
+ // best-practice
981
+ eqeqeq: ["error", "smart"],
982
+ complexity: ["error", { max: 30 }],
983
+ "array-callback-return": "error",
984
+ "block-scoped-var": "error",
985
+ "consistent-return": "off",
986
+ "no-alert": "error",
987
+ "no-case-declarations": "error",
988
+ "no-multi-spaces": "error",
989
+ "no-multi-str": "error",
990
+ "no-with": "error",
991
+ "no-void": "error",
992
+ "no-useless-escape": "off",
993
+ "vars-on-top": "error",
994
+ "require-await": "off",
995
+ "no-return-assign": "off",
996
+ "one-var": ["error", "never"],
997
+ "operator-linebreak": ["error", "before"],
998
+ "comma-dangle": ["error", "always-multiline"],
999
+ "max-params": ["error", { max: 5 }],
1000
+ "max-depth": ["error", { max: 5 }],
1001
+ "max-nested-callbacks": ["error", { max: 10 }],
1002
+ "max-statements-per-line": ["error", { max: 2 }],
1003
+ "max-lines": [
1004
+ "error",
934
1005
  {
935
- pathPattern: "^scripts$",
936
- order: { type: "asc" }
1006
+ max: 1e3,
1007
+ skipComments: true,
1008
+ skipBlankLines: true
937
1009
  }
938
1010
  ],
939
- "jsonc/sort-array-values": [
1011
+ "max-lines-per-function": [
940
1012
  "error",
941
1013
  {
942
- pathPattern: "^files$",
943
- order: { type: "asc" }
1014
+ max: 100,
1015
+ skipComments: true,
1016
+ skipBlankLines: true
1017
+ }
1018
+ ],
1019
+ "no-use-before-define": [
1020
+ "error",
1021
+ {
1022
+ functions: false,
1023
+ classes: false,
1024
+ variables: true
1025
+ }
1026
+ ],
1027
+ "max-len": [
1028
+ "error",
1029
+ {
1030
+ code: 200,
1031
+ tabWidth: 2,
1032
+ comments: 200,
1033
+ ignoreUrls: true,
1034
+ ignoreStrings: true,
1035
+ ignoreRegExpLiterals: true,
1036
+ ignoreTemplateLiterals: true,
1037
+ ignoreTrailingComments: true
1038
+ }
1039
+ ],
1040
+ "sort-imports": [
1041
+ "error",
1042
+ {
1043
+ ignoreCase: false,
1044
+ ignoreDeclarationSort: true,
1045
+ ignoreMemberSort: false,
1046
+ memberSyntaxSortOrder: ["none", "all", "multiple", "single"],
1047
+ allowSeparatedGroups: false
944
1048
  }
945
1049
  ]
946
1050
  }
947
- }
948
- ];
949
-
950
- // src/configs/unocss.ts
951
- var import_eslint_plugin3 = __toESM(require("@unocss/eslint-plugin"), 1);
952
- var unocss = [
1051
+ },
953
1052
  {
954
- plugins: {
955
- "@unocss": import_eslint_plugin3.default
956
- },
1053
+ files: ["**/scripts/*", "**/cli.*"],
957
1054
  rules: {
958
- ...import_eslint_plugin3.default.configs.recommended.rules
1055
+ "no-console": "off"
959
1056
  }
960
- }
961
- ];
962
-
963
- // src/configs/prettier.ts
964
- var import_eslint_plugin_prettier = __toESM(require("eslint-plugin-prettier"), 1);
965
- var import_eslint_config_prettier = __toESM(require("eslint-config-prettier"), 1);
966
- var prettier = [
1057
+ },
967
1058
  {
968
- plugins: {
969
- prettier: import_eslint_plugin_prettier.default
970
- },
1059
+ files: ["**/*.{test,spec}.js?(x)"],
971
1060
  rules: {
972
- ...import_eslint_config_prettier.default.rules,
973
- ...import_eslint_plugin_prettier.default.configs.recommended.rules,
974
- "prettier/prettier": "warn"
1061
+ "no-unused-expressions": "off",
1062
+ "max-lines-per-function": "off"
975
1063
  }
976
1064
  }
977
1065
  ];
978
-
979
- // src/configs/markdown.ts
980
- var import_eslint_plugin_markdown = __toESM(require("eslint-plugin-markdown"), 1);
981
- var import_eslint_plugin4 = __toESM(require("@typescript-eslint/eslint-plugin"), 1);
982
- var markdown = [
983
- {
984
- files: [GLOB_MARKDOWN],
985
- plugins: {
986
- markdown: import_eslint_plugin_markdown.default
987
- },
988
- processor: "markdown/markdown"
989
- },
1066
+ var jsx = [
990
1067
  {
991
- files: [`${GLOB_MARKDOWN}/${GLOB_SRC}`, `${GLOB_MARKDOWN}/${GLOB_VUE}`],
1068
+ files: ["**/*.jsx"],
992
1069
  languageOptions: {
993
1070
  parserOptions: {
994
1071
  ecmaFeatures: {
995
- impliedStrict: true
1072
+ jsx: true
996
1073
  }
997
1074
  }
998
- },
999
- plugins: {
1000
- "@typescript-eslint": import_eslint_plugin4.default
1001
- },
1002
- rules: {
1003
- ...import_eslint_plugin_markdown.default.configs.recommended.overrides[1].rules,
1004
- "no-undef": "off",
1005
- "no-alert": "off",
1006
- "no-console": "off",
1007
- "no-unused-vars": "off",
1008
- "no-unused-expressions": "off",
1009
- "no-restricted-imports": "off",
1010
- "import/no-unresolved": "off",
1011
- "@typescript-eslint/comma-dangle": "off",
1012
- "@typescript-eslint/no-redeclare": "off",
1013
- "@typescript-eslint/no-unused-vars": "off",
1014
- "@typescript-eslint/no-var-requires": "off",
1015
- "@typescript-eslint/no-extraneous-class": "off",
1016
- "@typescript-eslint/no-use-before-define": "off",
1017
- "unused-imports/no-unused-imports": "off",
1018
- "unused-imports/no-unused-vars": "off"
1019
1075
  }
1020
1076
  }
1021
1077
  ];
1022
1078
 
1023
- // src/configs/eslint-comments.ts
1024
- var import_eslint_plugin_eslint_comments = __toESM(require("eslint-plugin-eslint-comments"), 1);
1025
- var eslintComments = [
1079
+ // src/configs/ignores.ts
1080
+ var ignores = [
1026
1081
  {
1027
- plugins: {
1028
- "eslint-comments": import_eslint_plugin_eslint_comments.default
1029
- },
1030
- rules: {
1031
- ...import_eslint_plugin_eslint_comments.default.configs.recommended.rules,
1032
- "eslint-comments/disable-enable-pair": ["error", { allowWholeFile: true }]
1033
- }
1082
+ ignores: GLOB_EXCLUDE
1034
1083
  }
1035
1084
  ];
1036
1085
 
1037
1086
  // src/presets.ts
1038
- var GLOBAL_IGNORE = { ignores: GLOB_EXCLUDE };
1039
1087
  var basic = [
1040
- GLOBAL_IGNORE,
1041
- ...js,
1088
+ ...ignores,
1089
+ ...javascript,
1042
1090
  ...jsx,
1043
- ...ts,
1044
- ...yml,
1091
+ ...typescript,
1045
1092
  ...imports,
1046
1093
  ...unicorn,
1047
- ...jsonc,
1048
- ...pkgOrder,
1049
- ...eslintComments
1094
+ ...comments
1050
1095
  ];
1051
- var all = [
1096
+ var common = [
1052
1097
  ...basic,
1053
- ...vue,
1054
- ...react,
1055
- ...astro,
1056
- ...unocss,
1098
+ ...yml,
1099
+ ...jsonc,
1100
+ ...jsonOrder,
1057
1101
  ...prettier,
1058
1102
  ...markdown
1059
1103
  ];
1104
+ var all = [...common, ...vue, ...react, ...astro, ...unocss];
1060
1105
  function ntnyq(config = [], {
1061
1106
  vue: enableVue = false,
1062
1107
  react: enableReact = false,
1063
1108
  astro: enableAstro = false,
1064
- prettier: enablePrettier = false,
1065
- markdown: enableMarkdown = false,
1066
1109
  unocss: enableUnoCSS = false
1067
1110
  } = {}) {
1068
- const configs4 = [...basic];
1111
+ const configs = [...common];
1069
1112
  if (enableVue) {
1070
- configs4.push(...vue);
1113
+ configs.push(...vue);
1071
1114
  }
1072
1115
  if (enableReact) {
1073
- configs4.push(...react);
1116
+ configs.push(...react);
1074
1117
  }
1075
1118
  if (enableAstro) {
1076
- configs4.push(...astro);
1119
+ configs.push(...astro);
1077
1120
  }
1078
1121
  if (enableUnoCSS) {
1079
- configs4.push(...unocss);
1080
- }
1081
- if (enableMarkdown) {
1082
- configs4.push(...markdown);
1083
- }
1084
- if (enablePrettier) {
1085
- configs4.push(...prettier);
1122
+ configs.push(...unocss);
1086
1123
  }
1087
1124
  if (Object.keys(config).length > 0) {
1088
- configs4.push(...Array.isArray(config) ? config : [config]);
1125
+ configs.push(...Array.isArray(config) ? config : [config]);
1089
1126
  }
1090
- return configs4;
1127
+ return configs;
1091
1128
  }
1092
1129
  // Annotate the CommonJS export names for ESM import in node:
1093
1130
  0 && (module.exports = {
@@ -1117,26 +1154,40 @@ function ntnyq(config = [], {
1117
1154
  all,
1118
1155
  astro,
1119
1156
  basic,
1120
- eslintComments,
1157
+ comments,
1158
+ common,
1121
1159
  getVueVersion,
1160
+ ignores,
1122
1161
  imports,
1123
- js,
1162
+ javascript,
1163
+ jsonOrder,
1124
1164
  jsonc,
1125
1165
  jsx,
1126
1166
  markdown,
1127
1167
  ntnyq,
1128
- pkgOrder,
1168
+ parserAstro,
1169
+ parserJsonc,
1170
+ parserTypescript,
1171
+ parserVue,
1172
+ parserYml,
1173
+ pluginAstro,
1174
+ pluginComments,
1175
+ pluginImport,
1176
+ pluginJsonc,
1177
+ pluginMarkdown,
1178
+ pluginPrettier,
1179
+ pluginReact,
1180
+ pluginReactHooks,
1181
+ pluginTypescript,
1182
+ pluginUnicorn,
1183
+ pluginUnoCSS,
1184
+ pluginVue,
1185
+ pluginYml,
1129
1186
  prettier,
1130
1187
  react,
1131
- reactHooksPlugin,
1132
- reactPlugin,
1133
- ts,
1134
- tsParser,
1135
- tsPlugin,
1188
+ typescript,
1136
1189
  unicorn,
1137
1190
  unocss,
1138
1191
  vue,
1139
- vueParser,
1140
- vuePlugin,
1141
1192
  yml
1142
1193
  });