@shayanthenerd/eslint-config 0.28.5 → 0.29.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.
@@ -6,12 +6,10 @@ type RuleNames = keyof ESLintSchema;
6
6
  type PluginRuleNames = Extract<RuleNames, `${string}/${string}`>;
7
7
  type PluginNames = PluginRuleNames extends `${infer PluginName}/${string}` ? PluginName : never;
8
8
  type PluginRuleset<PluginName extends PluginNames> = Extract<PluginRuleNames, `${PluginName}/${string}`>;
9
- type CoreRuleNames = Exclude<RuleNames, PluginRuleNames>;
10
- type CoreRules = Pick<ESLintSchema, CoreRuleNames>;
11
9
  type PluginRules<PluginName extends PluginNames> = Pick<ESLintSchema, PluginRuleset<PluginName>>;
12
10
  /*** RuleOptions ***/
13
11
  type Rule<RuleName extends RuleNames> = DeepNonNullable<ESLintSchema>[RuleName];
14
12
  type RuleConfigs<RuleName extends RuleNames> = Tail<Rule<RuleName>>;
15
13
  type RuleOptions<RuleName extends RuleNames, Index extends (0 | 1 | 2) = 0> = NonNullable<RuleConfigs<RuleName>[Index]>;
16
14
  //#endregion
17
- export type { CoreRules, PluginRules, RuleOptions };
15
+ export type { PluginRules, RuleOptions };
@@ -1,7 +1,6 @@
1
1
  import { PluginRules, RuleOptions } from "./eslintRules.mjs";
2
2
  import { VueOptions } from "./options/vue.mjs";
3
3
  import { ZodOptions } from "./options/zod.mjs";
4
- import { BaseOptions } from "./options/base.mjs";
5
4
  import { NuxtOptions } from "./options/nuxt.mjs";
6
5
  import { TestOptions } from "./options/test.mjs";
7
6
  import { ReactOptions } from "./options/react.mjs";
@@ -253,7 +252,24 @@ interface Options {
253
252
  *
254
253
  * JavaScript rules cannot be turned off.
255
254
  */
256
- base?: BaseOptions;
255
+ base?: ConfigWithOverrides<CoreRules> & {
256
+ /**
257
+ * Enforce a maximum depth that blocks can be nested to reduce code complexity.
258
+ *
259
+ * @default 3
260
+ *
261
+ * @see [max-depth](https://eslint.org/docs/latest/rules/max-depth)
262
+ */
263
+ maxDepth?: Exclude<RuleOptions<'max-depth'>, Record<string, unknown>>;
264
+ /**
265
+ * Enforce a maximum depth that callbacks can be nested to increase code clarity.
266
+ *
267
+ * @default 3
268
+ *
269
+ * @see [max-nested-callbacks](https://eslint.org/docs/latest/rules/max-nested-callbacks)
270
+ */
271
+ maxNestedCallbacks?: Exclude<RuleOptions<'max-nested-callbacks'>, Record<string, unknown>>;
272
+ };
257
273
  /**
258
274
  * Use [@eslint/css](https://github.com/eslint/css) to enforce CSS best practices and identify mistakes.
259
275
  *
@@ -375,7 +391,26 @@ interface Options {
375
391
  *
376
392
  * @default true
377
393
  */
378
- unicorn?: boolean | ConfigWithOverrides<PluginRules<'unicorn'>>;
394
+ unicorn?: boolean | ConfigWithOverrides<PluginRules<'unicorn'>> & {
395
+ /**
396
+ * Enforce a consistent style across different function types.
397
+ *
398
+ * @default
399
+ * {
400
+ * callbacks: 'arrow-function',
401
+ * default: 'declaration',
402
+ * defaultExport: 'declaration',
403
+ * namedExports: 'declaration',
404
+ * namedFunctions: 'declaration',
405
+ * objectProperties: 'method',
406
+ * reassignedVariables: 'arrow-function',
407
+ * typedVariables: 'arrow-function',
408
+ * }
409
+ *
410
+ * @see [unicorn/consistent-function-style](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/consistent-function-style.md)
411
+ */
412
+ functionStyle?: Partial<RuleOptions<'unicorn/consistent-function-style'>>;
413
+ };
379
414
  /**
380
415
  * 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.
381
416
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shayanthenerd/eslint-config",
3
- "version": "0.28.5",
3
+ "version": "0.29.0",
4
4
  "description": "A modern, flexible ESLint configuration for enforcing best practices and maintaining a consistent coding style",
5
5
  "keywords": [
6
6
  "eslint",
@@ -49,20 +49,20 @@
49
49
  "{**/*.ts,package.json}": "pnpm lint"
50
50
  },
