@coderwyd/eslint-config 2.5.5 → 2.6.0
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 +0 -3
- package/dist/cli.cjs +16 -19
- package/dist/cli.js +16 -19
- package/dist/index.cjs +14 -8
- package/dist/index.d.cts +1963 -2433
- package/dist/index.d.ts +1963 -2433
- package/dist/index.js +14 -8
- package/package.json +32 -32
package/dist/index.js
CHANGED
|
@@ -31,9 +31,9 @@ async function comments() {
|
|
|
31
31
|
// src/constants/glob.ts
|
|
32
32
|
var GLOB_SRC_EXT = "?([cm])[jt]s?(x)";
|
|
33
33
|
var GLOB_SRC = "**/*.?([cm])[jt]s?(x)";
|
|
34
|
-
var GLOB_JS = "**/*.?([cm])js";
|
|
35
34
|
var GLOB_JSX = "**/*.?([cm])jsx";
|
|
36
35
|
var GLOB_TS = "**/*.?([cm])ts";
|
|
36
|
+
var GLOB_DTS = "**/*.d.?([cm])ts";
|
|
37
37
|
var GLOB_TSX = "**/*.?([cm])tsx";
|
|
38
38
|
var GLOB_VUE = "**/*.vue";
|
|
39
39
|
var GLOB_ASTRO_TS = "**/*.astro/*.ts";
|
|
@@ -82,6 +82,7 @@ var GLOB_EXCLUDE = [
|
|
|
82
82
|
"**/.output",
|
|
83
83
|
"**/.vite-inspect",
|
|
84
84
|
"**/.yarn",
|
|
85
|
+
"**/vite.config.*.timestamp-*",
|
|
85
86
|
"**/CHANGELOG*.md",
|
|
86
87
|
"**/*.min.*",
|
|
87
88
|
"**/LICENSE*",
|
|
@@ -935,23 +936,24 @@ async function typescript(options = {}) {
|
|
|
935
936
|
const typeAwareRules = {
|
|
936
937
|
"dot-notation": "off",
|
|
937
938
|
"no-implied-eval": "off",
|
|
938
|
-
"no-throw-literal": "off",
|
|
939
939
|
"ts/await-thenable": "error",
|
|
940
940
|
"ts/dot-notation": ["error", { allowKeywords: true }],
|
|
941
941
|
"ts/no-floating-promises": "error",
|
|
942
942
|
"ts/no-for-in-array": "error",
|
|
943
943
|
"ts/no-implied-eval": "error",
|
|
944
944
|
"ts/no-misused-promises": "error",
|
|
945
|
-
"ts/no-throw-literal": "error",
|
|
946
945
|
"ts/no-unnecessary-type-assertion": "error",
|
|
947
946
|
"ts/no-unsafe-argument": "error",
|
|
948
947
|
"ts/no-unsafe-assignment": "error",
|
|
949
948
|
"ts/no-unsafe-call": "error",
|
|
950
949
|
"ts/no-unsafe-member-access": "error",
|
|
951
950
|
"ts/no-unsafe-return": "error",
|
|
951
|
+
"ts/promise-function-async": "error",
|
|
952
952
|
"ts/restrict-plus-operands": "error",
|
|
953
953
|
"ts/restrict-template-expressions": "error",
|
|
954
|
+
"ts/return-await": "error",
|
|
954
955
|
"ts/strict-boolean-expressions": "error",
|
|
956
|
+
"ts/switch-exhaustiveness-check": "error",
|
|
955
957
|
"ts/unbound-method": "error"
|
|
956
958
|
};
|
|
957
959
|
const [pluginTs, parserTs] = await Promise.all([
|
|
@@ -968,7 +970,10 @@ async function typescript(options = {}) {
|
|
|
968
970
|
extraFileExtensions: componentExts.map((ext) => `.${ext}`),
|
|
969
971
|
sourceType: "module",
|
|
970
972
|
...typeAware ? {
|
|
971
|
-
|
|
973
|
+
projectService: {
|
|
974
|
+
allowDefaultProject: ["./*.js"],
|
|
975
|
+
defaultProject: tsconfigPath
|
|
976
|
+
},
|
|
972
977
|
tsconfigRootDir: process2.cwd()
|
|
973
978
|
} : {},
|
|
974
979
|
...parserOptions
|
|
@@ -1011,7 +1016,6 @@ async function typescript(options = {}) {
|
|
|
1011
1016
|
"error",
|
|
1012
1017
|
{ "ts-ignore": "allow-with-description" }
|
|
1013
1018
|
],
|
|
1014
|
-
"ts/ban-types": ["error", { types: { Function: false } }],
|
|
1015
1019
|
"ts/consistent-type-definitions": ["error", "interface"],
|
|
1016
1020
|
"ts/consistent-type-imports": [
|
|
1017
1021
|
"error",
|
|
@@ -1021,6 +1025,7 @@ async function typescript(options = {}) {
|
|
|
1021
1025
|
// https://www.totaltypescript.com/method-shorthand-syntax-considered-harmful
|
|
1022
1026
|
"ts/no-dupe-class-members": "error",
|
|
1023
1027
|
"ts/no-dynamic-delete": "off",
|
|
1028
|
+
"ts/no-empty-object-type": ["error", { allowInterfaces: "always" }],
|
|
1024
1029
|
"ts/no-explicit-any": "off",
|
|
1025
1030
|
"ts/no-extraneous-class": "off",
|
|
1026
1031
|
"ts/no-import-type-side-effects": "error",
|
|
@@ -1035,6 +1040,7 @@ async function typescript(options = {}) {
|
|
|
1035
1040
|
{ classes: false, functions: false, variables: true }
|
|
1036
1041
|
],
|
|
1037
1042
|
"ts/no-useless-constructor": "off",
|
|
1043
|
+
"ts/no-wrapper-object-types": "error",
|
|
1038
1044
|
"ts/prefer-ts-expect-error": "error",
|
|
1039
1045
|
"ts/triple-slash-reference": "off",
|
|
1040
1046
|
"ts/unified-signatures": "off",
|
|
@@ -1053,7 +1059,7 @@ async function typescript(options = {}) {
|
|
|
1053
1059
|
}
|
|
1054
1060
|
] : [],
|
|
1055
1061
|
{
|
|
1056
|
-
files: [
|
|
1062
|
+
files: [GLOB_DTS],
|
|
1057
1063
|
name: "coderwyd/typescript/disables/dts",
|
|
1058
1064
|
rules: {
|
|
1059
1065
|
"eslint-comments/no-unlimited-disable": "off",
|
|
@@ -1444,7 +1450,7 @@ import { isPackageExists as isPackageExists3 } from "local-pkg";
|
|
|
1444
1450
|
// src/env.ts
|
|
1445
1451
|
import process3 from "node:process";
|
|
1446
1452
|
import { isPackageExists as isPackageExists2 } from "local-pkg";
|
|
1447
|
-
var isInEditor = !!((process3.env.VSCODE_PID || process3.env.VSCODE_CWD || process3.env.JETBRAINS_IDE || process3.env.VIM) && !process3.env.CI);
|
|
1453
|
+
var isInEditor = !!((process3.env.VSCODE_PID || process3.env.VSCODE_CWD || process3.env.JETBRAINS_IDE || process3.env.VIM || process3.env.NVIM) && !process3.env.CI);
|
|
1448
1454
|
var hasTypeScript = isPackageExists2("typescript");
|
|
1449
1455
|
var VueJsPackages = [
|
|
1450
1456
|
"vue",
|
|
@@ -1469,7 +1475,7 @@ function hasPackages(packages) {
|
|
|
1469
1475
|
// src/configs/react.ts
|
|
1470
1476
|
var ReactRefreshAllowConstantExportPackages = ["vite"];
|
|
1471
1477
|
async function react(options = {}) {
|
|
1472
|
-
const { files = [
|
|
1478
|
+
const { files = [GLOB_SRC], overrides = {} } = options;
|
|
1473
1479
|
await ensurePackages([
|
|
1474
1480
|
"@eslint-react/eslint-plugin",
|
|
1475
1481
|
"eslint-plugin-react-hooks",
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coderwyd/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.6.0",
|
|
5
5
|
"description": "Donny's ESLint config",
|
|
6
6
|
"author": "Donny Wang <donny526@outlook.com> (https://github.com/coderwyd/)",
|
|
7
7
|
"license": "MIT",
|
|
@@ -40,9 +40,9 @@
|
|
|
40
40
|
"eslint": "^8.56.0 || ^9.0.0",
|
|
41
41
|
"eslint-plugin-react-hooks": "^4.6.0",
|
|
42
42
|
"eslint-plugin-react-refresh": "^0.4.4",
|
|
43
|
-
"eslint-plugin-svelte": "
|
|
43
|
+
"eslint-plugin-svelte": ">=2.35.1",
|
|
44
44
|
"eslint-plugin-tailwindcss": "^3.16.0",
|
|
45
|
-
"svelte-eslint-parser": "
|
|
45
|
+
"svelte-eslint-parser": ">=0.37.0"
|
|
46
46
|
},
|
|
47
47
|
"peerDependenciesMeta": {
|
|
48
48
|
"@eslint-react/eslint-plugin": {
|
|
@@ -69,30 +69,30 @@
|
|
|
69
69
|
},
|
|
70
70
|
"dependencies": {
|
|
71
71
|
"@antfu/install-pkg": "^0.3.3",
|
|
72
|
-
"@stylistic/eslint-plugin": "^2.
|
|
72
|
+
"@stylistic/eslint-plugin": "^2.6.0-beta.0",
|
|
73
73
|
"@toml-tools/parser": "^1.0.0",
|
|
74
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
75
|
-
"@typescript-eslint/parser": "^
|
|
76
|
-
"eslint-config-flat-gitignore": "^0.1.
|
|
74
|
+
"@typescript-eslint/eslint-plugin": "^8.0.0-alpha.41",
|
|
75
|
+
"@typescript-eslint/parser": "^8.0.0-alpha.41",
|
|
76
|
+
"eslint-config-flat-gitignore": "^0.1.7",
|
|
77
77
|
"eslint-merge-processors": "^0.1.0",
|
|
78
|
-
"eslint-plugin-antfu": "^2.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
|
-
"eslint-plugin-format": "^0.1.
|
|
82
|
-
"eslint-plugin-import-x": "^0.
|
|
83
|
-
"eslint-plugin-jsdoc": "^48.
|
|
81
|
+
"eslint-plugin-format": "^0.1.2",
|
|
82
|
+
"eslint-plugin-import-x": "^3.0.1",
|
|
83
|
+
"eslint-plugin-jsdoc": "^48.7.0",
|
|
84
84
|
"eslint-plugin-jsonc": "^2.16.0",
|
|
85
|
-
"eslint-plugin-n": "^17.
|
|
85
|
+
"eslint-plugin-n": "^17.9.0",
|
|
86
86
|
"eslint-plugin-no-only-tests": "^3.1.0",
|
|
87
|
-
"eslint-plugin-perfectionist": "^2.
|
|
87
|
+
"eslint-plugin-perfectionist": "^2.11.0",
|
|
88
88
|
"eslint-plugin-regexp": "^2.6.0",
|
|
89
|
-
"eslint-plugin-unicorn": "^
|
|
90
|
-
"eslint-plugin-unused-imports": "^
|
|
89
|
+
"eslint-plugin-unicorn": "^54.0.0",
|
|
90
|
+
"eslint-plugin-unused-imports": "^4.0.0",
|
|
91
91
|
"eslint-plugin-vitest": "^0.5.4",
|
|
92
|
-
"eslint-plugin-vue": "^9.
|
|
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.
|
|
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",
|
|
@@ -104,32 +104,32 @@
|
|
|
104
104
|
},
|
|
105
105
|
"devDependencies": {
|
|
106
106
|
"@antfu/ni": "^0.21.12",
|
|
107
|
-
"@eslint-react/eslint-plugin": "^1.5.
|
|
108
|
-
"@eslint/config-inspector": "^0.
|
|
109
|
-
"@stylistic/eslint-plugin-migrate": "^2.
|
|
107
|
+
"@eslint-react/eslint-plugin": "^1.5.24",
|
|
108
|
+
"@eslint/config-inspector": "^0.5.1",
|
|
109
|
+
"@stylistic/eslint-plugin-migrate": "^2.3.0",
|
|
110
110
|
"@types/eslint": "^8.56.10",
|
|
111
111
|
"@types/fs-extra": "^11.0.4",
|
|
112
|
-
"@types/node": "^20.14.
|
|
112
|
+
"@types/node": "^20.14.10",
|
|
113
113
|
"@types/prompts": "^2.4.9",
|
|
114
114
|
"@types/yargs": "^17.0.32",
|
|
115
|
-
"@unocss/eslint-plugin": "^0.61.
|
|
115
|
+
"@unocss/eslint-plugin": "^0.61.3",
|
|
116
116
|
"bumpp": "^9.4.1",
|
|
117
|
-
"eslint": "^9.
|
|
117
|
+
"eslint": "^9.6.0",
|
|
118
118
|
"eslint-plugin-react-hooks": "^4.6.2",
|
|
119
|
-
"eslint-plugin-react-refresh": "^0.4.
|
|
120
|
-
"eslint-plugin-svelte": "2.
|
|
121
|
-
"eslint-plugin-tailwindcss": "^3.17.
|
|
122
|
-
"execa": "^9.
|
|
119
|
+
"eslint-plugin-react-refresh": "^0.4.8",
|
|
120
|
+
"eslint-plugin-svelte": "2.41.0",
|
|
121
|
+
"eslint-plugin-tailwindcss": "^3.17.4",
|
|
122
|
+
"execa": "^9.3.0",
|
|
123
123
|
"fast-glob": "^3.3.2",
|
|
124
124
|
"fs-extra": "^11.2.0",
|
|
125
|
-
"lint-staged": "^15.2.
|
|
126
|
-
"rimraf": "^
|
|
125
|
+
"lint-staged": "^15.2.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.
|
|
129
|
+
"svelte-eslint-parser": "^0.40.0",
|
|
130
130
|
"tsup": "^8.1.0",
|
|
131
|
-
"tsx": "^4.
|
|
132
|
-
"typescript": "^5.
|
|
131
|
+
"tsx": "^4.16.2",
|
|
132
|
+
"typescript": "^5.5.3"
|
|
133
133
|
},
|
|
134
134
|
"simple-git-hooks": {
|
|
135
135
|
"pre-commit": "pnpx nano-staged"
|