@shayanthenerd/eslint-config 0.26.8 → 0.27.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/configs/base.mjs +1 -0
- package/dist/configs/baseline.mjs +1 -0
- package/dist/configs/importX.mjs +1 -0
- package/dist/configs/next.mjs +1 -1
- package/dist/configs/node.mjs +1 -0
- package/dist/configs/perfectionist.mjs +1 -0
- package/dist/configs/promise.mjs +1 -0
- package/dist/configs/react.mjs +1 -1
- package/dist/configs/stylistic.mjs +1 -0
- package/dist/configs/tailwind.mjs +1 -0
- package/dist/configs/typescript.mjs +1 -0
- package/dist/configs/unicorn.mjs +1 -0
- package/dist/configs/vueMiddlewares.mjs +14 -0
- package/dist/configs/zod.mjs +1 -0
- package/dist/helpers/globs.mjs +6 -3
- package/dist/helpers/options/mergeWithDefaults.mjs +2 -1
- package/dist/index.d.mts +34 -35
- package/dist/index.mjs +2 -0
- package/dist/prettier.config.d.mts +0 -1
- package/dist/rules/perfectionist.mjs +104 -42
- package/dist/types/eslint-schema.d.mts +2333 -1293
- package/dist/types/eslintRules.d.mts +0 -1
- package/dist/types/helpers.d.mts +1 -1
- package/dist/types/index.d.mts +4 -4
- package/dist/types/options/base.d.mts +0 -1
- package/dist/types/options/baseline.d.mts +1 -2
- package/dist/types/options/markdown.d.mts +0 -1
- package/dist/types/options/react.d.mts +0 -1
- package/dist/types/options/stylistic.d.mts +2 -3
- package/dist/types/options/tailwind.d.mts +3 -4
- package/dist/types/options/test.d.mts +2 -3
- package/dist/types/options/typescript.d.mts +0 -1
- package/dist/types/options/vue.d.mts +0 -1
- package/dist/types/options/zod.d.mts +2 -3
- package/package.json +18 -21
package/dist/types/helpers.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region src/types/helpers.d.ts
|
|
2
2
|
type Tail<Tuple> = Tuple extends [unknown, ...(infer LastItems)] ? LastItems : never;
|
|
3
|
-
type DeepNonNullable<Type> = Type extends Function ? Type /* eslint-disable-line @typescript-eslint/no-unsafe-function-type */ : Type extends object ? { [Key in keyof Type]-?: DeepNonNullable<NonNullable<Type[Key]
|
|
3
|
+
type DeepNonNullable<Type> = Type extends Function ? Type /* eslint-disable-line @typescript-eslint/no-unsafe-function-type */ : Type extends object ? { [Key in keyof Type]-?: DeepNonNullable<NonNullable<Type[Key]>>; } : NonNullable<Type>;
|
|
4
4
|
//#endregion
|
|
5
5
|
export type { DeepNonNullable, Tail };
|
package/dist/types/index.d.mts
CHANGED
|
@@ -11,7 +11,6 @@ import { TailwindOptions } from "./options/tailwind.mjs";
|
|
|
11
11
|
import { StylisticOptions } from "./options/stylistic.mjs";
|
|
12
12
|
import { TypeScriptOptions } from "./options/typescript.mjs";
|
|
13
13
|
import { Linter } from "eslint";
|
|
14
|
-
|
|
15
14
|
//#region src/types/index.d.ts
|
|
16
15
|
type ConfigOverrides = Pick<Linter.Config, 'name' | 'files' | 'ignores' | 'plugins' | 'settings' | 'languageOptions'>;
|
|
17
16
|
interface ConfigWithOverrides<ConfigRules extends Linter.RulesRecord> {
|
|
@@ -23,7 +22,8 @@ interface ConfigWithOverrides<ConfigRules extends Linter.RulesRecord> {
|
|
|
23
22
|
* @see [eslint-flat-config-utils: `mergeConfigs`](https://jsr.io/@antfu/eslint-flat-config-utils/doc/~/mergeConfigs)
|
|
24
23
|
*/
|
|
25
24
|
overrides?: ConfigOverrides & {
|
|
26
|
-
/** The rules to override in the current configuration object. */
|
|
25
|
+
/** The rules to override in the current configuration object. */
|
|
26
|
+
rules?: ConfigRules;
|
|
27
27
|
};
|
|
28
28
|
}
|
|
29
29
|
/** The options passed to the `defineConfig` function. */
|
|
@@ -226,13 +226,13 @@ interface Options {
|
|
|
226
226
|
* The available rules.
|
|
227
227
|
*
|
|
228
228
|
* @see [ESLint Configuration: Rules](https://eslint.org/docs/latest/use/configure/configuration-files#configuring-rules)
|
|
229
|
-
|
|
229
|
+
*/
|
|
230
230
|
rules?: Linter.RulesRecord;
|
|
231
231
|
/**
|
|
232
232
|
* Settings shared across all rules. Use this to specify information that should be available to every rule.
|
|
233
233
|
*
|
|
234
234
|
* @see [ESLint Configuration: Shared Settings](https://eslint.org/docs/latest/use/configure/configuration-files#configuring-shared-settings)
|
|
235
|
-
|
|
235
|
+
*/
|
|
236
236
|
settings?: Linter.Config['settings'];
|
|
237
237
|
};
|
|
238
238
|
/*** Configs ***/
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { CoreRules, RuleOptions } from "../eslintRules.mjs";
|
|
2
2
|
import { ConfigWithOverrides } from "../index.mjs";
|
|
3
|
-
|
|
4
3
|
//#region src/types/options/base.d.ts
|
|
5
4
|
type MaxDepthOptions = RuleOptions<'max-depth'>;
|
|
6
5
|
type MaxNestedCallbacksOptions = RuleOptions<'max-nested-callbacks'>;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { PluginRules, RuleOptions } from "../eslintRules.mjs";
|
|
2
2
|
import { ConfigWithOverrides } from "../index.mjs";
|
|
3
|
-
|
|
4
3
|
//#region src/types/options/baseline.d.ts
|
|
5
4
|
type ConfigRules = PluginRules<'baseline-js'>;
|
|
6
5
|
type CssBaselineOptions = RuleOptions<'css/use-baseline'>;
|
|
@@ -27,7 +26,7 @@ interface BaselineOptions extends ConfigWithOverrides<ConfigRules> {
|
|
|
27
26
|
* @default []
|
|
28
27
|
*
|
|
29
28
|
* @see [css/use-baseline: `allowedAtRules` option](https://github.com/eslint/css/blob/main/docs/rules/use-baseline.md#allowatrules)
|
|
30
|
-
|
|
29
|
+
*/
|
|
31
30
|
allowedAtRules?: CssBaselineOptions['allowAtRules'];
|
|
32
31
|
/**
|
|
33
32
|
* Functions that are allowed to be used regardless of the baseline.
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { PluginRules, RuleOptions } from "../eslintRules.mjs";
|
|
2
2
|
import { ConfigWithOverrides } from "../index.mjs";
|
|
3
|
-
|
|
4
3
|
//#region src/types/options/markdown.d.ts
|
|
5
4
|
type ConfigRules = PluginRules<'markdown'>;
|
|
6
5
|
interface MarkdownOptions extends ConfigWithOverrides<ConfigRules> {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { PluginRules, RuleOptions } from "../eslintRules.mjs";
|
|
2
2
|
import { ConfigWithOverrides } from "../index.mjs";
|
|
3
|
-
|
|
4
3
|
//#region src/types/options/react.d.ts
|
|
5
4
|
type ConfigRules = PluginRules<'react'>;
|
|
6
5
|
interface ReactOptions extends ConfigWithOverrides<ConfigRules> {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { PluginRules, RuleOptions } from "../eslintRules.mjs";
|
|
2
2
|
import { ConfigWithOverrides } from "../index.mjs";
|
|
3
|
-
|
|
4
3
|
//#region src/types/options/stylistic.d.ts
|
|
5
4
|
type ConfigRules = PluginRules<'@stylistic'>;
|
|
6
5
|
interface StylisticOptions extends ConfigWithOverrides<ConfigRules> {
|
|
@@ -29,7 +28,7 @@ interface StylisticOptions extends ConfigWithOverrides<ConfigRules> {
|
|
|
29
28
|
* - [better-tailwindcss/enforce-consistent-line-wrapping: `tabWidth` option](https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/rules/enforce-consistent-line-wrapping.md#tabwidth)
|
|
30
29
|
*
|
|
31
30
|
* @default 2
|
|
32
|
-
|
|
31
|
+
*/
|
|
33
32
|
indent?: number;
|
|
34
33
|
/**
|
|
35
34
|
* The style of quotes to use for JSX attributes.
|
|
@@ -70,7 +69,7 @@ interface StylisticOptions extends ConfigWithOverrides<ConfigRules> {
|
|
|
70
69
|
* - [better-tailwindcss/enforce-consistent-line-wrapping: `printWidth` option](https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/rules/enforce-consistent-line-wrapping.md)
|
|
71
70
|
*
|
|
72
71
|
* @default 120
|
|
73
|
-
|
|
72
|
+
*/
|
|
74
73
|
maxLineLength?: number;
|
|
75
74
|
/**
|
|
76
75
|
* Enforce a consistent delimiter style in interfaces and type aliases.
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { PluginRules, RuleOptions } from "../eslintRules.mjs";
|
|
2
2
|
import { ConfigWithOverrides } from "../index.mjs";
|
|
3
|
-
|
|
4
3
|
//#region src/types/options/tailwind.d.ts
|
|
5
4
|
type ConfigRules = PluginRules<'better-tailwindcss'>;
|
|
6
5
|
interface BaseTailwindOptions extends ConfigWithOverrides<ConfigRules> {
|
|
@@ -8,7 +7,7 @@ interface BaseTailwindOptions extends ConfigWithOverrides<ConfigRules> {
|
|
|
8
7
|
* Path to the _tailwind.config.js_ file, relative to the current working directory (**v3**).
|
|
9
8
|
*
|
|
10
9
|
* @see [better-tailwindcss: `tailwindConfig` option](https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/settings/settings.md#tailwindconfig)
|
|
11
|
-
|
|
10
|
+
*/
|
|
12
11
|
config?: string;
|
|
13
12
|
/**
|
|
14
13
|
* Current working directory used to resolve TailwindCSS and related config files in monorepos.
|
|
@@ -18,13 +17,13 @@ interface BaseTailwindOptions extends ConfigWithOverrides<ConfigRules> {
|
|
|
18
17
|
* @default undefined
|
|
19
18
|
*
|
|
20
19
|
* @see [better-tailwindcss: `cwd` option](https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/settings/settings.md#cwd)
|
|
21
|
-
|
|
20
|
+
*/
|
|
22
21
|
cwd?: string;
|
|
23
22
|
/**
|
|
24
23
|
* Path to the CSS-based Tailwind config file, relative to the current working directory (**only v4**).
|
|
25
24
|
*
|
|
26
25
|
* @see [better-tailwindcss: `entryPoint` option](https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/settings/settings.md#entrypoint)
|
|
27
|
-
|
|
26
|
+
*/
|
|
28
27
|
entryPoint?: string;
|
|
29
28
|
/**
|
|
30
29
|
* Regex patterns of unregistered class names that should be ignored.
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { PluginRules, RuleOptions } from "../eslintRules.mjs";
|
|
2
2
|
import { ConfigWithOverrides } from "../index.mjs";
|
|
3
|
-
|
|
4
3
|
//#region src/types/options/test.d.ts
|
|
5
4
|
type StorybookConfigRules = PluginRules<'storybook'>;
|
|
6
5
|
type VitestConfigRules = PluginRules<'vitest'>;
|
|
@@ -35,7 +34,7 @@ interface TestOptions {
|
|
|
35
34
|
* Use [eslint-plugin-playwright](https://github.com/playwright-community/eslint-plugin-playwright) to enforce best practices and code styles for Playwright tests.
|
|
36
35
|
*
|
|
37
36
|
* @default false // `true` if "@playwright/test" is detected in the dependencies when `autoDetectDeps` is enabled
|
|
38
|
-
|
|
37
|
+
*/
|
|
39
38
|
playwright?: boolean | ConfigWithOverrides<PlaywrightConfigRules>;
|
|
40
39
|
/**
|
|
41
40
|
* Use [eslint-plugin-storybook](https://github.com/storybookjs/eslint-plugin-storybook) to enforce best practices and code styles for Storybook stories and tests.
|
|
@@ -47,7 +46,7 @@ interface TestOptions {
|
|
|
47
46
|
* Use [@vitest/eslint-plugin](https://github.com/vitest-dev/eslint-plugin-vitest) to enforce best practices and code styles for Vitest tests.
|
|
48
47
|
*
|
|
49
48
|
* @default false // `true` if "vitest" is detected in the dependencies when `autoDetectDeps` is enabled
|
|
50
|
-
|
|
49
|
+
*/
|
|
51
50
|
vitest?: boolean | ConfigWithOverrides<VitestConfigRules>;
|
|
52
51
|
}
|
|
53
52
|
//#endregion
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { PluginRules, RuleOptions } from "../eslintRules.mjs";
|
|
2
2
|
import { ConfigWithOverrides } from "../index.mjs";
|
|
3
|
-
|
|
4
3
|
//#region src/types/options/typescript.d.ts
|
|
5
4
|
type ConfigRules = PluginRules<'@typescript-eslint'>;
|
|
6
5
|
interface TypeScriptOptions extends ConfigWithOverrides<ConfigRules> {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { PluginRules, RuleOptions } from "../eslintRules.mjs";
|
|
2
2
|
import { ConfigWithOverrides } from "../index.mjs";
|
|
3
|
-
|
|
4
3
|
//#region src/types/options/vue.d.ts
|
|
5
4
|
type AnchorHasContentRuleOptions = RuleOptions<'vuejs-accessibility/anchor-has-content'>;
|
|
6
5
|
interface BlockLang {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { PluginRules } from "../eslintRules.mjs";
|
|
2
2
|
import { ConfigWithOverrides } from "../index.mjs";
|
|
3
|
-
|
|
4
3
|
//#region src/types/options/zod.d.ts
|
|
5
4
|
interface BaseZodOptions {
|
|
6
5
|
/**
|
|
@@ -16,9 +15,9 @@ interface BaseZodOptions {
|
|
|
16
15
|
}
|
|
17
16
|
type ConfigRulesZod = PluginRules<'zod'>;
|
|
18
17
|
type ConfigRulesZodMini = PluginRules<'zod-mini'>;
|
|
19
|
-
type ZodOptions = (BaseZodOptions & {
|
|
18
|
+
type ZodOptions = (BaseZodOptions & ConfigWithOverrides<ConfigRulesZodMini> & {
|
|
20
19
|
mini?: true;
|
|
21
|
-
}
|
|
20
|
+
}) | (BaseZodOptions & ConfigWithOverrides<ConfigRulesZod> & ({
|
|
22
21
|
mini?: false;
|
|
23
22
|
} | {
|
|
24
23
|
mini?: undefined;
|
package/package.json
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shayanthenerd/eslint-config",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.27.1",
|
|
4
4
|
"description": "A modern, flexible ESLint configuration for enforcing best practices and maintaining a consistent coding style",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eslint",
|
|
7
|
-
"eslint-config"
|
|
8
|
-
"eslint-flat-config",
|
|
9
|
-
"eslint-config-vue",
|
|
10
|
-
"eslint-config-typescript"
|
|
7
|
+
"eslint-config"
|
|
11
8
|
],
|
|
12
9
|
"homepage": "https://eslintconfig.netlify.app",
|
|
13
10
|
"bugs": {
|
|
@@ -52,14 +49,14 @@
|
|
|
52
49
|
"{**/*.ts,package.json}": "pnpm lint"
|
|
53
50
|
},
|
|
54
51
|
"dependencies": {
|
|
55
|
-
"@eslint-react/eslint-plugin": "5.
|
|
52
|
+
"@eslint-react/eslint-plugin": "5.14.5",
|
|
56
53
|
"@eslint/css": "1.4.0",
|
|
57
54
|
"@eslint/markdown": "8.0.3",
|
|
58
|
-
"@html-eslint/eslint-plugin": "0.
|
|
59
|
-
"@html-eslint/eslint-plugin-react": "0.
|
|
55
|
+
"@html-eslint/eslint-plugin": "0.64.0",
|
|
56
|
+
"@html-eslint/eslint-plugin-react": "0.64.0",
|
|
60
57
|
"@next/eslint-plugin-next": "16.2.10",
|
|
61
58
|
"@stylistic/eslint-plugin": "5.10.0",
|
|
62
|
-
"@vitest/eslint-plugin": "1.6.
|
|
59
|
+
"@vitest/eslint-plugin": "1.6.23",
|
|
63
60
|
"astro-eslint-parser": "2.1.0",
|
|
64
61
|
"defu": "6.1.7",
|
|
65
62
|
"eslint-flat-config-utils": "3.2.0",
|
|
@@ -70,13 +67,13 @@
|
|
|
70
67
|
"eslint-plugin-cypress": "6.4.2",
|
|
71
68
|
"eslint-plugin-import-x": "4.17.1",
|
|
72
69
|
"eslint-plugin-jsx-a11y": "6.10.2",
|
|
73
|
-
"eslint-plugin-n": "18.2.
|
|
70
|
+
"eslint-plugin-n": "18.2.2",
|
|
74
71
|
"eslint-plugin-package-json": "1.5.0",
|
|
75
|
-
"eslint-plugin-perfectionist": "5.
|
|
72
|
+
"eslint-plugin-perfectionist": "5.10.0",
|
|
76
73
|
"eslint-plugin-playwright": "2.10.5",
|
|
77
74
|
"eslint-plugin-promise": "7.3.0",
|
|
78
|
-
"eslint-plugin-storybook": "10.
|
|
79
|
-
"eslint-plugin-unicorn": "71.
|
|
75
|
+
"eslint-plugin-storybook": "10.5.0",
|
|
76
|
+
"eslint-plugin-unicorn": "71.1.0",
|
|
80
77
|
"eslint-plugin-vue": "10.9.2",
|
|
81
78
|
"eslint-plugin-vuejs-accessibility": "2.5.0",
|
|
82
79
|
"eslint-plugin-zod": "4.7.1",
|
|
@@ -84,23 +81,23 @@
|
|
|
84
81
|
"globals": "17.7.0",
|
|
85
82
|
"local-pkg": "1.2.1",
|
|
86
83
|
"tailwind-csstree": "0.3.3",
|
|
87
|
-
"typescript-eslint": "8.
|
|
84
|
+
"typescript-eslint": "8.63.0"
|
|
88
85
|
},
|
|
89
86
|
"devDependencies": {
|
|
90
|
-
"@arethetypeswrong/cli": "0.18.
|
|
87
|
+
"@arethetypeswrong/cli": "0.18.5",
|
|
91
88
|
"@eslint/config-inspector": "3.0.4",
|
|
92
89
|
"@types/eslint-plugin-jsx-a11y": "6.10.1",
|
|
93
|
-
"@types/node": "26.1.
|
|
90
|
+
"@types/node": "26.1.1",
|
|
94
91
|
"actions-up": "1.16.0",
|
|
95
|
-
"eslint": "10.
|
|
92
|
+
"eslint": "10.7.0",
|
|
96
93
|
"eslint-typegen": "2.3.1",
|
|
97
94
|
"nano-staged": "1.0.2",
|
|
98
|
-
"prettier": "3.9.
|
|
95
|
+
"prettier": "3.9.5",
|
|
99
96
|
"publint": "0.3.21",
|
|
100
97
|
"serve": "14.2.6",
|
|
101
98
|
"simple-git-hooks": "2.13.1",
|
|
102
99
|
"ts-morph": "28.0.0",
|
|
103
|
-
"tsdown": "0.22.
|
|
100
|
+
"tsdown": "0.22.4",
|
|
104
101
|
"typescript": "6.0.3",
|
|
105
102
|
"unplugin-unused": "0.5.7"
|
|
106
103
|
},
|
|
@@ -113,7 +110,7 @@
|
|
|
113
110
|
"devEngines": {
|
|
114
111
|
"packageManager": {
|
|
115
112
|
"name": "pnpm",
|
|
116
|
-
"version": "11.
|
|
113
|
+
"version": "11.11.0",
|
|
117
114
|
"onFail": "warn"
|
|
118
115
|
},
|
|
119
116
|
"runtime": {
|
|
@@ -128,7 +125,7 @@
|
|
|
128
125
|
"scripts": {
|
|
129
126
|
"git:gitmessage": "git config --local commit.template '.gitmessage'",
|
|
130
127
|
"update:actions": "actions-up --yes",
|
|
131
|
-
"update:deps": "pnpm update --latest
|
|
128
|
+
"update:deps": "pnpm update --latest && pnpm dedupe && pnpm generate:types && pnpm generate:docs",
|
|
132
129
|
"check:spell": "pnpx cspell . --gitignore --exclude='pnpm-lock.yaml' --cache --cache-location='./node_modules/.cache/.cspellcache'",
|
|
133
130
|
"inspect": "pnpm build:package && eslint-config-inspector",
|
|
134
131
|
"build:inspector": "eslint-config-inspector build --config=./scripts/configs/eslint.config.reference.ts --outDir=./netlify/eslint-config-inspector",
|