@sxzz/eslint-config 7.2.0 → 7.2.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/dist/index.d.ts CHANGED
@@ -1,27 +1,27 @@
1
1
  import pluginAntfu from "eslint-plugin-antfu";
2
2
  import pluginSxzz from "eslint-plugin-sxzz";
3
3
  import pluginMarkdown from "@eslint/markdown";
4
- import tseslint from "typescript-eslint";
5
4
  import pluginUnicorn from "eslint-plugin-unicorn";
5
+ import pluginUnusedImports from "eslint-plugin-unused-imports";
6
+ import pluginJsdoc from "eslint-plugin-jsdoc";
7
+ import pluginIgnore from "eslint-config-flat-gitignore";
8
+ import pluginPnpm from "eslint-plugin-pnpm";
9
+ import * as pluginImport from "eslint-plugin-import-x";
10
+ import configCommand from "eslint-plugin-command/config";
11
+ import tseslint from "typescript-eslint";
6
12
  import pluginVue from "eslint-plugin-vue";
7
13
  import pluginNode from "eslint-plugin-n";
8
14
  import pluginPerfectionist from "eslint-plugin-perfectionist";
9
15
  import pluginPrettier from "eslint-plugin-prettier";
10
16
  import pluginPrettierRecommended from "eslint-plugin-prettier/recommended";
11
- import pluginUnusedImports from "eslint-plugin-unused-imports";
12
- import pluginJsdoc from "eslint-plugin-jsdoc";
13
- import pluginIgnore from "eslint-config-flat-gitignore";
14
17
  import pluginDeMorgan from "eslint-plugin-de-morgan";
15
- import pluginPnpm from "eslint-plugin-pnpm";
16
- import * as pluginImport from "eslint-plugin-import-x";
17
- import * as pluginJsonc from "eslint-plugin-jsonc";
18
- import * as pluginYml from "eslint-plugin-yml";
18
+ import pluginJsonc from "eslint-plugin-jsonc";
19
+ import pluginYml from "eslint-plugin-yml";
19
20
  import configJs from "@eslint/js";
20
21
  import configComments from "@eslint-community/eslint-plugin-eslint-comments/configs";
21
- import configCommand from "eslint-plugin-command/config";
22
- import * as parserVue from "vue-eslint-parser";
23
- import * as parserYml from "yaml-eslint-parser";
24
- import * as parserJsonc from "jsonc-eslint-parser";
22
+ import parserVue from "vue-eslint-parser";
23
+ import parserYml from "yaml-eslint-parser";
24
+ import parserJsonc from "jsonc-eslint-parser";
25
25
  import { Arrayable, Awaitable, FlatConfigComposer } from "eslint-flat-config-utils";
26
26
  import { Linter } from "eslint";
27
27
 
@@ -1475,6 +1475,11 @@ interface Rules {
1475
1475
  */
1476
1476
  "jsdoc/no-undefined-types"?: Linter.RuleEntry<JsdocNoUndefinedTypes>;
1477
1477
  /**
1478
+ * Prefer `@import` tags to inline `import()` statements.
1479
+ * @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/prefer-import-tag.md#repos-sticky-header
1480
+ */
1481
+ "jsdoc/prefer-import-tag"?: Linter.RuleEntry<JsdocPreferImportTag>;
1482
+ /**
1478
1483
  * Reports use of `any` or `*` type
1479
1484
  * @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/reject-any-type.md#repos-sticky-header
1480
1485
  */
@@ -1991,7 +1996,7 @@ interface Rules {
1991
1996
  * Disallow missing label references
1992
1997
  * @see https://github.com/eslint/markdown/blob/main/docs/rules/no-missing-label-refs.md
1993
1998
  */
1994
- "markdown/no-missing-label-refs"?: Linter.RuleEntry<[]>;
1999
+ "markdown/no-missing-label-refs"?: Linter.RuleEntry<MarkdownNoMissingLabelRefs>;
1995
2000
  /**
1996
2001
  * Disallow link fragments that do not reference valid headings
1997
2002
  * @see https://github.com/eslint/markdown/blob/main/docs/rules/no-missing-link-fragments.md
@@ -2003,6 +2008,11 @@ interface Rules {
2003
2008
  */
2004
2009
  "markdown/no-multiple-h1"?: Linter.RuleEntry<MarkdownNoMultipleH1>;
2005
2010
  /**
2011
+ * Disallow URLs that match defined reference identifiers
2012
+ * @see https://github.com/eslint/markdown/blob/main/docs/rules/no-reference-like-urls.md
2013
+ */
2014
+ "markdown/no-reference-like-urls"?: Linter.RuleEntry<[]>;
2015
+ /**
2006
2016
  * Disallow reversed link and image syntax
2007
2017
  * @see https://github.com/eslint/markdown/blob/main/docs/rules/no-reversed-media-syntax.md
2008
2018
  */
@@ -6427,10 +6437,16 @@ type JsdocNoTypes = [] | [{
6427
6437
  })[];
6428
6438
  }];
