@shayanthenerd/eslint-config 0.30.3 → 0.32.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.
Files changed (48) hide show
  1. package/README.md +15 -5
  2. package/dist/configs/astro.mjs +6 -5
  3. package/dist/configs/baseline.mjs +1 -1
  4. package/dist/configs/css.mjs +5 -4
  5. package/dist/configs/cypress.mjs +4 -3
  6. package/dist/configs/html.mjs +4 -3
  7. package/dist/configs/importX.mjs +5 -4
  8. package/dist/configs/javascript.mjs +5 -4
  9. package/dist/configs/markdown.mjs +4 -3
  10. package/dist/configs/next.mjs +4 -3
  11. package/dist/configs/node.mjs +6 -5
  12. package/dist/configs/nuxt.mjs +23 -22
  13. package/dist/configs/packageJson.mjs +4 -3
  14. package/dist/configs/perfectionist.mjs +5 -4
  15. package/dist/configs/playwright.mjs +4 -3
  16. package/dist/configs/promise.mjs +5 -4
  17. package/dist/configs/react.mjs +4 -3
  18. package/dist/configs/storybook.mjs +4 -3
  19. package/dist/configs/stylistic.mjs +5 -4
  20. package/dist/configs/tailwind.mjs +5 -4
  21. package/dist/configs/tanstack.mjs +26 -0
  22. package/dist/configs/typescript.mjs +5 -4
  23. package/dist/configs/unicorn.mjs +5 -4
  24. package/dist/configs/vitest.mjs +4 -3
  25. package/dist/configs/vue.mjs +5 -4
  26. package/dist/configs/zod.mjs +5 -4
  27. package/dist/helpers/options/defaultOptions.mjs +6 -0
  28. package/dist/helpers/options/enableDetectedConfigs.mjs +11 -1
  29. package/dist/helpers/options/mergeWithDefaults.mjs +1 -1
  30. package/dist/index.d.mts +3 -3
  31. package/dist/index.mjs +22 -53
  32. package/dist/rules/baseline.mjs +1 -1
  33. package/dist/rules/css.mjs +1 -1
  34. package/dist/rules/html.mjs +1 -1
  35. package/dist/rules/markdown.mjs +1 -1
  36. package/dist/rules/perfectionist.mjs +8 -13
  37. package/dist/rules/react.mjs +1 -1
  38. package/dist/rules/stylistic.mjs +4 -2
  39. package/dist/rules/tailwind.mjs +1 -1
  40. package/dist/rules/tanstack.mjs +39 -0
  41. package/dist/rules/typescript.mjs +2 -2
  42. package/dist/rules/unicorn.mjs +1 -1
  43. package/dist/rules/vue.mjs +4 -3
  44. package/dist/rules/zod.mjs +1 -1
  45. package/dist/types/eslint-schema.d.mts +678 -430
  46. package/dist/types/index.d.mts +15 -6
  47. package/dist/types/options/tanstack.d.mts +32 -0
  48. package/package.json +23 -18
@@ -1,14 +1,15 @@
1
1
  import { JavascriptRules, PluginRules, RuleOptions } from "./eslintRules.mjs";
2
- import { VueOptions } from "./options/vue.mjs";
3
- import { ZodOptions } from "./options/zod.mjs";
4
- import { NuxtOptions } from "./options/nuxt.mjs";
5
- import { TestOptions } from "./options/test.mjs";
6
- import { ReactOptions } from "./options/react.mjs";
7
2
  import { BaselineOptions } from "./options/baseline.mjs";
8
3
  import { MarkdownOptions } from "./options/markdown.mjs";
9
- import { TailwindOptions } from "./options/tailwind.mjs";
4
+ import { NuxtOptions } from "./options/nuxt.mjs";
5
+ import { ReactOptions } from "./options/react.mjs";
10
6
  import { StylisticOptions } from "./options/stylistic.mjs";
7
+ import { TailwindOptions } from "./options/tailwind.mjs";
8
+ import { TanstackOptions } from "./options/tanstack.mjs";
9
+ import { TestOptions } from "./options/test.mjs";
11
10
  import { TypescriptOptions } from "./options/typescript.mjs";
11
+ import { VueOptions } from "./options/vue.mjs";
12
+ import { ZodOptions } from "./options/zod.mjs";
12
13
  import { Linter } from "eslint";
13
14
  //#region src/types/index.d.ts
