@coderwyd/eslint-config 2.5.6 → 2.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -71,16 +71,16 @@ Add the following settings to your `.vscode/settings.json`:
71
71
 
72
72
  // Silent the stylistic rules in you IDE, but still auto fix them
73
73
  "eslint.rules.customizations": [
74
- { "rule": "style/*", "severity": "off" },
75
- { "rule": "format/*", "severity": "off" },
76
- { "rule": "*-indent", "severity": "off" },
77
- { "rule": "*-spacing", "severity": "off" },
78
- { "rule": "*-spaces", "severity": "off" },
79
- { "rule": "*-order", "severity": "off" },
80
- { "rule": "*-dangle", "severity": "off" },
81
- { "rule": "*-newline", "severity": "off" },
82
- { "rule": "*quotes", "severity": "off" },
83
- { "rule": "*semi", "severity": "off" }
74
+ { "rule": "style/*", "severity": "off", "fixable": true },
75
+ { "rule": "format/*", "severity": "off", "fixable": true },
76
+ { "rule": "*-indent", "severity": "off", "fixable": true },
77
+ { "rule": "*-spacing", "severity": "off", "fixable": true },
78
+ { "rule": "*-spaces", "severity": "off", "fixable": true },
79
+ { "rule": "*-order", "severity": "off", "fixable": true },
80
+ { "rule": "*-dangle", "severity": "off", "fixable": true },
81
+ { "rule": "*-newline", "severity": "off", "fixable": true },
82
+ { "rule": "*quotes", "severity": "off", "fixable": true },
83
+ { "rule": "*semi", "severity": "off", "fixable": true }
84
84
  ],
85
85
 
86
86
  // Enable eslint for all supported languages
package/dist/cli.cjs CHANGED
@@ -46,35 +46,35 @@ var import_parse_gitignore = __toESM(require("parse-gitignore"), 1);
46
46
  var import_picocolors = __toESM(require("picocolors"), 1);
47
47
 
48
48
  // package.json
49
- var version = "2.5.6";
49
+ var version = "2.6.1";
50
50
  var devDependencies = {
51
- "@antfu/ni": "^0.21.12",
52
- "@eslint-react/eslint-plugin": "^1.5.20",
53
- "@eslint/config-inspector": "^0.5.1",
51
+ "@antfu/ni": "^0.22.0",
52
+ "@eslint-react/eslint-plugin": "^1.5.30",
53
+ "@eslint/config-inspector": "^0.5.2",
54
54
  "@stylistic/eslint-plugin-migrate": "^2.3.0",
55
- "@types/eslint": "^8.56.10",
55
+ "@types/eslint": "^8.56.11",
56
56
  "@types/fs-extra": "^11.0.4",
57
- "@types/node": "^20.14.9",
57
+ "@types/node": "^20.14.11",
58
58
  "@types/prompts": "^2.4.9",
59
59
  "@types/yargs": "^17.0.32",
60
- "@unocss/eslint-plugin": "^0.61.0",
60
+ "@unocss/eslint-plugin": "^0.61.5",
61
61
  bumpp: "^9.4.1",
62
- eslint: "^9.6.0",
62
+ eslint: "^9.7.0",
63
63
  "eslint-plugin-react-hooks": "^4.6.2",
64
- "eslint-plugin-react-refresh": "^0.4.7",
65
- "eslint-plugin-svelte": "2.39.5",
64
+ "eslint-plugin-react-refresh": "^0.4.9",
65
+ "eslint-plugin-svelte": "2.43.0",
66
66
  "eslint-plugin-tailwindcss": "^3.17.4",
67
67
  execa: "^9.3.0",
68
68
  "fast-glob": "^3.3.2",
69
69
  "fs-extra": "^11.2.0",
70
70
  "lint-staged": "^15.2.7",
71
- rimraf: "^5.0.7",
71
+ rimraf: "^6.0.1",
72
72
  "simple-git-hooks": "^2.11.1",
73
73
  svelte: "^4.2.18",
74
- "svelte-eslint-parser": "^0.39.2",
75
- tsup: "^8.1.0",
76
- tsx: "^4.16.0",
77
- typescript: "^5.5.3"
74
+ "svelte-eslint-parser": "^0.41.0",
75
+ tsup: "^8.2.2",
76
+ tsx: "^4.16.2",
77
+ typescript: "^5.5.4"
78
78
  };
79
79
 
80
80
  // src/cli/constants.ts
