@shayanthenerd/eslint-config 0.29.4 → 0.30.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.
@@ -1,15 +1,15 @@
1
1
  import { ESLintSchema } from "./eslint-schema.mjs";
2
2
  import { DeepNonNullable, Tail } from "./helpers.mjs";
3
3
  //#region src/types/eslintRules.d.ts
4
- /*** CoreRules & PluginRules ***/
5
4
  type RuleNames = keyof ESLintSchema;
6
5
  type PluginRuleNames = Extract<RuleNames, `${string}/${string}`>;
7
6
  type PluginNames = PluginRuleNames extends `${infer PluginName}/${string}` ? PluginName : never;
8
7
  type PluginRuleset<PluginName extends PluginNames> = Extract<PluginRuleNames, `${PluginName}/${string}`>;
8
+ type JavascriptRuleNames = Exclude<RuleNames, PluginRuleNames>;
9
+ type JavascriptRules = Pick<ESLintSchema, JavascriptRuleNames>;
9
10
  type PluginRules<PluginName extends PluginNames> = Pick<ESLintSchema, PluginRuleset<PluginName>>;
10
- /*** RuleOptions ***/
11
11
  type Rule<RuleName extends RuleNames> = DeepNonNullable<ESLintSchema>[RuleName];
12
12
  type RuleConfigs<RuleName extends RuleNames> = Tail<Rule<RuleName>>;
13
13
  type RuleOptions<RuleName extends RuleNames, Index extends (0 | 1 | 2) = 0> = NonNullable<RuleConfigs<RuleName>[Index]>;
14
14
  //#endregion
15
- export type { PluginRules, RuleOptions };
15
+ export type { JavascriptRules, PluginRules, RuleOptions };
@@ -1,4 +1,4 @@
1
- import { PluginRules, RuleOptions } from "./eslintRules.mjs";
1
+ import { JavascriptRules, PluginRules, RuleOptions } from "./eslintRules.mjs";
2
2
  import { VueOptions } from "./options/vue.mjs";
3
3
  import { ZodOptions } from "./options/zod.mjs";
4
4
  import { NuxtOptions } from "./options/nuxt.mjs";
@@ -8,7 +8,7 @@ import { BaselineOptions } from "./options/baseline.mjs";
8
8
  import { MarkdownOptions } from "./options/markdown.mjs";
9
9
  import { TailwindOptions } from "./options/tailwind.mjs";
10
10
  import { StylisticOptions } from "./options/stylistic.mjs";
11
- import { TypeScriptOptions } from "./options/typescript.mjs";
11
+ import { TypescriptOptions } from "./options/typescript.mjs";
12
12
  import { Linter } from "eslint";
13
13
  //#region src/types/index.d.ts
14
14
  type ConfigOverrides = Pick<Linter.Config, 'name' | 'files' | 'ignores' | 'plugins' | 'settings' | 'languageOptions'>;
