@sxzz/eslint-config 3.6.0 → 3.6.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -6,9 +6,12 @@ Flat ESLint config for JavaScript, TypeScript, Vue 2, Vue 3, Prettier.
6
6
 
7
7
  ## Features
8
8
 
9
- - Support Vue 2 and 3 out-of-box.
10
- - Select the required file types as needed.
9
+ - Format with Prettier.
10
+ - Designed to work with TypeScript, Vue 2 and 3 out-of-box.
11
11
  - Support JSON(5), YAML, Markdown...
12
+ - Sort imports, `package.json`, `tsconfig.json`...
13
+ - [ESLint Flat config](https://eslint.org/docs/latest/use/configure/configuration-files-new), compose easily!
14
+ - Reasonable defaults, best practices, only one-line of config
12
15
 
13
16
  ## Install
14
17
 
@@ -35,7 +38,7 @@ export default sxzz(
35
38
  [
36
39
  /* your custom config */
37
40
  ],
38
- { vue: true, prettier: true, markdown: true }
41
+ { vue: true, prettier: true, markdown: true, unocss: false }
39
42
  )
40
43
  ```
41
44
 
@@ -47,6 +50,15 @@ export default sxzz(
47
50
  }
48
51
  ```
49
52
 
53
+ ## Comparing to [`@antfu/eslint-config`](https://github.com/antfu/eslint-config)
54
+
55
+ Most of the rules are the same, but there are some differences:
56
+
57
+ - Use Prettier instead of [ESLint Stylistic](https://github.com/eslint-stylistic/eslint-stylistic).
58
+ - Support both Vue 2 and Vue 3.
59
+ - Support Vue Reactivity Transform.
60
+ - More stricter rules.
61
+
50
62
  ## Sponsors
51
63
 
52
64
  <p align="center">
package/dist/index.cjs CHANGED
@@ -106,6 +106,7 @@ var _pluginUnicorn = __toESM(require("eslint-plugin-unicorn"), 1);
106
106
  var _pluginVue = __toESM(require("eslint-plugin-vue"), 1);
107
107
  var _pluginUnocss = __toESM(require("@unocss/eslint-plugin"), 1);
108
108
  var _pluginPrettier = __toESM(require("eslint-plugin-prettier"), 1);
109
+ var _configPrettier = __toESM(require("eslint-config-prettier"), 1);
109
110
  var pluginImport = __toESM(require("eslint-plugin-i"), 1);
110
111
  var pluginJsonc = __toESM(require("eslint-plugin-jsonc"), 1);
111
112
  var pluginUnusedImports = __toESM(require("eslint-plugin-unused-imports"), 1);
@@ -114,18 +115,19 @@ var parserTypeScript = __toESM(require("@typescript-eslint/parser"), 1);
114
115
  var parserVue = __toESM(require("vue-eslint-parser"), 1);
115
116
  var parserYml = __toESM(require("yaml-eslint-parser"), 1);
116
117
  var parserJsonc = __toESM(require("jsonc-eslint-parser"), 1);
117
- var configPrettier = __toESM(require("eslint-config-prettier"), 1);
118
+ // @__NO_SIDE_EFFECTS__
118
119
  function interopDefault(m) {
119
120
  return m.default || m;
120
121
  }
121
- var pluginAntfu = interopDefault(_pluginAntfu);
122
- var pluginComments = interopDefault(_pluginComments);
123
- var pluginMarkdown = interopDefault(_pluginMarkdown);
124
- var pluginTypeScript = interopDefault(_pluginTypeScript);
125
- var pluginUnicorn = interopDefault(_pluginUnicorn);
126
- var pluginVue = interopDefault(_pluginVue);
127
- var pluginUnocss = interopDefault(_pluginUnocss);
128
- var pluginPrettier = interopDefault(_pluginPrettier);
122
+ var pluginAntfu = /* @__PURE__ */ interopDefault(_pluginAntfu);
123
+ var pluginComments = /* @__PURE__ */ interopDefault(_pluginComments);
124
+ var pluginMarkdown = /* @__PURE__ */ interopDefault(_pluginMarkdown);
125
+ var pluginTypeScript = /* @__PURE__ */ interopDefault(_pluginTypeScript);
126
+ var pluginUnicorn = /* @__PURE__ */ interopDefault(_pluginUnicorn);
127
+ var pluginVue = /* @__PURE__ */ interopDefault(_pluginVue);
128
+ var pluginUnocss = /* @__PURE__ */ interopDefault(_pluginUnocss);
129
+ var pluginPrettier = /* @__PURE__ */ interopDefault(_pluginPrettier);
130
+ var configPrettier = /* @__PURE__ */ interopDefault(_configPrettier);
129
131
 
130
132
  // src/configs/comments.ts
131
133
  var comments = [
@@ -161,60 +163,46 @@ var GLOB_MARKDOWN = "**/*.md";
161
163
  var GLOB_VUE = "**/*.vue";
162
164
  var GLOB_YAML = "**/*.y?(a)ml";
163
165
  var GLOB_HTML = "**/*.htm?(l)";
164
- var GLOB_ALL_SRC = (
165
- /** @type {const} */
166
- [
167
- GLOB_SRC,
168
- GLOB_STYLE,
169
- GLOB_JSON,
170
- GLOB_JSON5,
171
- GLOB_MARKDOWN,
172
- GLOB_VUE,
173
- GLOB_YAML,
174
- GLOB_HTML
175
- ]
176
- );
177
- var GLOB_NODE_MODULES = (
178
- /** @type {const} */
179
- "**/node_modules"
180
- );
181
- var GLOB_DIST = (
182
- /** @type {const} */
183
- "**/dist"
184
- );
185
- var GLOB_LOCKFILE = (
186
- /** @type {const} */
187
- [
188
- "**/package-lock.json",
189
- "**/yarn.lock",
190
- "**/pnpm-lock.yaml"
191
- ]
192
- );
193
- var GLOB_EXCLUDE = (
194
- /** @type {const} */
195
- [
196
- GLOB_NODE_MODULES,
197
- GLOB_DIST,
198
- ...GLOB_LOCKFILE,
199
- "**/output",
200
- "**/coverage",
201
- "**/temp",
202
- "**/fixtures",
203
- "**/.vitepress/cache",
204
- "**/.nuxt",
205
- "**/.vercel",
206
- "**/.changeset",
207
- "**/.idea",
208
- "**/.output",
209
- "**/.vite-inspect",
210
- "**/CHANGELOG*.md",
211
- "**/*.min.*",
212
- "**/LICENSE*",
213
- "**/__snapshots__",
214
- "**/auto-import?(s).d.ts",
215
- "**/components.d.ts"
216
- ]
217
- );
166
+ var GLOB_ALL_SRC = [
167
+ GLOB_SRC,
168
+ GLOB_STYLE,
169
+ GLOB_JSON,
170
+ GLOB_JSON5,
171
+ GLOB_MARKDOWN,
172
+ GLOB_VUE,
173
+ GLOB_YAML,
174
+ GLOB_HTML
175
+ ];
176
+ var GLOB_NODE_MODULES = "**/node_modules";
177
+ var GLOB_DIST = "**/dist";
178
+ var GLOB_LOCKFILE = [
179
+ "**/package-lock.json",
180
+ "**/yarn.lock",
181
+ "**/pnpm-lock.yaml",
182
+ "**/bun.lockb"
183
+ ];
184
+ var GLOB_EXCLUDE = [
185
+ GLOB_NODE_MODULES,
186
+ GLOB_DIST,
187
+ ...GLOB_LOCKFILE,
188
+ "**/output",
189
+ "**/coverage",
190
+ "**/temp",
191
+ "**/fixtures",
192
+ "**/.vitepress/cache",
193
+ "**/.nuxt",
194
+ "**/.vercel",
195
+ "**/.changeset",
196
+ "**/.idea",
197
+ "**/.output",
198
+ "**/.vite-inspect",
199
+ "**/CHANGELOG*.md",
200
+ "**/*.min.*",
201
+ "**/LICENSE*",
202
+ "**/__snapshots__",
203
+ "**/auto-import?(s).d.ts",
204
+ "**/components.d.ts"
205
+ ];
218
206
 
219
207
  // src/configs/ignores.ts
220
208
  var ignores = [{ ignores: GLOB_EXCLUDE }];
@@ -223,10 +211,12 @@ var ignores = [{ ignores: GLOB_EXCLUDE }];
223
211
  var imports = [
224
212
  {
225
213
  plugins: {
226
- import: pluginImport,
227
- antfu: pluginAntfu
214
+ antfu: pluginAntfu,
215
+ import: pluginImport
228
216
  },
229
217
  rules: {
218
+ "antfu/import-dedupe": "error",
219
+ "antfu/prefer-inline-type-import": "error",
230
220
  "import/first": "error",
231
221
  "import/no-default-export": "error",
232
222
  "import/no-duplicates": "error",
@@ -247,12 +237,10 @@ var imports = [
247
237
  "object",
248
238
  "type"
249
239
  ],
250
- pathGroups: [{ pattern: "{{@,~}/,#}**", group: "internal" }],
240
+ pathGroups: [{ group: "internal", pattern: "{{@,~}/,#}**" }],
251
241
  pathGroupsExcludedImportTypes: ["type"]
252
242
  }
253
- ],
254
- "antfu/import-dedupe": "error",
255
- "antfu/prefer-inline-type-import": "error"
243
+ ]
256
244
  }
257
245
  },
258
246
  {
@@ -304,14 +292,20 @@ var javascript = [
304
292
  "unused-imports": pluginUnusedImports
305
293
  },
306
294
  rules: {
295
+ "array-callback-return": "error",
296
+ "block-scoped-var": "error",
307
297
  "constructor-super": "error",
298
+ "dot-notation": "warn",
299
+ eqeqeq: ["error", "smart"],
308
300
  "for-direction": "error",
309
301
  "getter-return": "error",
302
+ "no-alert": "warn",
310
303
  "no-async-promise-executor": "error",
311
304
  "no-case-declarations": "error",
312
305
  "no-class-assign": "error",
313
306
  "no-compare-neg-zero": "error",
314
307
  "no-cond-assign": "error",
308
+ "no-console": ["warn", { allow: ["warn", "error"] }],
315
309
  "no-const-assign": "error",
316
310
  "no-constant-condition": "error",
317
311
  "no-control-regex": "error",
@@ -322,6 +316,7 @@ var javascript = [
322
316
  "no-dupe-else-if": "error",
323
317
  "no-dupe-keys": "error",
324
318
  "no-duplicate-case": "error",
319
+ "no-duplicate-imports": "error",
325
320
  "no-empty": ["error", { allowEmptyCatch: true }],
326
321
  "no-empty-character-class": "error",
327
322
  "no-empty-pattern": "error",
@@ -334,9 +329,11 @@ var javascript = [
334
329
  "no-inner-declarations": "error",
335
330
  "no-invalid-regexp": "error",
336
331
  "no-irregular-whitespace": "error",
332
+ "no-lonely-if": "error",
337
333
  "no-loss-of-precision": "error",
338
334
  "no-misleading-character-class": "error",
339
335
  "no-mixed-spaces-and-tabs": "error",
336
+ "no-multi-str": "error",
340
337
  "no-new-symbol": "error",
341
338
  "no-nonoctal-decimal-escape": "error",
342
339
  "no-obj-calls": "error",
@@ -344,6 +341,13 @@ var javascript = [
344
341
  "no-prototype-builtins": "error",
345
342
  "no-redeclare": "error",
346
343
  "no-regex-spaces": "error",
344
+ "no-restricted-syntax": [
345
+ "error",
346
+ "ForInStatement",
347
+ "LabeledStatement",
348
+ "WithStatement"
349
+ ],
350
+ "no-return-await": "warn",
347
351
  "no-self-assign": "error",
348
352
  "no-setter-return": "error",
349
353
  "no-shadow-restricted-names": "error",
@@ -355,37 +359,26 @@ var javascript = [
355
359
  "no-unsafe-finally": "error",
356
360
  "no-unsafe-negation": "error",
357
361
  "no-unsafe-optional-chaining": "error",
362
+ "no-unused-expressions": [
363
+ "error",
364
+ {
365
+ allowShortCircuit: true,
366
+ allowTaggedTemplates: true,
367
+ allowTernary: true
368
+ }
369
+ ],
358
370
  "no-unused-labels": "error",
359
371
  "no-unused-vars": "off",
360
372
  "no-useless-backreference": "error",
361
373
  "no-useless-catch": "error",
362
374
  "no-useless-escape": "error",
375
+ "no-void": "error",
363
376
  "no-with": "error",
364
- "require-yield": "error",
365
- "use-isnan": [
366
- "error",
367
- { enforceForIndexOf: true, enforceForSwitchCase: true }
368
- ],
369
- "valid-typeof": ["error", { requireStringLiterals: true }],
370
- "no-console": ["warn", { allow: ["warn", "error"] }],
371
- "no-restricted-syntax": [
372
- "error",
373
- "ForInStatement",
374
- "LabeledStatement",
375
- "WithStatement"
376
- ],
377
- "no-return-await": "warn",
378
- "sort-imports": [
377
+ "object-shorthand": [
379
378
  "error",
380
- {
381
- ignoreCase: false,
382
- ignoreDeclarationSort: true,
383
- ignoreMemberSort: false,
384
- memberSyntaxSortOrder: ["none", "all", "multiple", "single"],
385
- allowSeparatedGroups: false
386
- }
379
+ "always",
380
+ { avoidQuotes: true, ignoreConstructors: false }
387
381
  ],
388
- "dot-notation": "warn",
389
382
  "prefer-arrow-callback": [
390
383
  "error",
391
384
  { allowNamedFunctions: false, allowUnboundThis: true }
@@ -395,40 +388,35 @@ var javascript = [
395
388
  { destructuring: "all", ignoreReadBeforeAssign: true }
396
389
  ],
397
390
  "prefer-exponentiation-operator": "error",
398
- "object-shorthand": [
399
- "error",
400
- "always",
401
- { ignoreConstructors: false, avoidQuotes: true }
402
- ],
403
391
  "prefer-regex-literals": ["error", { disallowRedundantWrapping: true }],
404
392
  "prefer-rest-params": "error",
405
393
  "prefer-spread": "error",
406
394
  "prefer-template": "error",
407
395
  "require-await": "error",
408
- "array-callback-return": "error",
409
- "block-scoped-var": "error",
410
- eqeqeq: ["error", "smart"],
411
- "no-alert": "warn",
412
- "no-multi-str": "error",
413
- "no-void": "error",
414
- "no-duplicate-imports": "error",
415
- "no-unused-expressions": [
396
+ "require-yield": "error",
397
+ "sort-imports": [
416
398
  "error",
417
399
  {
418
- allowShortCircuit: true,
419
- allowTernary: true,
420
- allowTaggedTemplates: true
400
+ allowSeparatedGroups: false,
401
+ ignoreCase: false,
402
+ ignoreDeclarationSort: true,
403
+ ignoreMemberSort: false,
404
+ memberSyntaxSortOrder: ["none", "all", "multiple", "single"]
421
405
  }
422
406
  ],
423
- "no-lonely-if": "error",
424
- "wrap-iife": ["error", "any", { functionPrototypeMethods: true }],
425
- "vars-on-top": "error",
426
407
  "unicode-bom": ["error", "never"],
427
408
  "unused-imports/no-unused-imports": isInEditor ? "off" : "error",
428
409
  "unused-imports/no-unused-vars": [
429
410
  "error",
430
411
  { args: "after-used", ignoreRestSiblings: true }
431
- ]
412
+ ],
413
+ "use-isnan": [
414
+ "error",
415
+ { enforceForIndexOf: true, enforceForSwitchCase: true }
416
+ ],
417
+ "valid-typeof": ["error", { requireStringLiterals: true }],
418
+ "vars-on-top": "error",
419
+ "wrap-iife": ["error", "any", { functionPrototypeMethods: true }]
432
420
  }
433
421
  },
434
422
  {
@@ -449,12 +437,12 @@ var javascript = [
449
437
  var jsonc = [
450
438
  {
451
439
  files: [GLOB_JSON, GLOB_JSON5, GLOB_JSONC],
452
- plugins: {
453
- jsonc: pluginJsonc
454
- },
455
440
  languageOptions: {
456
441
  parser: parserJsonc
457
442
  },
443
+ plugins: {
444
+ jsonc: pluginJsonc
445
+ },
458
446
  rules: {
459
447
  ...pluginJsonc.configs["recommended-with-jsonc"].rules,
460
448
  "jsonc/quote-props": "off",
@@ -485,21 +473,21 @@ var markdown = [
485
473
  ...pluginMarkdown.configs.recommended.overrides[1].rules,
486
474
  "@typescript-eslint/comma-dangle": "off",
487
475
  "@typescript-eslint/consistent-type-imports": "off",
476
+ "@typescript-eslint/no-extraneous-class": "off",
488
477
  "@typescript-eslint/no-namespace": "off",
489
478
  "@typescript-eslint/no-redeclare": "off",
490
479
  "@typescript-eslint/no-require-imports": "off",
491
480
  "@typescript-eslint/no-unused-vars": "off",
492
481
  "@typescript-eslint/no-use-before-define": "off",
493
482
  "@typescript-eslint/no-var-requires": "off",
494
- "@typescript-eslint/no-extraneous-class": "off",
495
483
  "no-alert": "off",
496
484
  "no-console": "off",
497
485
  "no-restricted-imports": "off",
498
486
  "no-undef": "off",
499
487
  "no-unused-expressions": "off",
500
488
  "no-unused-vars": "off",
501
- "unused-imports/no-unused-vars": "off",
502
- "unused-imports/no-unused-imports": "off"
489
+ "unused-imports/no-unused-imports": "off",
490
+ "unused-imports/no-unused-vars": "off"
503
491
  }
504
492
  }
505
493
  ];
@@ -528,14 +516,13 @@ var sortPackageJson = [
528
516
  "jsonc/sort-array-values": [
529
517
  "error",
530
518
  {
531
- pathPattern: "^files$",
532
- order: { type: "asc" }
519
+ order: { type: "asc" },
520
+ pathPattern: "^files$"
533
521
  }
534
522
  ],
535
523
  "jsonc/sort-keys": [
536
524
  "error",
537
525
  {
538
- pathPattern: "^$",
539
526
  order: [
540
527
  "name",
541
528
  "version",
@@ -579,15 +566,16 @@ var sortPackageJson = [
579
566
  "lint-staged",
580
567
  "eslintConfig",
581
568
  "prettier"
582
- ]
569
+ ],
570
+ pathPattern: "^$"
583
571
  },
584
572
  {
585
- pathPattern: "^(?:dev|peer|optional|bundled)?[Dd]ependencies$",
586
- order: { type: "asc" }
573
+ order: { type: "asc" },
574
+ pathPattern: "^(?:dev|peer|optional|bundled)?[Dd]ependencies$"
587
575
  },
588
576
  {
589
- pathPattern: "^exports.*$",
590
- order: ["types", "require", "import", "default"]
577
+ order: ["types", "require", "import", "default"],
578
+ pathPattern: "^exports.*$"
591
579
  },
592
580
  {
593
581
  order: { type: "asc" },
@@ -735,12 +723,12 @@ var typescript = [
735
723
  }
736
724
  },
737
725
  plugins: {
738
- "@typescript-eslint": pluginTypeScript
726
+ "@typescript-eslint": pluginTypeScript,
727
+ antfu: pluginAntfu
739
728
  },
740
729
  rules: {
741
730
  ...pluginTypeScript.configs["eslint-recommended"].overrides[0].rules,
742
731
  ...pluginTypeScript.configs.strict.rules,
743
- "@typescript-eslint/no-redeclare": "error",
744
732
  "@typescript-eslint/ban-ts-comment": "off",
745
733
  "@typescript-eslint/ban-types": "off",
746
734
  "@typescript-eslint/consistent-type-assertions": [
@@ -752,13 +740,19 @@ var typescript = [
752
740
  ],
753
741
  "@typescript-eslint/consistent-type-imports": [
754
742
  "error",
755
- { fixStyle: "inline-type-imports", disallowTypeAnnotations: false }
743
+ { disallowTypeAnnotations: false, fixStyle: "inline-type-imports" }
756
744
  ],
757
745
  "@typescript-eslint/no-explicit-any": "off",
758
746
  "@typescript-eslint/no-non-null-assertion": "off",
759
- "@typescript-eslint/prefer-as-const": "warn",
747
+ "@typescript-eslint/no-redeclare": "error",
760
748
  // handled by unused-imports/no-unused-imports
761
- "@typescript-eslint/no-unused-vars": "off"
749
+ "@typescript-eslint/no-unused-vars": "off",
750
+ "@typescript-eslint/prefer-as-const": "warn",
751
+ "@typescript-eslint/prefer-literal-enum-member": [
752
+ "error",
753
+ { allowBitwiseExpressions: true }
754
+ ],
755
+ "antfu/no-const-enum": "error"
762
756
  }
763
757
  },
764
758
  {
@@ -884,11 +878,11 @@ var reactivityTransform = [
884
878
  globals: {
885
879
  $: "readonly",
886
880
  $$: "readonly",
887
- $ref: "readonly",
888
881
  $computed: "readonly",
882
+ $customRef: "readonly",
883
+ $ref: "readonly",
889
884
  $shallowRef: "readonly",
890
- $toRef: "readonly",
891
- $customRef: "readonly"
885
+ $toRef: "readonly"
892
886
  }
893
887
  },
894
888
  plugins: {
@@ -900,41 +894,41 @@ var reactivityTransform = [
900
894
  }
901
895
  ];
902
896
  var vueCustomRules = {
903
- "vue/max-attributes-per-line": "off",
904
- "vue/no-v-html": "off",
905
- "vue/multi-word-component-names": "off",
906
- "vue/require-prop-types": "off",
907
- "vue/require-default-prop": "off",
897
+ "vue/block-order": ["error", { order: ["script", "template", "style"] }],
898
+ "vue/custom-event-name-casing": ["error", "camelCase"],
899
+ "vue/eqeqeq": ["error", "smart"],
908
900
  "vue/html-self-closing": [
909
901
  "error",
910
902
  {
911
903
  html: {
912
- void: "always",
904
+ component: "always",
913
905
  normal: "always",
914
- component: "always"
906
+ void: "always"
915
907
  },
916
- svg: "always",
917
- math: "always"
908
+ math: "always",
909
+ svg: "always"
918
910
  }
919
911
  ],
920
- "vue/block-order": ["error", { order: ["script", "template", "style"] }],
921
- "vue/custom-event-name-casing": ["error", "camelCase"],
922
- "vue/no-useless-v-bind": "error",
923
- "vue/no-unused-refs": "error",
924
- "vue/padding-line-between-blocks": ["error", "always"],
925
- "vue/prefer-template": "error",
926
- "vue/eqeqeq": ["error", "smart"],
912
+ "vue/max-attributes-per-line": "off",
913
+ "vue/multi-word-component-names": "off",
927
914
  "vue/no-constant-condition": "warn",
915
+ "vue/no-empty-pattern": "error",
916
+ "vue/no-loss-of-precision": "error",
917
+ "vue/no-unused-refs": "error",
918
+ "vue/no-useless-v-bind": "error",
919
+ "vue/no-v-html": "off",
928
920
  "vue/object-shorthand": [
929
921
  "error",
930
922
  "always",
931
923
  {
932
- ignoreConstructors: false,
933
- avoidQuotes: true
924
+ avoidQuotes: true,
925
+ ignoreConstructors: false
934
926
  }
935
927
  ],
936
- "vue/no-loss-of-precision": "error",
937
- "vue/no-empty-pattern": "error"
928
+ "vue/padding-line-between-blocks": ["error", "always"],
929
+ "vue/prefer-template": "error",
930
+ "vue/require-default-prop": "off",
931
+ "vue/require-prop-types": "off"
938
932
  };
939
933
  var vue3Rules = {
940
934
  ...pluginVue.configs.base.rules,
@@ -951,21 +945,21 @@ var vue2Rules = {
951
945
  var vue = [
952
946
  {
953
947
  files: [GLOB_VUE],
954
- plugins: {
955
- vue: pluginVue,
956
- "@typescript-eslint": import_eslint_plugin.default
957
- },
958
948
  languageOptions: {
959
949
  parser: parserVue,
960
950
  parserOptions: {
961
- parser: "@typescript-eslint/parser",
962
- sourceType: "module",
963
- extraFileExtensions: [".vue"],
964
951
  ecmaFeatures: {
965
952
  jsx: true
966
- }
953
+ },
954
+ extraFileExtensions: [".vue"],
955
+ parser: "@typescript-eslint/parser",
956
+ sourceType: "module"
967
957
  }
968
958
  },
959
+ plugins: {
960
+ "@typescript-eslint": import_eslint_plugin.default,
961
+ vue: pluginVue
962
+ },
969
963
  processor: pluginVue.processors[".vue"],
970
964
  rules: {
971
965
  ...typescript[0].rules
@@ -987,12 +981,12 @@ var vue = [
987
981
  var yml = [
988
982
  {
989
983
  files: [GLOB_YAML],
990
- plugins: {
991
- yml: pluginYml
992
- },
993
984
  languageOptions: {
994
985
  parser: parserYml
995
986
  },
987
+ plugins: {
988
+ yml: pluginYml
989
+ },
996
990
  rules: {
997
991
  ...pluginYml.configs.standard.rules,
998
992
  ...pluginYml.configs.prettier.rules,
package/dist/index.d.cts CHANGED
@@ -15,8 +15,6 @@ import * as yamlEslintParser from 'yaml-eslint-parser';
15
15
  export { yamlEslintParser as parserYml };
16
16
  import * as jsoncEslintParser from 'jsonc-eslint-parser';
17
17
  export { jsoncEslintParser as parserJsonc };
18
- import * as eslintConfigPrettier from 'eslint-config-prettier';
19
- export { eslintConfigPrettier as configPrettier };
20
18
 
21
19
  declare const comments: FlatESLintConfigItem[];
22
20
 
@@ -69,8 +67,8 @@ declare const GLOB_VUE = "**/*.vue";
69
67
  declare const GLOB_YAML = "**/*.y?(a)ml";
70
68
  declare const GLOB_HTML = "**/*.htm?(l)";
71
69
  declare const GLOB_ALL_SRC: string[];
72
- declare const GLOB_NODE_MODULES = /** @type {const} */ "**/node_modules";
73
- declare const GLOB_DIST = /** @type {const} */ "**/dist";
70
+ declare const GLOB_NODE_MODULES: "**/node_modules";
71
+ declare const GLOB_DIST: "**/dist";
74
72
  declare const GLOB_LOCKFILE: string[];
75
73
  declare const GLOB_EXCLUDE: string[];
76
74
 
@@ -82,6 +80,7 @@ declare const pluginUnicorn: any;
82
80
  declare const pluginVue: any;
83
81
  declare const pluginUnocss: any;
84
82
  declare const pluginPrettier: any;
83
+ declare const configPrettier: any;
85
84
 
86
85
  declare const presetJavaScript: FlatESLintConfigItem[];
87
86
  declare const presetLangsExtensions: FlatESLintConfigItem[];
@@ -95,4 +94,4 @@ declare function sxzz(config?: FlatESLintConfigItem | FlatESLintConfigItem[], {
95
94
  unocss: boolean;
96
95
  }>): FlatESLintConfigItem[];
97
96
 
98
- export { GLOB_ALL_SRC, GLOB_CSS, GLOB_DIST, GLOB_EXCLUDE, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_LOCKFILE, GLOB_MARKDOWN, GLOB_NODE_MODULES, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_YAML, all, basic, comments, getVueVersion, hasTypeScript, hasVue, ignores, imports, isInEditor, javascript, jsonc, markdown, pluginAntfu, pluginComments, pluginMarkdown, pluginPrettier, pluginTypeScript, pluginUnicorn, pluginUnocss, pluginVue, basic as presetBasic, presetJavaScript, presetLangsExtensions, prettier, reactivityTransform, sortPackageJson, sortTsconfig, sxzz, typescript, unicorn, unocss, vue, yml };
97
+ export { GLOB_ALL_SRC, GLOB_CSS, GLOB_DIST, GLOB_EXCLUDE, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_LOCKFILE, GLOB_MARKDOWN, GLOB_NODE_MODULES, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_YAML, all, basic, comments, configPrettier, getVueVersion, hasTypeScript, hasVue, ignores, imports, isInEditor, javascript, jsonc, markdown, pluginAntfu, pluginComments, pluginMarkdown, pluginPrettier, pluginTypeScript, pluginUnicorn, pluginUnocss, pluginVue, basic as presetBasic, presetJavaScript, presetLangsExtensions, prettier, reactivityTransform, sortPackageJson, sortTsconfig, sxzz, typescript, unicorn, unocss, vue, yml };
package/dist/index.d.ts CHANGED
@@ -15,8 +15,6 @@ import * as yamlEslintParser from 'yaml-eslint-parser';
15
15
  export { yamlEslintParser as parserYml };
16
16
  import * as jsoncEslintParser from 'jsonc-eslint-parser';
17
17
  export { jsoncEslintParser as parserJsonc };
18
- import * as eslintConfigPrettier from 'eslint-config-prettier';
19
- export { eslintConfigPrettier as configPrettier };
20
18
 
21
19
  declare const comments: FlatESLintConfigItem[];
22
20
 
@@ -69,8 +67,8 @@ declare const GLOB_VUE = "**/*.vue";
69
67
  declare const GLOB_YAML = "**/*.y?(a)ml";
70
68
  declare const GLOB_HTML = "**/*.htm?(l)";
71
69
  declare const GLOB_ALL_SRC: string[];
72
- declare const GLOB_NODE_MODULES = /** @type {const} */ "**/node_modules";
73
- declare const GLOB_DIST = /** @type {const} */ "**/dist";
70
+ declare const GLOB_NODE_MODULES: "**/node_modules";
71
+ declare const GLOB_DIST: "**/dist";
74
72
  declare const GLOB_LOCKFILE: string[];
75
73
  declare const GLOB_EXCLUDE: string[];
76
74
 
@@ -82,6 +80,7 @@ declare const pluginUnicorn: any;
82
80
  declare const pluginVue: any;
83
81
  declare const pluginUnocss: any;
84
82
  declare const pluginPrettier: any;
83
+ declare const configPrettier: any;
85
84
 
86
85
  declare const presetJavaScript: FlatESLintConfigItem[];
87
86
  declare const presetLangsExtensions: FlatESLintConfigItem[];
@@ -95,4 +94,4 @@ declare function sxzz(config?: FlatESLintConfigItem | FlatESLintConfigItem[], {
95
94
  unocss: boolean;
96
95
  }>): FlatESLintConfigItem[];
97
96
 
98
- export { GLOB_ALL_SRC, GLOB_CSS, GLOB_DIST, GLOB_EXCLUDE, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_LOCKFILE, GLOB_MARKDOWN, GLOB_NODE_MODULES, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_YAML, all, basic, comments, getVueVersion, hasTypeScript, hasVue, ignores, imports, isInEditor, javascript, jsonc, markdown, pluginAntfu, pluginComments, pluginMarkdown, pluginPrettier, pluginTypeScript, pluginUnicorn, pluginUnocss, pluginVue, basic as presetBasic, presetJavaScript, presetLangsExtensions, prettier, reactivityTransform, sortPackageJson, sortTsconfig, sxzz, typescript, unicorn, unocss, vue, yml };
97
+ export { GLOB_ALL_SRC, GLOB_CSS, GLOB_DIST, GLOB_EXCLUDE, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_LOCKFILE, GLOB_MARKDOWN, GLOB_NODE_MODULES, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_YAML, all, basic, comments, configPrettier, getVueVersion, hasTypeScript, hasVue, ignores, imports, isInEditor, javascript, jsonc, markdown, pluginAntfu, pluginComments, pluginMarkdown, pluginPrettier, pluginTypeScript, pluginUnicorn, pluginUnocss, pluginVue, basic as presetBasic, presetJavaScript, presetLangsExtensions, prettier, reactivityTransform, sortPackageJson, sortTsconfig, sxzz, typescript, unicorn, unocss, vue, yml };
package/dist/index.js CHANGED
@@ -7,6 +7,7 @@ import * as _pluginUnicorn from "eslint-plugin-unicorn";
7
7
  import * as _pluginVue from "eslint-plugin-vue";
8
8
  import * as _pluginUnocss from "@unocss/eslint-plugin";
9
9
  import * as _pluginPrettier from "eslint-plugin-prettier";
10
+ import * as _configPrettier from "eslint-config-prettier";
10
11
  import * as pluginImport from "eslint-plugin-i";
11
12
  import * as pluginJsonc from "eslint-plugin-jsonc";
12
13
  import * as pluginUnusedImports from "eslint-plugin-unused-imports";
@@ -15,18 +16,19 @@ import * as parserTypeScript from "@typescript-eslint/parser";
15
16
  import * as parserVue from "vue-eslint-parser";
16
17
  import * as parserYml from "yaml-eslint-parser";
17
18
  import * as parserJsonc from "jsonc-eslint-parser";
18
- import * as configPrettier from "eslint-config-prettier";
19
+ // @__NO_SIDE_EFFECTS__
19
20
  function interopDefault(m) {
20
21
  return m.default || m;
21
22
  }
22
- var pluginAntfu = interopDefault(_pluginAntfu);
23
- var pluginComments = interopDefault(_pluginComments);
24
- var pluginMarkdown = interopDefault(_pluginMarkdown);
25
- var pluginTypeScript = interopDefault(_pluginTypeScript);
26
- var pluginUnicorn = interopDefault(_pluginUnicorn);
27
- var pluginVue = interopDefault(_pluginVue);
28
- var pluginUnocss = interopDefault(_pluginUnocss);
29
- var pluginPrettier = interopDefault(_pluginPrettier);
23
+ var pluginAntfu = /* @__PURE__ */ interopDefault(_pluginAntfu);
24
+ var pluginComments = /* @__PURE__ */ interopDefault(_pluginComments);
25
+ var pluginMarkdown = /* @__PURE__ */ interopDefault(_pluginMarkdown);
26
+ var pluginTypeScript = /* @__PURE__ */ interopDefault(_pluginTypeScript);
27
+ var pluginUnicorn = /* @__PURE__ */ interopDefault(_pluginUnicorn);
28
+ var pluginVue = /* @__PURE__ */ interopDefault(_pluginVue);
29
+ var pluginUnocss = /* @__PURE__ */ interopDefault(_pluginUnocss);
30
+ var pluginPrettier = /* @__PURE__ */ interopDefault(_pluginPrettier);
31
+ var configPrettier = /* @__PURE__ */ interopDefault(_configPrettier);
30
32
 
31
33
  // src/configs/comments.ts
32
34
  var comments = [
@@ -62,60 +64,46 @@ var GLOB_MARKDOWN = "**/*.md";
62
64
  var GLOB_VUE = "**/*.vue";
63
65
  var GLOB_YAML = "**/*.y?(a)ml";
64
66
  var GLOB_HTML = "**/*.htm?(l)";
65
- var GLOB_ALL_SRC = (
66
- /** @type {const} */
67
- [
68
- GLOB_SRC,
69
- GLOB_STYLE,
70
- GLOB_JSON,
71
- GLOB_JSON5,
72
- GLOB_MARKDOWN,
73
- GLOB_VUE,
74
- GLOB_YAML,
75
- GLOB_HTML
76
- ]
77
- );
78
- var GLOB_NODE_MODULES = (
79
- /** @type {const} */
80
- "**/node_modules"
81
- );
82
- var GLOB_DIST = (
83
- /** @type {const} */
84
- "**/dist"
85
- );
86
- var GLOB_LOCKFILE = (
87
- /** @type {const} */
88
- [
89
- "**/package-lock.json",
90
- "**/yarn.lock",
91
- "**/pnpm-lock.yaml"
92
- ]
93
- );
94
- var GLOB_EXCLUDE = (
95
- /** @type {const} */
96
- [
97
- GLOB_NODE_MODULES,
98
- GLOB_DIST,
99
- ...GLOB_LOCKFILE,
100
- "**/output",
101
- "**/coverage",
102
- "**/temp",
103
- "**/fixtures",
104
- "**/.vitepress/cache",
105
- "**/.nuxt",
106
- "**/.vercel",
107
- "**/.changeset",
108
- "**/.idea",
109
- "**/.output",
110
- "**/.vite-inspect",
111
- "**/CHANGELOG*.md",
112
- "**/*.min.*",
113
- "**/LICENSE*",
114
- "**/__snapshots__",
115
- "**/auto-import?(s).d.ts",
116
- "**/components.d.ts"
117
- ]
118
- );
67
+ var GLOB_ALL_SRC = [
68
+ GLOB_SRC,
69
+ GLOB_STYLE,
70
+ GLOB_JSON,
71
+ GLOB_JSON5,
72
+ GLOB_MARKDOWN,
73
+ GLOB_VUE,
74
+ GLOB_YAML,
75
+ GLOB_HTML
76
+ ];
77
+ var GLOB_NODE_MODULES = "**/node_modules";
78
+ var GLOB_DIST = "**/dist";
79
+ var GLOB_LOCKFILE = [
80
+ "**/package-lock.json",
81
+ "**/yarn.lock",
82
+ "**/pnpm-lock.yaml",
83
+ "**/bun.lockb"
84
+ ];
85
+ var GLOB_EXCLUDE = [
86
+ GLOB_NODE_MODULES,
87
+ GLOB_DIST,
88
+ ...GLOB_LOCKFILE,
89
+ "**/output",
90
+ "**/coverage",
91
+ "**/temp",
92
+ "**/fixtures",
93
+ "**/.vitepress/cache",
94
+ "**/.nuxt",
95
+ "**/.vercel",
96
+ "**/.changeset",
97
+ "**/.idea",
98
+ "**/.output",
99
+ "**/.vite-inspect",
100
+ "**/CHANGELOG*.md",
101
+ "**/*.min.*",
102
+ "**/LICENSE*",
103
+ "**/__snapshots__",
104
+ "**/auto-import?(s).d.ts",
105
+ "**/components.d.ts"
106
+ ];
119
107
 
120
108
  // src/configs/ignores.ts
121
109
  var ignores = [{ ignores: GLOB_EXCLUDE }];
@@ -124,10 +112,12 @@ var ignores = [{ ignores: GLOB_EXCLUDE }];
124
112
  var imports = [
125
113
  {
126
114
  plugins: {
127
- import: pluginImport,
128
- antfu: pluginAntfu
115
+ antfu: pluginAntfu,
116
+ import: pluginImport
129
117
  },
130
118
  rules: {
119
+ "antfu/import-dedupe": "error",
120
+ "antfu/prefer-inline-type-import": "error",
131
121
  "import/first": "error",
132
122
  "import/no-default-export": "error",
133
123
  "import/no-duplicates": "error",
@@ -148,12 +138,10 @@ var imports = [
148
138
  "object",
149
139
  "type"
150
140
  ],
151
- pathGroups: [{ pattern: "{{@,~}/,#}**", group: "internal" }],
141
+ pathGroups: [{ group: "internal", pattern: "{{@,~}/,#}**" }],
152
142
  pathGroupsExcludedImportTypes: ["type"]
153
143
  }
154
- ],
155
- "antfu/import-dedupe": "error",
156
- "antfu/prefer-inline-type-import": "error"
144
+ ]
157
145
  }
158
146
  },
159
147
  {
@@ -205,14 +193,20 @@ var javascript = [
205
193
  "unused-imports": pluginUnusedImports
206
194
  },
207
195
  rules: {
196
+ "array-callback-return": "error",
197
+ "block-scoped-var": "error",
208
198
  "constructor-super": "error",
199
+ "dot-notation": "warn",
200
+ eqeqeq: ["error", "smart"],
209
201
  "for-direction": "error",
210
202
  "getter-return": "error",
203
+ "no-alert": "warn",
211
204
  "no-async-promise-executor": "error",
212
205
  "no-case-declarations": "error",
213
206
  "no-class-assign": "error",
214
207
  "no-compare-neg-zero": "error",
215
208
  "no-cond-assign": "error",
209
+ "no-console": ["warn", { allow: ["warn", "error"] }],
216
210
  "no-const-assign": "error",
217
211
  "no-constant-condition": "error",
218
212
  "no-control-regex": "error",
@@ -223,6 +217,7 @@ var javascript = [
223
217
  "no-dupe-else-if": "error",
224
218
  "no-dupe-keys": "error",
225
219
  "no-duplicate-case": "error",
220
+ "no-duplicate-imports": "error",
226
221
  "no-empty": ["error", { allowEmptyCatch: true }],
227
222
  "no-empty-character-class": "error",
228
223
  "no-empty-pattern": "error",
@@ -235,9 +230,11 @@ var javascript = [
235
230
  "no-inner-declarations": "error",
236
231
  "no-invalid-regexp": "error",
237
232
  "no-irregular-whitespace": "error",
233
+ "no-lonely-if": "error",
238
234
  "no-loss-of-precision": "error",
239
235
  "no-misleading-character-class": "error",
240
236
  "no-mixed-spaces-and-tabs": "error",
237
+ "no-multi-str": "error",
241
238
  "no-new-symbol": "error",
242
239
  "no-nonoctal-decimal-escape": "error",
243
240
  "no-obj-calls": "error",
@@ -245,6 +242,13 @@ var javascript = [
245
242
  "no-prototype-builtins": "error",
246
243
  "no-redeclare": "error",
247
244
  "no-regex-spaces": "error",
245
+ "no-restricted-syntax": [
246
+ "error",
247
+ "ForInStatement",
248
+ "LabeledStatement",
249
+ "WithStatement"
250
+ ],
251
+ "no-return-await": "warn",
248
252
  "no-self-assign": "error",
249
253
  "no-setter-return": "error",
250
254
  "no-shadow-restricted-names": "error",
@@ -256,37 +260,26 @@ var javascript = [
256
260
  "no-unsafe-finally": "error",
257
261
  "no-unsafe-negation": "error",
258
262
  "no-unsafe-optional-chaining": "error",
263
+ "no-unused-expressions": [
264
+ "error",
265
+ {
266
+ allowShortCircuit: true,
267
+ allowTaggedTemplates: true,
268
+ allowTernary: true
269
+ }
270
+ ],
259
271
  "no-unused-labels": "error",
260
272
  "no-unused-vars": "off",
261
273
  "no-useless-backreference": "error",
262
274
  "no-useless-catch": "error",
263
275
  "no-useless-escape": "error",
276
+ "no-void": "error",
264
277
  "no-with": "error",
265
- "require-yield": "error",
266
- "use-isnan": [
267
- "error",
268
- { enforceForIndexOf: true, enforceForSwitchCase: true }
269
- ],
270
- "valid-typeof": ["error", { requireStringLiterals: true }],
271
- "no-console": ["warn", { allow: ["warn", "error"] }],
272
- "no-restricted-syntax": [
273
- "error",
274
- "ForInStatement",
275
- "LabeledStatement",
276
- "WithStatement"
277
- ],
278
- "no-return-await": "warn",
279
- "sort-imports": [
278
+ "object-shorthand": [
280
279
  "error",
281
- {
282
- ignoreCase: false,
283
- ignoreDeclarationSort: true,
284
- ignoreMemberSort: false,
285
- memberSyntaxSortOrder: ["none", "all", "multiple", "single"],
286
- allowSeparatedGroups: false
287
- }
280
+ "always",
281
+ { avoidQuotes: true, ignoreConstructors: false }
288
282
  ],
289
- "dot-notation": "warn",
290
283
  "prefer-arrow-callback": [
291
284
  "error",
292
285
  { allowNamedFunctions: false, allowUnboundThis: true }
@@ -296,40 +289,35 @@ var javascript = [
296
289
  { destructuring: "all", ignoreReadBeforeAssign: true }
297
290
  ],
298
291
  "prefer-exponentiation-operator": "error",
299
- "object-shorthand": [
300
- "error",
301
- "always",
302
- { ignoreConstructors: false, avoidQuotes: true }
303
- ],
304
292
  "prefer-regex-literals": ["error", { disallowRedundantWrapping: true }],
305
293
  "prefer-rest-params": "error",
306
294
  "prefer-spread": "error",
307
295
  "prefer-template": "error",
308
296
  "require-await": "error",
309
- "array-callback-return": "error",
310
- "block-scoped-var": "error",
311
- eqeqeq: ["error", "smart"],
312
- "no-alert": "warn",
313
- "no-multi-str": "error",
314
- "no-void": "error",
315
- "no-duplicate-imports": "error",
316
- "no-unused-expressions": [
297
+ "require-yield": "error",
298
+ "sort-imports": [
317
299
  "error",
318
300
  {
319
- allowShortCircuit: true,
320
- allowTernary: true,
321
- allowTaggedTemplates: true
301
+ allowSeparatedGroups: false,
302
+ ignoreCase: false,
303
+ ignoreDeclarationSort: true,
304
+ ignoreMemberSort: false,
305
+ memberSyntaxSortOrder: ["none", "all", "multiple", "single"]
322
306
  }
323
307
  ],
324
- "no-lonely-if": "error",
325
- "wrap-iife": ["error", "any", { functionPrototypeMethods: true }],
326
- "vars-on-top": "error",
327
308
  "unicode-bom": ["error", "never"],
328
309
  "unused-imports/no-unused-imports": isInEditor ? "off" : "error",
329
310
  "unused-imports/no-unused-vars": [
330
311
  "error",
331
312
  { args: "after-used", ignoreRestSiblings: true }
332
- ]
313
+ ],
314
+ "use-isnan": [
315
+ "error",
316
+ { enforceForIndexOf: true, enforceForSwitchCase: true }
317
+ ],
318
+ "valid-typeof": ["error", { requireStringLiterals: true }],
319
+ "vars-on-top": "error",
320
+ "wrap-iife": ["error", "any", { functionPrototypeMethods: true }]
333
321
  }
334
322
  },
335
323
  {
@@ -350,12 +338,12 @@ var javascript = [
350
338
  var jsonc = [
351
339
  {
352
340
  files: [GLOB_JSON, GLOB_JSON5, GLOB_JSONC],
353
- plugins: {
354
- jsonc: pluginJsonc
355
- },
356
341
  languageOptions: {
357
342
  parser: parserJsonc
358
343
  },
344
+ plugins: {
345
+ jsonc: pluginJsonc
346
+ },
359
347
  rules: {
360
348
  ...pluginJsonc.configs["recommended-with-jsonc"].rules,
361
349
  "jsonc/quote-props": "off",
@@ -386,21 +374,21 @@ var markdown = [
386
374
  ...pluginMarkdown.configs.recommended.overrides[1].rules,
387
375
  "@typescript-eslint/comma-dangle": "off",
388
376
  "@typescript-eslint/consistent-type-imports": "off",
377
+ "@typescript-eslint/no-extraneous-class": "off",
389
378
  "@typescript-eslint/no-namespace": "off",
390
379
  "@typescript-eslint/no-redeclare": "off",
391
380
  "@typescript-eslint/no-require-imports": "off",
392
381
  "@typescript-eslint/no-unused-vars": "off",
393
382
  "@typescript-eslint/no-use-before-define": "off",
394
383
  "@typescript-eslint/no-var-requires": "off",
395
- "@typescript-eslint/no-extraneous-class": "off",
396
384
  "no-alert": "off",
397
385
  "no-console": "off",
398
386
  "no-restricted-imports": "off",
399
387
  "no-undef": "off",
400
388
  "no-unused-expressions": "off",
401
389
  "no-unused-vars": "off",
402
- "unused-imports/no-unused-vars": "off",
403
- "unused-imports/no-unused-imports": "off"
390
+ "unused-imports/no-unused-imports": "off",
391
+ "unused-imports/no-unused-vars": "off"
404
392
  }
405
393
  }
406
394
  ];
@@ -429,14 +417,13 @@ var sortPackageJson = [
429
417
  "jsonc/sort-array-values": [
430
418
  "error",
431
419
  {
432
- pathPattern: "^files$",
433
- order: { type: "asc" }
420
+ order: { type: "asc" },
421
+ pathPattern: "^files$"
434
422
  }
435
423
  ],
436
424
  "jsonc/sort-keys": [
437
425
  "error",
438
426
  {
439
- pathPattern: "^$",
440
427
  order: [
441
428
  "name",
442
429
  "version",
@@ -480,15 +467,16 @@ var sortPackageJson = [
480
467
  "lint-staged",
481
468
  "eslintConfig",
482
469
  "prettier"
483
- ]
470
+ ],
471
+ pathPattern: "^$"
484
472
  },
485
473
  {
486
- pathPattern: "^(?:dev|peer|optional|bundled)?[Dd]ependencies$",
487
- order: { type: "asc" }
474
+ order: { type: "asc" },
475
+ pathPattern: "^(?:dev|peer|optional|bundled)?[Dd]ependencies$"
488
476
  },
489
477
  {
490
- pathPattern: "^exports.*$",
491
- order: ["types", "require", "import", "default"]
478
+ order: ["types", "require", "import", "default"],
479
+ pathPattern: "^exports.*$"
492
480
  },
493
481
  {
494
482
  order: { type: "asc" },
@@ -636,12 +624,12 @@ var typescript = [
636
624
  }
637
625
  },
638
626
  plugins: {
639
- "@typescript-eslint": pluginTypeScript
627
+ "@typescript-eslint": pluginTypeScript,
628
+ antfu: pluginAntfu
640
629
  },
641
630
  rules: {
642
631
  ...pluginTypeScript.configs["eslint-recommended"].overrides[0].rules,
643
632
  ...pluginTypeScript.configs.strict.rules,
644
- "@typescript-eslint/no-redeclare": "error",
645
633
  "@typescript-eslint/ban-ts-comment": "off",
646
634
  "@typescript-eslint/ban-types": "off",
647
635
  "@typescript-eslint/consistent-type-assertions": [
@@ -653,13 +641,19 @@ var typescript = [
653
641
  ],
654
642
  "@typescript-eslint/consistent-type-imports": [
655
643
  "error",
656
- { fixStyle: "inline-type-imports", disallowTypeAnnotations: false }
644
+ { disallowTypeAnnotations: false, fixStyle: "inline-type-imports" }
657
645
  ],
658
646
  "@typescript-eslint/no-explicit-any": "off",
659
647
  "@typescript-eslint/no-non-null-assertion": "off",
660
- "@typescript-eslint/prefer-as-const": "warn",
648
+ "@typescript-eslint/no-redeclare": "error",
661
649
  // handled by unused-imports/no-unused-imports
662
- "@typescript-eslint/no-unused-vars": "off"
650
+ "@typescript-eslint/no-unused-vars": "off",
651
+ "@typescript-eslint/prefer-as-const": "warn",
652
+ "@typescript-eslint/prefer-literal-enum-member": [
653
+ "error",
654
+ { allowBitwiseExpressions: true }
655
+ ],
656
+ "antfu/no-const-enum": "error"
663
657
  }
664
658
  },
665
659
  {
@@ -785,11 +779,11 @@ var reactivityTransform = [
785
779
  globals: {
786
780
  $: "readonly",
787
781
  $$: "readonly",
788
- $ref: "readonly",
789
782
  $computed: "readonly",
783
+ $customRef: "readonly",
784
+ $ref: "readonly",
790
785
  $shallowRef: "readonly",
791
- $toRef: "readonly",
792
- $customRef: "readonly"
786
+ $toRef: "readonly"
793
787
  }
794
788
  },
795
789
  plugins: {
@@ -801,41 +795,41 @@ var reactivityTransform = [
801
795
  }
802
796
  ];
803
797
  var vueCustomRules = {
804
- "vue/max-attributes-per-line": "off",
805
- "vue/no-v-html": "off",
806
- "vue/multi-word-component-names": "off",
807
- "vue/require-prop-types": "off",
808
- "vue/require-default-prop": "off",
798
+ "vue/block-order": ["error", { order: ["script", "template", "style"] }],
799
+ "vue/custom-event-name-casing": ["error", "camelCase"],
800
+ "vue/eqeqeq": ["error", "smart"],
809
801
  "vue/html-self-closing": [
810
802
  "error",
811
803
  {
812
804
  html: {
813
- void: "always",
805
+ component: "always",
814
806
  normal: "always",
815
- component: "always"
807
+ void: "always"
816
808
  },
817
- svg: "always",
818
- math: "always"
809
+ math: "always",
810
+ svg: "always"
819
811
  }
820
812
  ],
821
- "vue/block-order": ["error", { order: ["script", "template", "style"] }],
822
- "vue/custom-event-name-casing": ["error", "camelCase"],
823
- "vue/no-useless-v-bind": "error",
824
- "vue/no-unused-refs": "error",
825
- "vue/padding-line-between-blocks": ["error", "always"],
826
- "vue/prefer-template": "error",
827
- "vue/eqeqeq": ["error", "smart"],
813
+ "vue/max-attributes-per-line": "off",
814
+ "vue/multi-word-component-names": "off",
828
815
  "vue/no-constant-condition": "warn",
816
+ "vue/no-empty-pattern": "error",
817
+ "vue/no-loss-of-precision": "error",
818
+ "vue/no-unused-refs": "error",
819
+ "vue/no-useless-v-bind": "error",
820
+ "vue/no-v-html": "off",
829
821
  "vue/object-shorthand": [
830
822
  "error",
831
823
  "always",
832
824
  {
833
- ignoreConstructors: false,
834
- avoidQuotes: true
825
+ avoidQuotes: true,
826
+ ignoreConstructors: false
835
827
  }
836
828
  ],
837
- "vue/no-loss-of-precision": "error",
838
- "vue/no-empty-pattern": "error"
829
+ "vue/padding-line-between-blocks": ["error", "always"],
830
+ "vue/prefer-template": "error",
831
+ "vue/require-default-prop": "off",
832
+ "vue/require-prop-types": "off"
839
833
  };
840
834
  var vue3Rules = {
841
835
  ...pluginVue.configs.base.rules,
@@ -852,21 +846,21 @@ var vue2Rules = {
852
846
  var vue = [
853
847
  {
854
848
  files: [GLOB_VUE],
855
- plugins: {
856
- vue: pluginVue,
857
- "@typescript-eslint": tsPlugin
858
- },
859
849
  languageOptions: {
860
850
  parser: parserVue,
861
851
  parserOptions: {
862
- parser: "@typescript-eslint/parser",
863
- sourceType: "module",
864
- extraFileExtensions: [".vue"],
865
852
  ecmaFeatures: {
866
853
  jsx: true
867
- }
854
+ },
855
+ extraFileExtensions: [".vue"],
856
+ parser: "@typescript-eslint/parser",
857
+ sourceType: "module"
868
858
  }
869
859
  },
860
+ plugins: {
861
+ "@typescript-eslint": tsPlugin,
862
+ vue: pluginVue
863
+ },
870
864
  processor: pluginVue.processors[".vue"],
871
865
  rules: {
872
866
  ...typescript[0].rules
@@ -888,12 +882,12 @@ var vue = [
888
882
  var yml = [
889
883
  {
890
884
  files: [GLOB_YAML],
891
- plugins: {
892
- yml: pluginYml
893
- },
894
885
  languageOptions: {
895
886
  parser: parserYml
896
887
  },
888
+ plugins: {
889
+ yml: pluginYml
890
+ },
897
891
  rules: {
898
892
  ...pluginYml.configs.standard.rules,
899
893
  ...pluginYml.configs.prettier.rules,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sxzz/eslint-config",
3
- "version": "3.6.0",
4
- "packageManager": "pnpm@8.7.6",
3
+ "version": "3.6.2",
4
+ "packageManager": "pnpm@8.8.0",
5
5
  "description": "ESLint config for @sxzz.",
6
6
  "type": "module",
7
7
  "license": "MIT",
@@ -13,6 +13,7 @@
13
13
  "type": "git",
14
14
  "url": "git+https://github.com/sxzz/eslint-config.git"
15
15
  },
16
+ "funding": "https://github.com/sponsors/sxzz",
16
17
  "files": [
17
18
  "dist"
18
19
  ],
@@ -30,12 +31,12 @@
30
31
  "eslint": "^8.0.0"
31
32
  },
32
33
  "dependencies": {
33
- "@typescript-eslint/eslint-plugin": "^6.7.2",
34
- "@typescript-eslint/parser": "^6.7.2",
35
- "@unocss/eslint-plugin": "^0.55.7",
34
+ "@typescript-eslint/eslint-plugin": "^6.7.3",
35
+ "@typescript-eslint/parser": "^6.7.3",
36
+ "@unocss/eslint-plugin": "^0.56.4",
36
37
  "eslint-config-prettier": "^9.0.0",
37
38
  "eslint-define-config": "^1.23.0",
38
- "eslint-plugin-antfu": "^0.42.1",
39
+ "eslint-plugin-antfu": "^0.43.1",
39
40
  "eslint-plugin-eslint-comments": "^3.2.0",
40
41
  "eslint-plugin-i": "^2.28.1",
41
42
  "eslint-plugin-jsonc": "^2.9.0",
@@ -47,16 +48,17 @@
47
48
  "eslint-plugin-yml": "^1.9.0",
48
49
  "globals": "^13.22.0",
49
50
  "jsonc-eslint-parser": "^2.3.0",
50
- "local-pkg": "^0.4.3",
51
+ "local-pkg": "^0.5.0",
51
52
  "prettier": "^3.0.3",
52
53
  "vue-eslint-parser": "^9.3.1",
53
54
  "yaml-eslint-parser": "^1.2.2"
54
55
  },
55
56
  "devDependencies": {
56
57
  "@sxzz/prettier-config": "^1.0.4",
57
- "@types/node": "^20.6.3",
58
+ "@types/node": "^20.8.0",
58
59
  "bumpp": "^9.2.0",
59
- "eslint": "^8.49.0",
60
+ "eslint": "^8.50.0",
61
+ "eslint-plugin-sort-keys": "^2.3.5",
60
62
  "sucrase": "^3.34.0",
61
63
  "tsup": "^7.2.0",
62
64
  "typescript": "^5.2.2"