6429
6439
  type JsdocNoUndefinedTypes = [] | [{
6440
+ checkUsedTypedefs?: boolean;
6430
6441
  definedTypes?: string[];
6431
6442
  disableReporting?: boolean;
6432
6443
  markVariablesAsUsed?: boolean;
6433
6444
  }];
6445
+ type JsdocPreferImportTag = [] | [{
6446
+ enableFixer?: boolean;
6447
+ exemptTypedefs?: boolean;
6448
+ outputType?: ("named-import" | "namespaced-import");
6449
+ }];
6434
6450
  type JsdocRequireAsteriskPrefix = [] | [("always" | "never" | "any")] | [("always" | "never" | "any"), {
6435
6451
  tags?: {
6436
6452
  always?: string[];
@@ -7322,6 +7338,9 @@ type MarkdownNoHtml = [] | [{
7322
7338
  type MarkdownNoMissingAtxHeadingSpace = [] | [{
7323
7339
  checkClosedHeadings?: boolean;
7324
7340
  }];
7341
+ type MarkdownNoMissingLabelRefs = [] | [{
7342
+ allowLabels?: string[];
7343
+ }];
7325
7344
  type MarkdownNoMissingLinkFragments = [] | [{
7326
7345
  ignoreCase?: boolean;
7327
7346
  allowPattern?: string;
@@ -9802,6 +9821,7 @@ type PnpmJsonEnforceCatalog = [] | [{
9802
9821
  reuseExistingCatalog?: boolean;
9803
9822
  conflicts?: ("new-catalog" | "overrides" | "error");
9804
9823
  fields?: string[];
9824
+ ignores?: string[];
9805
9825
  }];
9806
9826
  type PnpmJsonPreferWorkspaceSettings = [] | [{
9807
9827
  autofix?: boolean;
@@ -10477,7 +10497,7 @@ type Yoda = [] | [("always" | "never")] | [("always" | "never"), {
10477
10497
  exceptRange?: boolean;
10478
10498
  onlyEquality?: boolean;
10479
10499
  }];
10480
- type ConfigNames = "sxzz/global-ignores" | "sxzz/gitignore" | "sxzz/js/recommended" | "sxzz/js" | "sxzz/comments/recommended" | "sxzz/comments" | "sxzz/imports" | "sxzz/unicorn/unopinionated" | "sxzz/unicorn" | "sxzz/node" | "sxzz/jsdoc" | "sxzz/regexp" | "sxzz/de-morgan" | "sxzz/typescript__typescript-eslint/base" | "sxzz/typescript__typescript-eslint/eslint-recommended" | "sxzz/typescript__typescript-eslint/recommended" | "sxzz/typescript" | "sxzz/typescript/dts-rules" | "sxzz/typescript/cjs-rules" | "sxzz/sort/imports" | "sxzz/markdown/recommended/plugin" | "sxzz/markdown/recommended/processor" | "sxzz/markdown/recommended/code-blocks" | "sxzz/markdown-rules" | "sxzz/yaml/setup" | "sxzz/yaml/rules" | "sxzz/json" | "sxzz/sort/package.json" | "sxzz/sort/tsconfig" | "sxzz/sort/pnpm-workspace" | "sxzz/vue/typescript__typescript-eslint/base" | "sxzz/vue/typescript__typescript-eslint/eslint-recommended" | "sxzz/vue/typescript__typescript-eslint/recommended" | "sxzz/vue/typescript" | "sxzz/vue" | "sxzz/vue/reactivity-transform" | "sxzz/unocss" | "sxzz/prettier" | "sxzz/command" | "sxzz/pnpm/package-json" | "sxzz/pnpm/pnpm-workspace-yaml" | "sxzz/special/cli" | "sxzz/special/tests" | "sxzz/special/allow-default-export" | "sxzz/special/github";
10500
+ type ConfigNames = "sxzz/global-ignores" | "sxzz/gitignore" | "sxzz/js/recommended" | "sxzz/js" | "sxzz/comments/recommended" | "sxzz/comments" | "sxzz/imports" | "sxzz/unicorn/unopinionated" | "sxzz/unicorn" | "sxzz/node" | "sxzz/jsdoc" | "sxzz/regexp" | "sxzz/de-morgan" | "sxzz/typescript__typescript-eslint/base" | "sxzz/typescript__typescript-eslint/eslint-recommended" | "sxzz/typescript__typescript-eslint/recommended" | "sxzz/typescript" | "sxzz/typescript/dts-rules" | "sxzz/typescript/cjs-rules" | "sxzz/sort/imports" | "sxzz/markdown/recommended/plugin" | "sxzz/markdown/recommended/processor" | "sxzz/markdown/recommended/code-blocks" | "sxzz/markdown-rules" | "sxzz/yaml/setup" | "sxzz/yaml/rules" | "sxzz/json" | "sxzz/sort/package.json" | "sxzz/sort/tsconfig" | "sxzz/sort/pnpm-workspace" | "sxzz/vue/typescript__typescript-eslint/base" | "sxzz/vue/typescript__typescript-eslint/eslint-recommended" | "sxzz/vue/typescript__typescript-eslint/recommended" | "sxzz/vue/typescript" | "sxzz/vue" | "sxzz/vue/reactivity-transform" | "sxzz/unocss" | "sxzz/prettier" | "sxzz/command" | "sxzz/pnpm/package-json" | "sxzz/pnpm/pnpm-workspace-yaml" | "sxzz/special/cli" | "sxzz/special/tests" | "sxzz/special/allow-default-export" | "sxzz/special/github" | "sxzz/special/components";
10481
10501
  //#endregion
10482
10502
  //#region src/types.d.ts
10483
10503
  type Config = Omit<Linter.Config<Linter.RulesRecord & Rules>, "plugins"> & {
@@ -10566,7 +10586,7 @@ declare function isInGitHooksOrLintStaged(): boolean;
10566
10586
  declare const GLOB_SRC_EXT = "?([cm])[jt]s?(x)";
10567
10587
  declare const GLOB_SRC = "**/*.?([cm])[jt]s?(x)";
10568
10588
  declare const GLOB_JS = "**/*.?([cm])js";
10569
- declare const GLOB_JSX = "**/*.?([cm])jsx";
10589
+ declare const GLOB_JSX = "**/*.jsx";
10570
10590
  declare const GLOB_TS = "**/*.?([cm])ts";
10571
10591
  declare const GLOB_TSX = "**/*.tsx";
10572
10592
  declare const GLOB_STYLE = "**/*.{c,le,sc}ss";
package/dist/index.js CHANGED
@@ -1,33 +1,39 @@
1
+ import { createRequire } from "node:module";
1
2
  import pluginAntfu from "eslint-plugin-antfu";
2
3
  import pluginSxzz from "eslint-plugin-sxzz";
3
4
  import pluginMarkdown from "@eslint/markdown";
4
- import tseslint from "typescript-eslint";
5
5
  import pluginUnicorn from "eslint-plugin-unicorn";
6
- import pluginVue from "eslint-plugin-vue";
7
- import pluginNode from "eslint-plugin-n";
8
- import pluginPerfectionist from "eslint-plugin-perfectionist";
9
- import pluginPrettier from "eslint-plugin-prettier";
10
- import pluginPrettierRecommended from "eslint-plugin-prettier/recommended";
11
6
  import pluginUnusedImports from "eslint-plugin-unused-imports";
12
7
  import pluginJsdoc from "eslint-plugin-jsdoc";
13
8
  import pluginIgnore from "eslint-config-flat-gitignore";
14
- import pluginDeMorgan from "eslint-plugin-de-morgan";
15
9
  import pluginPnpm from "eslint-plugin-pnpm";
16
10
  import * as pluginImport from "eslint-plugin-import-x";
17
- import * as pluginJsonc from "eslint-plugin-jsonc";
18
- import * as pluginYml from "eslint-plugin-yml";
19
- import configJs from "@eslint/js";
20
- import configComments from "@eslint-community/eslint-plugin-eslint-comments/configs";
21
11
  import configCommand from "eslint-plugin-command/config";
22
- import * as parserVue from "vue-eslint-parser";
23
- import * as parserYml from "yaml-eslint-parser";
24
- import * as parserJsonc from "jsonc-eslint-parser";
25
- import globals from "globals";
26
- import { configs } from "eslint-plugin-regexp";
27
12
  import process from "node:process";
28
13
  import { isPackageExists } from "local-pkg";
29
14
  import { FlatConfigComposer } from "eslint-flat-config-utils";
30
15
 
16
+ //#region rolldown:runtime
17
+ var __require = /* @__PURE__ */ createRequire(import.meta.url);
18
+
19
+ //#endregion
20
+ //#region src/plugins.ts
21
+ const tseslint = __require("typescript-eslint");
22
+ const pluginVue = __require("eslint-plugin-vue");
23
+ const pluginNode = __require("eslint-plugin-n");
24
+ const pluginPerfectionist = __require("eslint-plugin-perfectionist");
25
+ const pluginPrettier = __require("eslint-plugin-prettier");
26
+ const pluginPrettierRecommended = __require("eslint-plugin-prettier/recommended");
27
+ const pluginDeMorgan = __require("eslint-plugin-de-morgan");
28
+ const pluginJsonc = __require("eslint-plugin-jsonc");
29
+ const pluginYml = __require("eslint-plugin-yml");
30
+ const configJs = __require("@eslint/js");
31
+ const configComments = __require("@eslint-community/eslint-plugin-eslint-comments/configs");
32
+ const parserVue = __require("vue-eslint-parser");
33
+ const parserYml = __require("yaml-eslint-parser");
34
+ const parserJsonc = __require("jsonc-eslint-parser");
35
+
36
+ //#endregion
31
37
  //#region src/configs/command.ts
32
38
  const command = () => [{
33
39
  ...configCommand(),
@@ -56,7 +62,7 @@ const deMorgan = () => [{
56
62
  const GLOB_SRC_EXT = "?([cm])[jt]s?(x)";
57
63
  const GLOB_SRC = "**/*.?([cm])[jt]s?(x)";
58
64
  const GLOB_JS = "**/*.?([cm])js";
59
- const GLOB_JSX = "**/*.?([cm])jsx";
65
+ const GLOB_JSX = "**/*.jsx";
60
66
  const GLOB_TS = "**/*.?([cm])ts";
61
67
  const GLOB_TSX = "**/*.tsx";
62
68
  const GLOB_STYLE = "**/*.{c,le,sc}ss";
@@ -144,6 +150,7 @@ const imports = () => [{
144
150
 
145
151
  //#endregion
146
152
  //#region src/configs/javascript.ts
153
+ const globals = __require("globals");
147
154
  const restrictedSyntaxJs = ["ForInStatement", "LabeledStatement"];
148
155
  const javascript = () => [{
149
156
  ...configJs.configs.recommended,
@@ -152,7 +159,7 @@ const javascript = () => [{
152
159
  languageOptions: {
153
160
  globals: {
154
161
  ...globals.browser,
155
- ...globals.es2021,
162
+ ...globals.es2026,
156
163
  ...globals.node
157
164
  },
158
165
  parserOptions: {
@@ -305,6 +312,8 @@ const markdown = () => [...pluginMarkdown.configs.processor.map((config) => ({
305
312
  "no-unused-vars": "off",
306
313
  "node/prefer-global/buffer": "off",
307
314
  "node/prefer-global/process": "off",
315
+ "unicorn/no-anonymous-default-export": "off",
316
+ "unicorn/no-useless-undefined": "off",
308
317
  "unused-imports/no-unused-imports": "off",
309
318
  "unused-imports/no-unused-vars": "off"
310
319
  }
@@ -368,6 +377,7 @@ const prettier = () => [{
368
377
 
369
378
  //#endregion
370
379
  //#region src/configs/regexp.ts
380
+ const { configs } = __require("eslint-plugin-regexp");
371
381
  const regexp = () => [{
372
382
  ...configs["flat/recommended"],
373
383
  name: "sxzz/regexp"
@@ -674,6 +684,15 @@ const specialCases = () => [
674
684
  files: ["**/ISSUE_TEMPLATE/**"],
675
685
  name: "sxzz/special/github",
676
686
  rules: { "unicorn/filename-case": "off" }
687
+ },
688
+ {
689
+ files: [
690
+ GLOB_VUE,
691
+ GLOB_JSX,
692
+ GLOB_TSX
693
+ ],
694
+ name: "sxzz/special/components",
695
+ rules: { "unicorn/no-anonymous-default-export": "off" }
677
696
  }
678
697
  ];
679
698
 
@@ -763,6 +782,7 @@ const unicorn = () => [{
763
782
  "unicorn/no-this-assignment": "off",
764
783
  "unicorn/no-unreadable-array-destructuring": "off",
765
784
  "unicorn/numeric-separators-style": "off",
785
+ "unicorn/prefer-module": "off",
766
786
  "unicorn/prefer-query-selector": "error",
767
787
  "unicorn/prefer-top-level-await": "off",
768
788
  "unicorn/require-module-specifiers": "off"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sxzz/eslint-config",
3
- "version": "7.2.0",
3
+ "version": "7.2.2",
4
4
  "description": "ESLint config for @sxzz.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -39,7 +39,7 @@
39
39
  "dependencies": {
40
40
  "@eslint-community/eslint-plugin-eslint-comments": "^4.5.0",
41
41
  "@eslint/js": "^9.36.0",
42
- "@eslint/markdown": "^7.2.0",
42
+ "@eslint/markdown": "^7.3.0",
43
43
  "eslint-config-flat-gitignore": "^2.1.0",
44
44
  "eslint-config-prettier": "^10.1.8",
45
45
  "eslint-flat-config-utils": "^2.1.4",
@@ -47,11 +47,11 @@
47
47
  "eslint-plugin-command": "^3.3.1",
48
48
  "eslint-plugin-de-morgan": "^1.3.1",
49
49
  "eslint-plugin-import-x": "^4.16.1",
50
- "eslint-plugin-jsdoc": "^60.1.1",
50
+ "eslint-plugin-jsdoc": "^60.3.1",
51
51
  "eslint-plugin-jsonc": "^2.20.1",
52
52
  "eslint-plugin-n": "^17.23.1",
53
53
  "eslint-plugin-perfectionist": "^4.15.0",
54
- "eslint-plugin-pnpm": "^1.1.1",
54
+ "eslint-plugin-pnpm": "^1.1.2",
55
55
  "eslint-plugin-prettier": "^5.5.4",
56
56
  "eslint-plugin-regexp": "^2.10.0",
57
57
  "eslint-plugin-sxzz": "^0.4.1",
@@ -63,7 +63,7 @@
63
63
  "jsonc-eslint-parser": "^2.4.1",
64
64
  "local-pkg": "^1.1.2",
65
65
  "prettier": "^3.6.2",
66
- "typescript-eslint": "^8.44.0",
66
+ "typescript-eslint": "^8.44.1",
67
67
  "vue-eslint-parser": "^10.2.0",
68
68
  "yaml-eslint-parser": "^1.3.0"
69
69
  },
@@ -71,11 +71,12 @@
71
71
  "@eslint/config-inspector": "^1.3.0",
72
72
  "@sxzz/prettier-config": "^2.2.4",
73
73
  "@types/node": "^24.5.2",
74
- "@unocss/eslint-plugin": "^66.5.1",
74
+ "@unocss/eslint-plugin": "^66.5.2",
75
75
  "ansis": "^4.1.0",
76
76
  "bumpp": "^10.2.3",
77
77
  "eslint": "^9.36.0",
78
78
  "eslint-typegen": "^2.3.0",
79
+ "rolldown-plugin-require-cjs": "^0.1.5",
79
80
  "tsdown": "^0.15.4",
80
81
  "tsx": "^4.20.5",
81
82
  "typescript": "^5.9.2"