@shayanthenerd/eslint-config 0.13.0 → 0.14.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 +5 -5
- package/dist/configs/perfectionist.mjs +8 -1
- package/dist/configs/zod.mjs +21 -0
- package/dist/index.mjs +3 -1
- package/dist/oxlint.config.jsonc +6 -1
- package/dist/rules/html.mjs +1 -0
- package/dist/rules/perfectionist.mjs +2 -2
- package/dist/rules/stylistic.mjs +12 -3
- package/dist/rules/typescript.mjs +5 -1
- package/dist/rules/vitest.mjs +4 -0
- package/dist/rules/zod.mjs +20 -0
- package/dist/types/configOptions/perfectionist.d.mts +2 -1
- package/dist/types/configOptions/vue.d.mts +1 -1
- package/dist/types/eslint-schema.d.mts +947 -452
- package/dist/types/index.d.mts +8 -1
- package/dist/utils/isPackageDetected.mjs +4 -2
- package/dist/utils/options/defaultOptions.mjs +1 -0
- package/dist/utils/options/enableDetectedConfigs.mjs +1 -0
- package/package.json +14 -13
package/dist/types/index.d.mts
CHANGED
|
@@ -319,7 +319,7 @@ interface Options {
|
|
|
319
319
|
typescript?: boolean | TypeScriptOptions;
|
|
320
320
|
|
|
321
321
|
/**
|
|
322
|
-
* Use [eslint-plugin-import-x](https://github.com/un-ts/eslint-plugin-import-x) to organize imports and exports, and detect related issues.
|
|
322
|
+
* Use [eslint-plugin-import-x](https://github.com/un-ts/eslint-plugin-import-x) and [eslint-plugin-unused-imports](https://github.com/sweepline/eslint-plugin-unused-imports) to organize imports and exports, and detect related issues.
|
|
323
323
|
*
|
|
324
324
|
* @default true
|
|
325
325
|
*/
|
|
@@ -332,6 +332,13 @@ interface Options {
|
|
|
332
332
|
*/
|
|
333
333
|
perfectionist?: boolean | PerfectionistOptions;
|
|
334
334
|
|
|
335
|
+
/**
|
|
336
|
+
* Use [eslint-plugin-zod-x](https://github.com/marcalexiei/eslint-plugin-zod-x) to enforce Zod best practices.
|
|
337
|
+
*
|
|
338
|
+
* @default false // `true` if "zod" is detected in the package.json file when `autoDetectDeps` is enabled
|
|
339
|
+
*/
|
|
340
|
+
zod?: boolean | ConfigWithOverrides;
|
|
341
|
+
|
|
335
342
|
/**
|
|
336
343
|
* Use [eslint-plugin-vue](https://eslint.vuejs.org) to enforce Vue best practices, accessibility guidelines, stylistic rules, and identify mistakes.
|
|
337
344
|
*
|
|
@@ -6,14 +6,16 @@ import { isPackageExists } from "local-pkg";
|
|
|
6
6
|
//#region src/utils/isPackageDetected.ts
|
|
7
7
|
const detectedPackages = [];
|
|
8
8
|
function logDetectedPackages() {
|
|
9
|
-
if (detectedPackages.length > 0)
|
|
9
|
+
if (detectedPackages.length > 0) {
|
|
10
|
+
detectedPackages.sort();
|
|
11
|
+
console.info(styleText("green", "✔"), "Automatic dependency detection enabled ESLint configurations for", detectedPackages.map((packageName) => styleText("blue", packageName)).join(", "));
|
|
12
|
+
}
|
|
10
13
|
}
|
|
11
14
|
function isPackageDetected(packageName, options = defaultOptions) {
|
|
12
15
|
const { packageDir = defaultOptions.packageDir, autoDetectDeps = defaultOptions.autoDetectDeps } = options;
|
|
13
16
|
if (!autoDetectDeps) return false;
|
|
14
17
|
const isPackageInstalled = isPackageExists(packageName, { paths: [path.resolve(packageDir)] });
|
|
15
18
|
if (isPackageInstalled) detectedPackages.push(packageName);
|
|
16
|
-
detectedPackages.sort();
|
|
17
19
|
return isPackageInstalled;
|
|
18
20
|
}
|
|
19
21
|
|
|
@@ -14,6 +14,7 @@ function enableDetectedConfigs(options) {
|
|
|
14
14
|
options.configs.vue ??= isPackageDetected("vue", options);
|
|
15
15
|
options.configs.nuxt ??= isPackageDetected("nuxt", options);
|
|
16
16
|
options.configs.typescript ??= isPackageDetected("typescript", options);
|
|
17
|
+
options.configs.zod ??= isPackageDetected("zod", options);
|
|
17
18
|
options.configs.test.vitest ??= isPackageDetected("vitest", options);
|
|
18
19
|
options.configs.test.cypress ??= isPackageDetected("cypress", options);
|
|
19
20
|
options.configs.test.storybook ??= isPackageDetected("storybook", options);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shayanthenerd/eslint-config",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.14.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "A modern, flexible ESLint configuration for enforcing best practices and maintaining a consistent coding style",
|
|
6
6
|
"keywords": [
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"version": "^22.12.0",
|
|
55
55
|
"onfail": "download"
|
|
56
56
|
},
|
|
57
|
-
"packageManager": "pnpm@10.
|
|
57
|
+
"packageManager": "pnpm@10.26.2",
|
|
58
58
|
"scripts": {
|
|
59
59
|
"prepare": "pnpm git:gitmessage && simple-git-hooks && pnpm generate:types",
|
|
60
60
|
"prepublishOnly": "pnpm build:package",
|
|
@@ -84,41 +84,42 @@
|
|
|
84
84
|
"dependencies": {
|
|
85
85
|
"@eslint/compat": "2.0.0",
|
|
86
86
|
"@eslint/css": "0.14.1",
|
|
87
|
-
"@html-eslint/eslint-plugin": "0.
|
|
87
|
+
"@html-eslint/eslint-plugin": "0.52.0",
|
|
88
88
|
"@stylistic/eslint-plugin": "5.6.1",
|
|
89
|
-
"@vitest/eslint-plugin": "1.
|
|
89
|
+
"@vitest/eslint-plugin": "1.6.4",
|
|
90
90
|
"defu": "6.1.4",
|
|
91
|
-
"eslint": "9.39.
|
|
91
|
+
"eslint": "9.39.2",
|
|
92
92
|
"eslint-flat-config-utils": "2.1.4",
|
|
93
93
|
"eslint-import-resolver-typescript": "4.4.4",
|
|
94
94
|
"eslint-plugin-better-tailwindcss": "3.8.0",
|
|
95
95
|
"eslint-plugin-cypress": "5.2.0",
|
|
96
96
|
"eslint-plugin-import-x": "4.16.1",
|
|
97
|
-
"eslint-plugin-oxlint": "1.
|
|
98
|
-
"eslint-plugin-perfectionist": "
|
|
97
|
+
"eslint-plugin-oxlint": "1.36.0",
|
|
98
|
+
"eslint-plugin-perfectionist": "5.1.0",
|
|
99
99
|
"eslint-plugin-playwright": "2.4.0",
|
|
100
|
-
"eslint-plugin-storybook": "10.1.
|
|
100
|
+
"eslint-plugin-storybook": "10.1.11",
|
|
101
101
|
"eslint-plugin-unused-imports": "4.3.0",
|
|
102
102
|
"eslint-plugin-vue": "10.6.2",
|
|
103
103
|
"eslint-plugin-vuejs-accessibility": "2.4.1",
|
|
104
|
+
"eslint-plugin-zod-x": "2.0.0",
|
|
104
105
|
"globals": "16.5.0",
|
|
105
106
|
"local-pkg": "1.1.2",
|
|
106
|
-
"oxlint": "1.
|
|
107
|
+
"oxlint": "1.36.0",
|
|
107
108
|
"tailwind-csstree": "0.1.4",
|
|
108
|
-
"typescript-eslint": "8.
|
|
109
|
+
"typescript-eslint": "8.51.0"
|
|
109
110
|
},
|
|
110
111
|
"devDependencies": {
|
|
111
112
|
"@arethetypeswrong/cli": "0.18.2",
|
|
112
113
|
"@eslint/config-inspector": "1.4.2",
|
|
113
|
-
"@types/node": "25.0.
|
|
114
|
-
"actions-up": "1.
|
|
114
|
+
"@types/node": "25.0.3",
|
|
115
|
+
"actions-up": "1.8.0",
|
|
115
116
|
"eslint-typegen": "2.3.0",
|
|
116
117
|
"nano-staged": "0.9.0",
|
|
117
118
|
"prettier": "3.7.4",
|
|
118
119
|
"publint": "0.3.16",
|
|
119
120
|
"serve": "14.2.5",
|
|
120
121
|
"simple-git-hooks": "2.13.1",
|
|
121
|
-
"tsdown": "0.
|
|
122
|
+
"tsdown": "0.18.3",
|
|
122
123
|
"typescript": "5.9.3",
|
|
123
124
|
"unplugin-unused": "0.5.6"
|
|
124
125
|
}
|