@@ -96,16 +96,16 @@ var vscodeSettingsString = `
96
96
 
97
97
  // Silent the stylistic rules in you IDE, but still auto fix them
98
98
  "eslint.rules.customizations": [
99
- { "rule": "style/*", "severity": "off" },
100
- { "rule": "format/*", "severity": "off" },
101
- { "rule": "*-indent", "severity": "off" },
102
- { "rule": "*-spacing", "severity": "off" },
103
- { "rule": "*-spaces", "severity": "off" },
104
- { "rule": "*-order", "severity": "off" },
105
- { "rule": "*-dangle", "severity": "off" },
106
- { "rule": "*-newline", "severity": "off" },
107
- { "rule": "*quotes", "severity": "off" },
108
- { "rule": "*semi", "severity": "off" }
99
+ { "rule": "style/*", "severity": "off", "fixable": true },
100
+ { "rule": "format/*", "severity": "off", "fixable": true },
101
+ { "rule": "*-indent", "severity": "off", "fixable": true },
102
+ { "rule": "*-spacing", "severity": "off", "fixable": true },
103
+ { "rule": "*-spaces", "severity": "off", "fixable": true },
104
+ { "rule": "*-order", "severity": "off", "fixable": true },
105
+ { "rule": "*-dangle", "severity": "off", "fixable": true },
106
+ { "rule": "*-newline", "severity": "off", "fixable": true },
107
+ { "rule": "*quotes", "severity": "off", "fixable": true },
108
+ { "rule": "*semi", "severity": "off", "fixable": true }
109
109
  ],
110
110
 
111
111
  // Enable eslint for all supported languages
package/dist/cli.js CHANGED
@@ -17,35 +17,35 @@ import parse from "parse-gitignore";
17
17
  import c from "picocolors";
18
18
 
19
19
  // package.json
20
- var version = "2.5.6";
20
+ var version = "2.6.1";
21
21
  var devDependencies = {
22
- "@antfu/ni": "^0.21.12",
23
- "@eslint-react/eslint-plugin": "^1.5.20",
24
- "@eslint/config-inspector": "^0.5.1",
22
+ "@antfu/ni": "^0.22.0",
23
+ "@eslint-react/eslint-plugin": "^1.5.30",
24
+ "@eslint/config-inspector": "^0.5.2",
25
25
  "@stylistic/eslint-plugin-migrate": "^2.3.0",
26
- "@types/eslint": "^8.56.10",
26
+ "@types/eslint": "^8.56.11",
27
27
  "@types/fs-extra": "^11.0.4",
28
- "@types/node": "^20.14.9",
28
+ "@types/node": "^20.14.11",
29
29
  "@types/prompts": "^2.4.9",
30
30
  "@types/yargs": "^17.0.32",
31
- "@unocss/eslint-plugin": "^0.61.0",
31
+ "@unocss/eslint-plugin": "^0.61.5",
32
32
  bumpp: "^9.4.1",
33
- eslint: "^9.6.0",
33
+ eslint: "^9.7.0",
34
34
  "eslint-plugin-react-hooks": "^4.6.2",
35
- "eslint-plugin-react-refresh": "^0.4.7",
36
- "eslint-plugin-svelte": "2.39.5",
35
+ "eslint-plugin-react-refresh": "^0.4.9",
36
+ "eslint-plugin-svelte": "2.43.0",
37
37
  "eslint-plugin-tailwindcss": "^3.17.4",
38
38
  execa: "^9.3.0",
39
39
  "fast-glob": "^3.3.2",
40
40
  "fs-extra": "^11.2.0",
41
41
  "lint-staged": "^15.2.7",
42
- rimraf: "^5.0.7",
42
+ rimraf: "^6.0.1",
43
43
  "simple-git-hooks": "^2.11.1",
44
44
  svelte: "^4.2.18",
45
- "svelte-eslint-parser": "^0.39.2",
46
- tsup: "^8.1.0",
47
- tsx: "^4.16.0",
48
- typescript: "^5.5.3"
45
+ "svelte-eslint-parser": "^0.41.0",
46
+ tsup: "^8.2.2",
47
+ tsx: "^4.16.2",
48
+ typescript: "^5.5.4"
49
49
  };
50
50
 
51
51
  // src/cli/constants.ts
@@ -67,16 +67,16 @@ var vscodeSettingsString = `
67
67
 
68
68
  // Silent the stylistic rules in you IDE, but still auto fix them