@@ -41,7 +41,7 @@ interface Options {
41
41
  * Specify the runtime environment.
42
42
  *
43
43
  * This is used by
44
- * - `configs.useBaseline` option (disabled when `env` is set to a value other than `'browser'`)
44
+ * - `configs.baseline` option (disabled when `env` is set to a value other than `'browser'`)
45
45
  * - [ESLint: Specifying Globals](https://eslint.org/docs/latest/use/configure/language-options#using-configuration-files)
46
46
  * - [perfectionist/sort-imports: `env` option](https://perfectionist.dev/rules/sort-imports#environment)
47
47
  *
@@ -248,11 +248,17 @@ interface Options {
248
248
  */
249
249
  astro?: boolean | ConfigWithOverrides<PluginRules<'astro'>>;
250
250
  /**
251
- * Customize some of the JavaScript (core) rules.
251
+ * Use [eslint-plugin-baseline-js](https://github.com/3ru/eslint-plugin-baseline-js), [css/use-baseline](https://github.com/eslint/css/blob/main/docs/rules/use-baseline.md#options), [@html-eslint/use-baseline](https://html-eslint.org/docs/rules/use-baseline#options), and [@html-eslint/react/use-baseline](https://github.com/eslint/css/blob/main/docs/rules/use-baseline.md#options) to enforce the use of baseline features.
252
+ *
253
+ * @default true // `false` if `env` is set to a value other than `'browser'`
254
+ */
255
+ baseline?: boolean | BaselineOptions;
256
+ /**
257
+ * Customize JavaScript (core) rules and options.
252
258
  *
253
- * JavaScript rules cannot be turned off.
259
+ * This configuration cannot be disabled.
254
260
  */
255
- base?: ConfigWithOverrides<CoreRules> & {
261
+ javascript?: ConfigWithOverrides<JavascriptRules> & {
256
262
  /**
257
263
  * Enforce a maximum depth that blocks can be nested to reduce code complexity.
258
264
  *
@@ -385,7 +391,7 @@ interface Options {
385
391
  *
386
392
  * @default false // `true` if "typescript" is detected in the dependencies when `autoDetectDeps` is enabled
387
393
  */
388
- typescript?: boolean | TypeScriptOptions;
394
+ typescript?: boolean | TypescriptOptions;
389
395
  /**
390
396
  * Use [eslint-plugin-unicorn](https://github.com/sindresorhus/eslint-plugin-unicorn) to enforce general best practices and catch common mistakes.
391
397
  *
@@ -413,12 +419,6 @@ interface Options {
413
419
  */
414
420
  functionStyle?: Partial<RuleOptions<'unicorn/consistent-function-style'>>;
415
421
  };
416
- /**
417
- * Use [eslint-plugin-baseline-js](https://github.com/3ru/eslint-plugin-baseline-js), [css/use-baseline](https://github.com/eslint/css/blob/main/docs/rules/use-baseline.md#options), [@html-eslint/use-baseline](https://html-eslint.org/docs/rules/use-baseline#options), and [@html-eslint/react/use-baseline](https://github.com/eslint/css/blob/main/docs/rules/use-baseline.md#options) to enforce the use of baseline features.
418
- *
419
- * @default true // `false` if `env` is set to a value other than `'browser'`
420
- */
421
- useBaseline?: boolean | BaselineOptions;
422
422
  /**
423
423
  * Use [eslint-plugin-vue](https://eslint.vuejs.org) to enforce Vue best practices, accessibility guidelines, stylistic rules, and identify mistakes.
424
424
  *
@@ -1,7 +1,7 @@
1
1
  import { PluginRules, RuleOptions } from "../eslintRules.mjs";
2
2
  import { ConfigWithOverrides } from "../index.mjs";
3
3
  //#region src/types/options/react.d.ts
4
- type ConfigRules = PluginRules<'react'>;
4
+ type ConfigRules = PluginRules<'@eslint-react'>;
5
5
  interface ReactOptions extends ConfigWithOverrides<ConfigRules> {
6
6
  /**
7
7
  * Use [eslint-plugin-jsx-a11y](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y) and [@html-eslint/eslint-plugin-react](https://html-eslint.org/docs/react/getting-started) to enforce accessibility standards for React components.
@@ -2,7 +2,7 @@ import { PluginRules, RuleOptions } from "../eslintRules.mjs";
2
2
  import { ConfigWithOverrides } from "../index.mjs";
3
3
  //#region src/types/options/typescript.d.ts
4
4
  type ConfigRules = PluginRules<'@typescript-eslint'>;
5
- interface TypeScriptOptions extends ConfigWithOverrides<ConfigRules> {
5
+ interface TypescriptOptions extends ConfigWithOverrides<ConfigRules> {
6
6
  /**
7
7
  * Globs of files to allow running with the default project compiler options despite not being matched by the project service (_tsconfig.json_).
8
8
  *
@@ -43,4 +43,4 @@ interface TypeScriptOptions extends ConfigWithOverrides<ConfigRules> {
43
43
  typeDefinitionStyle?: RuleOptions<'@typescript-eslint/consistent-type-definitions'>;
44
44
  }
45
45
  //#endregion
46
- export type { TypeScriptOptions };
46
+ export type { TypescriptOptions };
@@ -133,7 +133,7 @@ interface VueOptions extends ConfigWithOverrides<ConfigRules> {
133
133
  /**
134
134
  * Enforce a consistent style for destructuring props.
135
135
  *
136
- * @default 'always'
136
+ * @default 'only-when-assigned'
137
137
  *
138
138
  * @see [vue/define-props-destructuring: `destructure` option](https://eslint.vuejs.org/rules/define-props-destructuring#options)
139
139
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shayanthenerd/eslint-config",
3
- "version": "0.29.4",
3
+ "version": "0.30.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",
@@ -44,17 +44,24 @@
44
44
  },
45
45
  "nano-staged": {
46
46
  "**/*.{json,yaml}!pnpm-lock.yaml": "pnpm format",
47
- "pnpm-lock.yaml": "pnpm generate:types && pnpm generate:docs",
48
- "src/types/**/*.d.ts": "pnpm generate:docs",
47
+ "pnpm-lock.yaml": [
48
+ "pnpm generate:types",
49
+ "pnpm generate:docs",
50
+ "git add src/types/eslint-schema.d.ts README.md"
51
+ ],
52
+ "src/types/**/*.d.ts": [
53
+ "pnpm generate:docs",
54
+ "git add README.md"
55
+ ],
49
56
  "{**/*.ts,package.json}": "pnpm lint"
50
57
  },
51
58
  "dependencies": {
52
59
  "@eslint-react/eslint-plugin": "5.18.6",
53
60
  "@eslint/css": "1.4.0",
54
61
  "@eslint/markdown": "8.0.3",
55
- "@html-eslint/eslint-plugin": "0.64.0",
56
- "@html-eslint/eslint-plugin-react": "0.64.0",
57
- "@next/eslint-plugin-next": "16.3.1",
62
+ "@html-eslint/eslint-plugin": "0.65.0",
63
+ "@html-eslint/eslint-plugin-react": "0.65.0",
64
+ "@next/eslint-plugin-next": "16.3.2",
58
65
  "@nuxt/eslint-plugin": "1.17.0",
59
66
  "@stylistic/eslint-plugin": "5.10.0",
60
67
  "@vitest/eslint-plugin": "1.6.27",
@@ -65,7 +72,7 @@
65
72
  "eslint-plugin-astro": "3.1.0",
66
73
  "eslint-plugin-baseline-js": "0.7.1",
67
74
  "eslint-plugin-better-tailwindcss": "4.7.0",
68
- "eslint-plugin-cypress": "7.0.0",
75
+ "eslint-plugin-cypress": "7.0.1",
69
76
  "eslint-plugin-import-x": "4.17.1",
70
77
  "eslint-plugin-jsx-a11y": "6.10.2",
71
78
  "eslint-plugin-n": "18.3.0",
@@ -73,7 +80,7 @@
73
80
  "eslint-plugin-perfectionist": "5.10.1",
74
81
  "eslint-plugin-playwright": "2.11.0",
75
82
  "eslint-plugin-promise": "7.3.0",
76
- "eslint-plugin-storybook": "10.5.8",
83
+ "eslint-plugin-storybook": "10.5.10",
77
84
  "eslint-plugin-unicorn": "73.0.0",
78
85
  "eslint-plugin-vue": "10.10.0",
79
86
  "eslint-plugin-vuejs-accessibility": "2.6.0",
@@ -81,20 +88,20 @@
81
88
  "eslint-plugin-zod-mini": "1.6.1",
82
89
  "globals": "17.11.0",
83
90
  "local-pkg": "1.2.1",
84
- "nuxt-link-checker": "5.1.3",
91
+ "nuxt-link-checker": "5.3.0",
85
92
  "tailwind-csstree": "0.3.3",
86
93
  "typescript-eslint": "8.67.0"
87
94
  },
88
95
  "devDependencies": {
89
96
  "@arethetypeswrong/cli": "0.18.5",
90
- "@eslint/config-inspector": "3.2.0",
97
+ "@eslint/config-inspector": "3.3.0",
91
98
  "@types/eslint-plugin-jsx-a11y": "6.10.1",
92
99
  "@types/node": "26.2.0",
93
- "eslint": "10.8.1",
100
+ "eslint": "10.9.0",
94
101
  "eslint-typegen": "2.3.1",
95
102
  "nano-staged": "1.0.2",
96
103
  "prettier": "3.9.6",
97
- "publint": "0.3.23",
104
+ "publint": "0.3.24",
98
105
  "serve": "14.2.6",
99
106
  "simple-git-hooks": "2.13.1",
100
107
  "ts-morph": "28.0.0",
@@ -103,7 +110,7 @@
103
110
  "unplugin-unused": "0.6.0"
104
111
  },
105
112
  "peerDependencies": {
106
- "eslint": "^10.6.0"
113
+ "eslint": "^10.9.0"
107
114
  },
108
115
  "engines": {
109
116
  "node": "^20.19.0 || ^22.13.0 || ^24.0.0 || ^26.0.0"
@@ -111,7 +118,7 @@
111
118
  "devEngines": {
112
119
  "packageManager": {
113
120
  "name": "pnpm",
114
- "version": "11.21.0",
121
+ "version": "11.22.0",
115
122
  "onFail": "warn"
116
123
  },
117
124
  "runtime": {