@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/dist/index.js CHANGED
@@ -1,6 +1,3 @@
1
- // src/index.ts
2
- import fs from "node:fs";
3
-
4
1
  // src/plugins/index.ts
5
2
  import { default as default2 } from "eslint-plugin-antfu";
6
3
  import { default as default3 } from "eslint-plugin-eslint-comments";
@@ -31,7 +28,6 @@ async function comments() {
31
28
  // src/constants/glob.ts
32
29
  var GLOB_SRC_EXT = "?([cm])[jt]s?(x)";
33
30
  var GLOB_SRC = "**/*.?([cm])[jt]s?(x)";
34
- var GLOB_JS = "**/*.?([cm])js";
35
31
  var GLOB_JSX = "**/*.?([cm])jsx";
36
32
  var GLOB_TS = "**/*.?([cm])ts";
37
33
  var GLOB_DTS = "**/*.d.?([cm])ts";
@@ -76,6 +72,7 @@ var GLOB_EXCLUDE = [
76
72
  "**/.vitepress/cache",
77
73
  "**/.nuxt",
78
74
  "**/.next",
75
+ "**/.svelte-kit",
79
76
  "**/.vercel",
80
77
  "**/.changeset",
81
78
  "**/.idea",
@@ -855,6 +852,7 @@ function sortTsconfig() {
855
852
  "allowSyntheticDefaultImports",
856
853
  "esModuleInterop",
857
854
  "forceConsistentCasingInFileNames",
855
+ "isolatedDeclarations",
858
856
  "isolatedModules",
859
857
  "preserveSymlinks",
860
858
  "verbatimModuleSyntax",
@@ -932,19 +930,17 @@ async function typescript(options = {}) {
932
930
  `${GLOB_MARKDOWN}/**`,
933
931
  GLOB_ASTRO_TS
934
932
  ];
935
- const tsconfigPath = options?.tsconfigPath ? toArray(options.tsconfigPath) : void 0;
933
+ const tsconfigPath = options.tsconfigPath;
936
934
  const isTypeAware = !!tsconfigPath;
937
935
  const typeAwareRules = {
938
936
  "dot-notation": "off",
939
937
  "no-implied-eval": "off",
940
- "no-throw-literal": "off",
941
938
  "ts/await-thenable": "error",
942
939
  "ts/dot-notation": ["error", { allowKeywords: true }],
943
940
  "ts/no-floating-promises": "error",
944
941
  "ts/no-for-in-array": "error",
945
942
  "ts/no-implied-eval": "error",
946
943
  "ts/no-misused-promises": "error",
947
- "ts/no-throw-literal": "error",
948
944
  "ts/no-unnecessary-type-assertion": "error",
949
945
  "ts/no-unsafe-argument": "error",
950
946
  "ts/no-unsafe-assignment": "error",
@@ -973,7 +969,10 @@ async function typescript(options = {}) {
973
969
  extraFileExtensions: componentExts.map((ext) => `.${ext}`),
974
970
  sourceType: "module",
975
971
  ...typeAware ? {
976
- project: tsconfigPath,
972
+ projectService: {
973
+ allowDefaultProject: ["./*.js"],
974
+ defaultProject: tsconfigPath
975
+ },
977
976
  tsconfigRootDir: process2.cwd()
978
977
  } : {},
979
978
  ...parserOptions
@@ -1014,9 +1013,8 @@ async function typescript(options = {}) {
1014
1013
  "no-useless-constructor": "off",
1015
1014
  "ts/ban-ts-comment": [
1016
1015
  "error",
1017
- { "ts-ignore": "allow-with-description" }
1016
+ { "ts-expect-error": "allow-with-description" }
1018
1017
  ],
1019
- "ts/ban-types": ["error", { types: { Function: false } }],
1020
1018
  "ts/consistent-type-definitions": ["error", "interface"],
1021
1019
  "ts/consistent-type-imports": [
1022
1020
  "error",
@@ -1026,6 +1024,15 @@ async function typescript(options = {}) {
1026
1024
  // https://www.totaltypescript.com/method-shorthand-syntax-considered-harmful
1027
1025
  "ts/no-dupe-class-members": "error",
1028
1026
  "ts/no-dynamic-delete": "off",
1027
+ "ts/no-empty-object-type": [
1028
+ "error",
1029
+ {
1030
+ allowInterfaces: "with-single-extends",
1031
+ // interface Derived extends Base {}
1032
+ allowObjectTypes: "never",
1033
+ allowWithName: "Props$"
1034
+ }
1035
+ ],
1029
1036
  "ts/no-explicit-any": "off",
1030
1037
  "ts/no-extraneous-class": "off",
1031
1038
  "ts/no-import-type-side-effects": "error",
@@ -1040,7 +1047,7 @@ async function typescript(options = {}) {
1040
1047
  { classes: false, functions: false, variables: true }
1041
1048
  ],
1042
1049
  "ts/no-useless-constructor": "off",
1043
- "ts/prefer-ts-expect-error": "error",
1050
+ "ts/no-wrapper-object-types": "error",
1044
1051
  "ts/triple-slash-reference": "off",
1045
1052
  "ts/unified-signatures": "off",
1046
1053
  ...overrides
@@ -1425,6 +1432,7 @@ async function test(options = {}) {
1425
1432
  "test/no-only-tests": isInEditor2 ? "off" : "error",
1426
1433
  "test/prefer-hooks-in-order": "error",
1427
1434
  "test/prefer-lowercase-title": "error",
1435
+ "ts/explicit-function-return-type": "off",
1428
1436
  ...overrides
1429
1437
  }
1430
1438
  }
@@ -1474,7 +1482,7 @@ function hasPackages(packages) {
1474
1482
  // src/configs/react.ts
1475
1483
  var ReactRefreshAllowConstantExportPackages = ["vite"];
1476
1484
  async function react(options = {}) {
1477
- const { files = [GLOB_JS, GLOB_JSX, GLOB_TS, GLOB_TSX], overrides = {} } = options;
1485
+ const { files = [GLOB_SRC], overrides = {} } = options;
1478
1486
  await ensurePackages([
1479
1487
  "@eslint-react/eslint-plugin",
1480
1488
  "eslint-plugin-react-hooks",
@@ -1787,7 +1795,6 @@ async function svelte(options = {}) {
1787
1795
  "svelte/no-useless-mustaches": "error",
1788
1796
  "svelte/require-store-callbacks-use-set-param": "error",
1789
1797
  "svelte/system": "error",
1790
- "svelte/valid-compile": "error",
1791
1798
  "svelte/valid-each-key": "error",
1792
1799
  "unused-imports/no-unused-vars": [
1793
1800
  "error",
@@ -1957,13 +1964,7 @@ async function defineConfig(options = {}, ...userConfigs) {
1957
1964
  ])
1958
1965
  );
1959
1966
  } else {
1960
- if (fs.existsSync(".gitignore")) {
1961
- configs2.push(
1962
- interopDefault(import("eslint-config-flat-gitignore")).then((r) => [
1963
- r()
1964
- ])
1965
- );
1966
- }
1967
+ configs2.push(interopDefault(import("eslint-config-flat-gitignore")).then((r) => [r({ strict: false })]));
1967
1968
  }
1968
1969
  }
1969
1970
  const typescriptOptions = resolveSubOptions(options, "typescript");
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@coderwyd/eslint-config",
3
3
  "type": "module",
4
- "version": "2.5.6",
4
+ "version": "2.6.1",
5
5
  "description": "Donny's ESLint config",
6
6
  "author": "Donny Wang <donny526@outlook.com> (https://github.com/coderwyd/)",
7
7
  "license": "MIT",
@@ -69,30 +69,30 @@
69
69
  },
70
70
  "dependencies": {
71
71
  "@antfu/install-pkg": "^0.3.3",
72
- "@stylistic/eslint-plugin": "^2.3.0",
72
+ "@stylistic/eslint-plugin": "^2.6.0-beta.0",
73
73
  "@toml-tools/parser": "^1.0.0",
74
- "@typescript-eslint/eslint-plugin": "^7.15.0",
75
- "@typescript-eslint/parser": "^7.15.0",
76
- "eslint-config-flat-gitignore": "^0.1.5",
74
+ "@typescript-eslint/eslint-plugin": "^8.0.0-alpha.51",
75
+ "@typescript-eslint/parser": "^8.0.0-alpha.51",
76
+ "eslint-config-flat-gitignore": "^0.1.8",
77
77
  "eslint-merge-processors": "^0.1.0",
78
- "eslint-plugin-antfu": "^2.3.3",
78
+ "eslint-plugin-antfu": "^2.3.4",
79
79
  "eslint-plugin-command": "^0.2.3",
80
80
  "eslint-plugin-eslint-comments": "^3.2.0",
81
81
  "eslint-plugin-format": "^0.1.2",
82
- "eslint-plugin-import-x": "^0.5.3",
83
- "eslint-plugin-jsdoc": "^48.5.0",
82
+ "eslint-plugin-import-x": "^3.0.1",
83
+ "eslint-plugin-jsdoc": "^48.8.3",
84
84
  "eslint-plugin-jsonc": "^2.16.0",
85
85
  "eslint-plugin-n": "^17.9.0",
86
86
  "eslint-plugin-no-only-tests": "^3.1.0",
87
- "eslint-plugin-perfectionist": "^2.11.0",
87
+ "eslint-plugin-perfectionist": "^3.0.0",
88
88
  "eslint-plugin-regexp": "^2.6.0",
89
89
  "eslint-plugin-unicorn": "^54.0.0",
90
- "eslint-plugin-unused-imports": "^3.2.0",
90
+ "eslint-plugin-unused-imports": "^4.0.1",
91
91
  "eslint-plugin-vitest": "^0.5.4",
92
92
  "eslint-plugin-vue": "^9.27.0",
93
93
  "eslint-processor-vue-blocks": "^0.1.2",
94
94
  "eslint-typegen": "^0.2.4",
95
- "globals": "^15.7.0",
95
+ "globals": "^15.8.0",
96
96
  "jsonc-eslint-parser": "^2.4.0",
97
97
  "local-pkg": "^0.5.0",
98
98
  "parse-gitignore": "^2.0.0",
@@ -103,33 +103,33 @@
103
103
  "yargs": "^17.7.2"
104
104
  },
105
105
  "devDependencies": {
106
- "@antfu/ni": "^0.21.12",
107
- "@eslint-react/eslint-plugin": "^1.5.20",
108
- "@eslint/config-inspector": "^0.5.1",
106
+ "@antfu/ni": "^0.22.0",
107
+ "@eslint-react/eslint-plugin": "^1.5.30",
108
+ "@eslint/config-inspector": "^0.5.2",
109
109
  "@stylistic/eslint-plugin-migrate": "^2.3.0",
110
- "@types/eslint": "^8.56.10",
110
+ "@types/eslint": "^8.56.11",
111
111
  "@types/fs-extra": "^11.0.4",
112
- "@types/node": "^20.14.9",
112
+ "@types/node": "^20.14.11",
113
113
  "@types/prompts": "^2.4.9",
114
114
  "@types/yargs": "^17.0.32",
115
- "@unocss/eslint-plugin": "^0.61.0",
115
+ "@unocss/eslint-plugin": "^0.61.5",
116
116
  "bumpp": "^9.4.1",
117
- "eslint": "^9.6.0",
117
+ "eslint": "^9.7.0",
118
118
  "eslint-plugin-react-hooks": "^4.6.2",
119
- "eslint-plugin-react-refresh": "^0.4.7",
120
- "eslint-plugin-svelte": "2.39.5",
119
+ "eslint-plugin-react-refresh": "^0.4.9",
120
+ "eslint-plugin-svelte": "2.43.0",
121
121
  "eslint-plugin-tailwindcss": "^3.17.4",
122
122
  "execa": "^9.3.0",
123
123
  "fast-glob": "^3.3.2",
124
124
  "fs-extra": "^11.2.0",
125
125
  "lint-staged": "^15.2.7",
126
- "rimraf": "^5.0.7",
126
+ "rimraf": "^6.0.1",
127
127
  "simple-git-hooks": "^2.11.1",
128
128
  "svelte": "^4.2.18",
129
- "svelte-eslint-parser": "^0.39.2",
130
- "tsup": "^8.1.0",
131
- "tsx": "^4.16.0",
132
- "typescript": "^5.5.3"
129
+ "svelte-eslint-parser": "^0.41.0",
130
+ "tsup": "^8.2.2",
131
+ "tsx": "^4.16.2",
132
+ "typescript": "^5.5.4"
133
133
  },
134
134
  "simple-git-hooks": {
135
135
  "pre-commit": "pnpx nano-staged"