51
51
  "dependencies": {
52
- "@eslint-react/eslint-plugin": "5.18.0",
52
+ "@eslint-react/eslint-plugin": "5.18.2",
53
53
  "@eslint/css": "1.4.0",
54
54
  "@eslint/markdown": "8.0.3",
55
55
  "@html-eslint/eslint-plugin": "0.64.0",
56
56
  "@html-eslint/eslint-plugin-react": "0.64.0",
57
- "@next/eslint-plugin-next": "16.2.12",
57
+ "@next/eslint-plugin-next": "16.3.0",
58
58
  "@nuxt/eslint-plugin": "1.16.0",
59
59
  "@stylistic/eslint-plugin": "5.10.0",
60
- "@vitest/eslint-plugin": "1.6.24",
60
+ "@vitest/eslint-plugin": "1.6.26",
61
61
  "astro-eslint-parser": "3.0.0",
62
62
  "defu": "6.1.7",
63
63
  "eslint-flat-config-utils": "3.2.0",
64
64
  "eslint-import-resolver-typescript": "4.4.5",
65
- "eslint-plugin-astro": "3.0.1",
65
+ "eslint-plugin-astro": "3.1.0",
66
66
  "eslint-plugin-baseline-js": "0.7.0",
67
67
  "eslint-plugin-better-tailwindcss": "4.7.0",
68
68
  "eslint-plugin-cypress": "6.4.3",
@@ -70,24 +70,24 @@
70
70
  "eslint-plugin-jsx-a11y": "6.10.2",
71
71
  "eslint-plugin-n": "18.2.2",
72
72
  "eslint-plugin-package-json": "1.6.2",
73
- "eslint-plugin-perfectionist": "5.10.0",
73
+ "eslint-plugin-perfectionist": "5.10.1",
74
74
  "eslint-plugin-playwright": "2.11.0",
75
75
  "eslint-plugin-promise": "7.3.0",
76
- "eslint-plugin-storybook": "10.5.5",
77
- "eslint-plugin-unicorn": "72.0.0",
76
+ "eslint-plugin-storybook": "10.5.6",
77
+ "eslint-plugin-unicorn": "73.0.0",
78
78
  "eslint-plugin-vue": "10.10.0",
79
79
  "eslint-plugin-vuejs-accessibility": "2.5.0",
80
80
  "eslint-plugin-zod": "4.9.0",
81
81
  "eslint-plugin-zod-mini": "1.6.0",
82
- "globals": "17.8.0",
82
+ "globals": "17.9.0",
83
83
  "local-pkg": "1.2.1",
84
84
  "nuxt-link-checker": "5.1.3",
85
85
  "tailwind-csstree": "0.3.3",
86
- "typescript-eslint": "8.65.0"
86
+ "typescript-eslint": "8.66.0"
87
87
  },
88
88
  "devDependencies": {
89
89
  "@arethetypeswrong/cli": "0.18.5",
90
- "@eslint/config-inspector": "3.1.0",
90
+ "@eslint/config-inspector": "3.2.0",
91
91
  "@types/eslint-plugin-jsx-a11y": "6.10.1",
92
92
  "@types/node": "26.1.2",
93
93
  "actions-up": "1.16.0",
@@ -95,7 +95,7 @@
95
95
  "eslint-typegen": "2.3.1",
96
96
  "nano-staged": "1.0.2",
97
97
  "prettier": "3.9.6",
98
- "publint": "0.3.22",
98
+ "publint": "0.3.23",
99
99
  "serve": "14.2.6",
100
100
  "simple-git-hooks": "2.13.1",
101
101
  "ts-morph": "28.0.0",
@@ -112,7 +112,7 @@
112
112
  "devEngines": {
113
113
  "packageManager": {
114
114
  "name": "pnpm",
115
- "version": "11.16.0",
115
+ "version": "11.20.0",
116
116
  "onFail": "warn"
117
117
  },
118
118
  "runtime": {
@@ -1,35 +0,0 @@
1
- import { CoreRules, RuleOptions } from "../eslintRules.mjs";
2
- import { ConfigWithOverrides } from "../index.mjs";
3
- //#region src/types/options/base.d.ts
4
- type MaxDepthOptions = RuleOptions<'max-depth'>;
5
- type MaxNestedCallbacksOptions = RuleOptions<'max-nested-callbacks'>;
6
- interface BaseOptions extends ConfigWithOverrides<CoreRules> {
7
- /**
8
- * Enforce the consistent use of either function declarations or function expressions.
9
- *
10
- * Even when set to `'declaration'`, function expressions are still allowed, with or without a type annotation.
11
- *
12
- * @default 'declaration'
13
- *
14
- * @see [func-style](https://eslint.org/docs/latest/rules/func-style)
15
- */
16
- functionStyle?: RuleOptions<'func-style'>;
17
- /**
18
- * Enforce a maximum depth that blocks can be nested to reduce code complexity.
19
- *
20
- * @default 3
21
- *
22
- * @see [max-depth](https://eslint.org/docs/latest/rules/max-depth)
23
- */
24
- maxDepth?: Exclude<MaxDepthOptions, Record<string, unknown>>;
25
- /**
26
- * Enforce a maximum depth that callbacks can be nested to increase code clarity.
27
- *
28
- * @default 3
29
- *
30
- * @see [max-nested-callbacks](https://eslint.org/docs/latest/rules/max-nested-callbacks)
31
- */
32
- maxNestedCallbacks?: Exclude<MaxNestedCallbacksOptions, Record<string, unknown>>;
33
- }
34
- //#endregion
35
- export type { BaseOptions };