69
69
  "eslint.rules.customizations": [
70
- { "rule": "style/*", "severity": "off" },
71
- { "rule": "format/*", "severity": "off" },
72
- { "rule": "*-indent", "severity": "off" },
73
- { "rule": "*-spacing", "severity": "off" },
74
- { "rule": "*-spaces", "severity": "off" },
75
- { "rule": "*-order", "severity": "off" },
76
- { "rule": "*-dangle", "severity": "off" },
77
- { "rule": "*-newline", "severity": "off" },
78
- { "rule": "*quotes", "severity": "off" },
79
- { "rule": "*semi", "severity": "off" }
70
+ { "rule": "style/*", "severity": "off", "fixable": true },
71
+ { "rule": "format/*", "severity": "off", "fixable": true },
72
+ { "rule": "*-indent", "severity": "off", "fixable": true },
73
+ { "rule": "*-spacing", "severity": "off", "fixable": true },
74
+ { "rule": "*-spaces", "severity": "off", "fixable": true },
75
+ { "rule": "*-order", "severity": "off", "fixable": true },
76
+ { "rule": "*-dangle", "severity": "off", "fixable": true },
77
+ { "rule": "*-newline", "severity": "off", "fixable": true },
78
+ { "rule": "*quotes", "severity": "off", "fixable": true },
79
+ { "rule": "*semi", "severity": "off", "fixable": true }
80
80
  ],
81
81
 
82
82
  // Enable eslint for all supported languages
package/dist/index.cjs CHANGED
@@ -44,7 +44,6 @@ __export(src_exports, {
44
44
  toArray: () => toArray
45
45
  });
46
46
  module.exports = __toCommonJS(src_exports);
47
- var import_node_fs = __toESM(require("fs"), 1);
48
47
 
49
48
  // src/plugins/index.ts
50
49
  var import_eslint_plugin_antfu = __toESM(require("eslint-plugin-antfu"), 1);
