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