14
15
  type ConfigOverrides = Pick<Linter.Config, 'name' | 'files' | 'ignores' | 'plugins' | 'settings' | 'languageOptions'>;
@@ -346,6 +347,8 @@ interface Options {
346
347
  /**
347
348
  * The type of sorting.
348
349
  *
350
+ * It doesn't apply to [perfectionist/sort-imports](https://perfectionist.dev/rules/sort-imports).
351
+ *
349
352
  * @default 'line-length'
350
353
  *
351
354
  * @see [Perfectionist Settings: `type` option](https://perfectionist.dev/guide/getting-started#settings)
@@ -376,6 +379,12 @@ interface Options {
376
379
  * @default false
377
380
  */
378
381
  tailwind?: false | TailwindOptions;
382
+ /**
383
+ * Use [@tanstack/eslint-plugin-start](https://tanstack.com/start/latest/docs/eslint/eslint-plugin-start), [@tanstack/eslint-plugin-query](https://tanstack.com/query/latest/docs/eslint/eslint-plugin-query), and [@tanstack/eslint-plugin-router](https://tanstack.com/router/latest/docs/eslint/eslint-plugin-router) to enforce best practices and avoid common mistakes when using TanStack Start, TanStack Router, and TanStack Query.
384
+ *
385
+ * @default false // `true` if either of "@tanstack/react-start", "@tanstack/react-query", or "@tanstack/react-router" are detected in the dependencies when `autoDetectDeps` is enabled
386
+ */
387
+ tanstack?: boolean | TanstackOptions;
379
388
  /**
380
389
  * Configuration options for the testing tools.
381
390
  */
@@ -0,0 +1,32 @@
1
+ import { PluginRules } from "../eslintRules.mjs";
2
+ import { ConfigWithOverrides } from "../index.mjs";
3
+ //#region src/types/options/tanstack.d.ts
4
+ type ConfigRules = PluginRules<'@tanstack'>;
5
+ interface TanstackOptions extends ConfigWithOverrides<ConfigRules> {
6
+ /**
7
+ * Whether [@tanstack/query](https://tanstack.com/query) is used in the project.
8
+ *
9
+ * @default false // `true` if "@tanstack/react-query" is detected in the dependencies when `autoDetectDeps` is enabled
10
+ *
11
+ * @see [@tanstack/eslint-plugin-query](https://tanstack.com/query/latest/docs/eslint/eslint-plugin-query)
12
+ */
13
+ query?: boolean;
14
+ /**
15
+ * Whether [@tanstack/router](https://tanstack.com/router) is used in the project.
16
+ *
17
+ * @default false // `true` if "@tanstack/react-router" is detected in the dependencies when `autoDetectDeps` is enabled
18
+ *
19
+ * @see [@tanstack/eslint-plugin-router](https://tanstack.com/router/latest/docs/eslint/eslint-plugin-router)
20
+ */
21
+ router?: boolean;
22
+ /**
23
+ * Whether [@tanstack/start](https://tanstack.com/start) is used in the project.
24
+ *
25
+ * @default false // `true` if "@tanstack/react-start" is detected in the dependencies when `autoDetectDeps` is enabled
26
+ *
27
+ * @see [@tanstack/eslint-plugin-start](https://tanstack.com/start/latest/docs/eslint/eslint-plugin-start)
28
+ */
29
+ start?: boolean;
30
+ }
31
+ //#endregion
32
+ export type { TanstackOptions };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shayanthenerd/eslint-config",
3
- "version": "0.30.3",
3
+ "version": "0.32.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",
@@ -43,7 +43,9 @@
43
43
  "pre-commit": "./node_modules/.bin/nano-staged"
44
44
  },
45
45
  "nano-staged": {
46
- "**/*.{json,yaml}!pnpm-lock.yaml": "pnpm format",
46
+ "**/*.json": "pnpm format",
47
+ "**/*.ts": "pnpm lint --no-warn-ignored",
48
+ "package.json": "pnpm lint",
47
49
  "pnpm-lock.yaml": [
48
50
  "pnpm generate:types",
49
51
  "pnpm generate:docs",
@@ -53,17 +55,20 @@
53
55
  "pnpm generate:docs",
54
56
  "git add README.md"
55
57
  ],
56
- "{**/*.ts,package.json}": "pnpm lint"
58
+ "{.github/workflows/**/*.yaml,pnpm-workspace.yaml}": "pnpm format"
57
59
  },