@@ -76,7 +75,6 @@ async function comments() {
76
75
  // src/constants/glob.ts
77
76
  var GLOB_SRC_EXT = "?([cm])[jt]s?(x)";
78
77
  var GLOB_SRC = "**/*.?([cm])[jt]s?(x)";
79
- var GLOB_JS = "**/*.?([cm])js";
80
78
  var GLOB_JSX = "**/*.?([cm])jsx";
81
79
  var GLOB_TS = "**/*.?([cm])ts";
82
80
  var GLOB_DTS = "**/*.d.?([cm])ts";
@@ -121,6 +119,7 @@ var GLOB_EXCLUDE = [
121
119
  "**/.vitepress/cache",
122
120
  "**/.nuxt",
123
121
  "**/.next",
122
+ "**/.svelte-kit",
124
123
  "**/.vercel",
125
124
  "**/.changeset",
126
125
  "**/.idea",
@@ -900,6 +899,7 @@ function sortTsconfig() {
900
899
  "allowSyntheticDefaultImports",
901
900
  "esModuleInterop",
902
901
  "forceConsistentCasingInFileNames",
902
+ "isolatedDeclarations",
903
903
  "isolatedModules",
904
904
  "preserveSymlinks",
905
905
  "verbatimModuleSyntax",
@@ -977,19 +977,17 @@ async function typescript(options = {}) {
977
977
  `${GLOB_MARKDOWN}/**`,
978
978
  GLOB_ASTRO_TS
979
979
  ];
980
- const tsconfigPath = options?.tsconfigPath ? toArray(options.tsconfigPath) : void 0;
980
+ const tsconfigPath = options.tsconfigPath;
981
981
  const isTypeAware = !!tsconfigPath;
982
982
  const typeAwareRules = {
983
983
  "dot-notation": "off",
984
984
  "no-implied-eval": "off",
985
- "no-throw-literal": "off",
986
985
  "ts/await-thenable": "error",
987
986
  "ts/dot-notation": ["error", { allowKeywords: true }],
988
987
  "ts/no-floating-promises": "error",
989
988
  "ts/no-for-in-array": "error",
990
989
  "ts/no-implied-eval": "error",
991
990
  "ts/no-misused-promises": "error",
992
- "ts/no-throw-literal": "error",
993
991
  "ts/no-unnecessary-type-assertion": "error",
994
992
  "ts/no-unsafe-argument": "error",
995
993
  "ts/no-unsafe-assignment": "error",
@@ -1018,7 +1016,10 @@ async function typescript(options = {}) {
1018
1016
  extraFileExtensions: componentExts.map((ext) => `.${ext}`),
1019
1017
  sourceType: "module",
1020
1018
  ...typeAware ? {
1021
- project: tsconfigPath,
1019
+ projectService: {
1020
+ allowDefaultProject: ["./*.js"],
1021
+ defaultProject: tsconfigPath
1022
+ },
1022
1023
  tsconfigRootDir: import_node_process2.default.cwd()
1023
1024
  } : {},
1024
1025
  ...parserOptions
@@ -1059,9 +1060,8 @@ async function typescript(options = {}) {
1059
1060
  "no-useless-constructor": "off",
1060
1061
  "ts/ban-ts-comment": [
1061
1062
  "error",
1062
- { "ts-ignore": "allow-with-description" }
1063
+ { "ts-expect-error": "allow-with-description" }
1063
1064
  ],
1064
- "ts/ban-types": ["error", { types: { Function: false } }],
1065
1065
  "ts/consistent-type-definitions": ["error", "interface"],
1066
1066
  "ts/consistent-type-imports": [
1067
1067
  "error",
@@ -1071,6 +1071,15 @@ async function typescript(options = {}) {
1071
1071
  // https://www.totaltypescript.com/method-shorthand-syntax-considered-harmful
1072
1072
  "ts/no-dupe-class-members": "error",
1073
1073
  "ts/no-dynamic-delete": "off",
1074
+ "ts/no-empty-object-type": [
1075
+ "error",
1076
+ {
1077
+ allowInterfaces: "with-single-extends",
1078
+ // interface Derived extends Base {}
1079
+ allowObjectTypes: "never",
1080
+ allowWithName: "Props$"
1081
+ }
1082
+ ],
1074
1083
  "ts/no-explicit-any": "off",
1075
1084
  "ts/no-extraneous-class": "off",
1076
1085
  "ts/no-import-type-side-effects": "error",
@@ -1085,7 +1094,7 @@ async function typescript(options = {}) {
1085
1094
  { classes: false, functions: false, variables: true }
1086
1095
  ],
1087
1096
  "ts/no-useless-constructor": "off",
1088
- "ts/prefer-ts-expect-error": "error",
1097
+ "ts/no-wrapper-object-types": "error",
1089
1098
  "ts/triple-slash-reference": "off",
1090
1099
  "ts/unified-signatures": "off",
1091
1100
  ...overrides
@@ -1470,6 +1479,7 @@ async function test(options = {}) {
1470
1479
  "test/no-only-tests": isInEditor2 ? "off" : "error",
1471
1480
  "test/prefer-hooks-in-order": "error",
1472
1481
  "test/prefer-lowercase-title": "error",
1482
+ "ts/explicit-function-return-type": "off",
1473
1483
  ...overrides
1474
1484
  }
1475
1485
  }
@@ -1519,7 +1529,7 @@ function hasPackages(packages) {
1519
1529
  // src/configs/react.ts
1520
1530
  var ReactRefreshAllowConstantExportPackages = ["vite"];
1521
1531
  async function react(options = {}) {
1522
- const { files = [GLOB_JS, GLOB_JSX, GLOB_TS, GLOB_TSX], overrides = {} } = options;
1532
+ const { files = [GLOB_SRC], overrides = {} } = options;
1523
1533
  await ensurePackages([
1524
1534
  "@eslint-react/eslint-plugin",
1525
1535
  "eslint-plugin-react-hooks",
@@ -1832,7 +1842,6 @@ async function svelte(options = {}) {
1832
1842
  "svelte/no-useless-mustaches": "error",
1833
1843
  "svelte/require-store-callbacks-use-set-param": "error",
1834
1844
  "svelte/system": "error",
1835
- "svelte/valid-compile": "error",
1836
1845
  "svelte/valid-each-key": "error",
1837
1846
  "unused-imports/no-unused-vars": [
1838
1847
  "error",
@@ -2002,13 +2011,7 @@ async function defineConfig(options = {}, ...userConfigs) {
2002
2011
  ])
2003
2012
  );
2004
2013
  } else {
2005
- if (import_node_fs.default.existsSync(".gitignore")) {
2006
- configs2.push(
2007
- interopDefault(import("eslint-config-flat-gitignore")).then((r) => [
2008
- r()
2009
- ])
2010
- );
2011
- }
2014
+ configs2.push(interopDefault(import("eslint-config-flat-gitignore")).then((r) => [r({ strict: false })]));
2012
2015
  }
2013
2016
  }
2014
2017
  const typescriptOptions = resolveSubOptions(options, "typescript");