58
60
  "dependencies": {
59
- "@eslint-react/eslint-plugin": "5.18.6",
60
- "@eslint/css": "1.4.0",
61
+ "@eslint-react/eslint-plugin": "5.19.0",
62
+ "@eslint/css": "2.0.0",
61
63
  "@eslint/markdown": "8.0.3",
62
64
  "@html-eslint/eslint-plugin": "0.65.0",
63
65
  "@html-eslint/eslint-plugin-react": "0.65.0",
64
- "@next/eslint-plugin-next": "16.3.3",
66
+ "@next/eslint-plugin-next": "16.3.4",
65
67
  "@nuxt/eslint-plugin": "1.17.0",
66
68
  "@stylistic/eslint-plugin": "5.10.0",
69
+ "@tanstack/eslint-plugin-query": "5.102.8",
70
+ "@tanstack/eslint-plugin-router": "1.162.0",
71
+ "@tanstack/eslint-plugin-start": "0.1.0",
67
72
  "@vitest/eslint-plugin": "1.6.27",
68
73
  "astro-eslint-parser": "3.1.0",
69
74
  "defu": "6.1.7",
@@ -72,32 +77,32 @@
72
77
  "eslint-plugin-astro": "3.1.0",
73
78
  "eslint-plugin-baseline-js": "0.7.1",
74
79
  "eslint-plugin-better-tailwindcss": "4.7.0",
75
- "eslint-plugin-cypress": "7.0.1",
80
+ "eslint-plugin-cypress": "7.0.2",
76
81
  "eslint-plugin-import-x": "4.17.1",
77
82
  "eslint-plugin-jsx-a11y": "6.10.2",
78
83
  "eslint-plugin-n": "18.3.0",
79
84
  "eslint-plugin-package-json": "1.8.0",
80
- "eslint-plugin-perfectionist": "5.10.1",
85
+ "eslint-plugin-perfectionist": "5.11.0",
81
86
  "eslint-plugin-playwright": "2.11.0",
82
87
  "eslint-plugin-promise": "7.3.0",
83
- "eslint-plugin-storybook": "10.5.10",
88
+ "eslint-plugin-storybook": "10.6.0",
84
89
  "eslint-plugin-unicorn": "74.0.0",
85
- "eslint-plugin-vue": "10.10.0",
90
+ "eslint-plugin-vue": "10.11.0",
86
91
  "eslint-plugin-vuejs-accessibility": "2.6.0",
87
92
  "eslint-plugin-zod": "4.12.0",
88
93
  "eslint-plugin-zod-mini": "1.9.0",
89
- "globals": "17.11.0",
94
+ "globals": "17.12.0",
90
95
  "local-pkg": "1.2.1",
91
96
  "nuxt-link-checker": "5.3.0",
92
- "tailwind-csstree": "0.3.3",
93
- "typescript-eslint": "8.68.0"
97
+ "tailwind-csstree": "0.4.0",
98
+ "typescript-eslint": "8.70.0"
94
99
  },
95
100
  "devDependencies": {
96
101
  "@arethetypeswrong/cli": "0.18.5",
97
- "@eslint/config-inspector": "3.3.0",
102
+ "@eslint/config-inspector": "3.4.0",
98
103
  "@types/eslint-plugin-jsx-a11y": "6.10.1",
99
- "@types/node": "26.4.0",
100
- "eslint": "10.9.1",
104
+ "@types/node": "26.5.0",
105
+ "eslint": "10.10.0",
101
106
  "eslint-typegen": "2.3.1",
102
107
  "nano-staged": "1.0.2",
103
108
  "prettier": "3.9.6",
@@ -105,7 +110,7 @@
105
110
  "serve": "14.2.6",
106
111
  "simple-git-hooks": "2.14.0",
107
112
  "ts-morph": "28.0.0",
108
- "tsdown": "0.22.14",
113
+ "tsdown": "0.23.0",
109
114
  "typescript": "6.0.3",
110
115
  "unplugin-unused": "0.6.0"
111
116
  },
@@ -118,7 +123,7 @@
118
123
  "devEngines": {
119
124
  "packageManager": {
120
125
  "name": "pnpm",
121
- "version": "12.1.0",
126
+ "version": "12.3.4",
122
127
  "onFail": "warn"
123
128
  },
124
129
  "runtime": {