@eslint-sets/eslint-config 6.3.0-beta.1 → 6.3.0-beta.2

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 CHANGED
@@ -149,10 +149,11 @@ export default eslintConfig({
149
149
  // Disable rules in config files (default: true)
150
150
  disables: true,
151
151
 
152
- // e18e modernization rules (default: false)
153
- e18e: true,
154
- // ESLint comments rules (default: true)
155
- eslintComments: true,
152
+ // ESLint directive comments rules (default: true)
153
+ comments: true,
154
+
155
+ // JSDoc rules (default: true)
156
+ jsdoc: true,
156
157
 
157
158
  // External formatters (default: false)
158
159
  formatters: {
@@ -179,8 +180,10 @@ export default eslintConfig({
179
180
  // JSON/JSONC support (default: true)
180
181
  jsonc: true,
181
182
 
182
- // JSX Accessibility rules (default: false)
183
- jsxA11y: true,
183
+ // JSX support with optional a11y (default: false)
184
+ jsx: true,
185
+ // Or with a11y:
186
+ // jsx: { a11y: true },
184
187
 
185
188
  // Markdown support (default: true)
186
189
  markdown: true,
@@ -374,14 +377,11 @@ export default eslintConfig({
374
377
  },
375
378
  })
376
379
 
377
- // React/JSX accessibility
378
- export default eslintConfig({
379
- jsxA11y: true,
380
- })
381
-
382
- // Or standalone JSX a11y
380
+ // JSX accessibility
383
381
  export default eslintConfig({
384
- jsxA11y: true,
382
+ jsx: {
383
+ a11y: true,
384
+ },
385
385
  })
386
386
  ```
387
387
 
@@ -638,16 +638,16 @@ import {
638
638
  stylistic,
639
639
  disables,
640
640
  command,
641
+ comments,
642
+ jsdoc,
643
+ jsx,
641
644
  nextjs,
642
645
  nuxt,
643
646
  astro,
644
647
  angular,
645
648
  unocss,
646
- e18e,
647
649
  pnpm,
648
650
  formatters,
649
- eslintComments,
650
- jsxA11y,
651
651
  sortPackageJson,
652
652
  sortTsconfig,
653
653
  } from '@eslint-sets/eslint-config'
@@ -712,10 +712,6 @@ The following packages are optional and will be used if installed:
712
712
 
713
713
  - `eslint-plugin-jsx-a11y` - JSX accessibility rules
714
714
 
715
- ### Modernization
716
-
717
- - `@e18e/eslint-plugin` - Code modernization rules
718
-
719
715
  ### Workspace
720
716
 
721
717
  - `eslint-plugin-pnpm` - pnpm workspace rules
@@ -1,2 +1,14 @@
1
- export {};
1
+ import type { Answers } from './types';
2
+ /**
3
+ * Generate ESLint config content based on answers
4
+ */
5
+ export declare function generateConfig(answers: Answers): string;
6
+ /**
7
+ * Get list of dependencies based on answers
8
+ */
9
+ export declare function getDependencies(answers: Answers): string[];
10
+ /**
11
+ * Get install command for package manager
12
+ */
13
+ export declare function getInstallCommand(packageManager: string, deps: string[]): string;
2
14
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AAKtC;;GAEG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,CA2CvD;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,EAAE,CAgD1D;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,cAAc,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,CAehF"}
package/dist/cli/index.js CHANGED
@@ -4,24 +4,115 @@
4
4
  import { existsSync, writeFileSync } from "node:fs";
5
5
  import { resolve } from "node:path";
6
6
  import * as p from "@clack/prompts";
7
+ function generateConfig(answers) {
8
+ const lines = [
9
+ "// eslint.config.ts",
10
+ "import eslintConfig from '@eslint-sets/eslint-config'",
11
+ "",
12
+ "export default eslintConfig({",
13
+ ` type: '${answers.type}',`
14
+ ];
15
+ if (answers.frameworks.length > 0) {
16
+ for (const fw of answers.frameworks) {
17
+ if (fw === "vue" || fw === "react") {
18
+ lines.push(` ${fw}: {`);
19
+ if (answers.a11y) {
20
+ lines.push(" a11y: true,");
21
+ }
22
+ lines.push(" },");
23
+ } else {
24
+ lines.push(` ${fw}: true,`);
25
+ }
26
+ }
27
+ }
28
+ if (answers.formatter === "stylistic") {
29
+ lines.push(" prettier: false,");
30
+ lines.push(" stylistic: true,");
31
+ }
32
+ if (!answers.gitignore) {
33
+ lines.push(" gitignore: false,");
34
+ }
35
+ if (!answers.sortPackageJson) {
36
+ lines.push(" sortPackageJson: false,");
37
+ }
38
+ if (!answers.sortTsconfig) {
39
+ lines.push(" sortTsconfig: false,");
40
+ }
41
+ lines.push("})");
42
+ return lines.join("\n");
43
+ }
44
+ function getDependencies(answers) {
45
+ const deps = ["@eslint-sets/eslint-config", "eslint"];
46
+ if (answers.typescript) {
47
+ deps.push("typescript");
48
+ }
49
+ if (answers.formatter === "prettier") {
50
+ deps.push("prettier");
51
+ }
52
+ if (answers.frameworks.includes("react")) {
53
+ deps.push("@eslint-react/eslint-plugin");
54
+ deps.push("eslint-plugin-react-refresh");
55
+ }
56
+ if (answers.frameworks.includes("nextjs")) {
57
+ deps.push("@next/eslint-plugin-next");
58
+ deps.push("@eslint-react/eslint-plugin");
59
+ deps.push("eslint-plugin-react-refresh");
60
+ }
61
+ if (answers.frameworks.includes("astro")) {
62
+ deps.push("eslint-plugin-astro");
63
+ deps.push("astro-eslint-parser");
64
+ }
65
+ if (answers.frameworks.includes("angular")) {
66
+ deps.push("@angular-eslint/eslint-plugin");
67
+ deps.push("@angular-eslint/eslint-plugin-template");
68
+ deps.push("@angular-eslint/template-parser");
69
+ }
70
+ if (answers.frameworks.includes("unocss")) {
71
+ deps.push("@unocss/eslint-plugin");
72
+ }
73
+ if (answers.a11y) {
74
+ if (answers.frameworks.includes("react")) {
75
+ deps.push("eslint-plugin-jsx-a11y");
76
+ }
77
+ if (answers.frameworks.includes("vue")) {
78
+ deps.push("eslint-plugin-vuejs-accessibility");
79
+ }
80
+ }
81
+ return deps;
82
+ }
83
+ function getInstallCommand(packageManager, deps) {
84
+ const depsStr = deps.join(" ");
85
+ switch (packageManager) {
86
+ case "pnpm":
87
+ return `pnpm add -D ${depsStr}`;
88
+ case "npm":
89
+ return `npm install -D ${depsStr}`;
90
+ case "yarn":
91
+ return `yarn add -D ${depsStr}`;
92
+ case "bun":
93
+ return `bun add -D ${depsStr}`;
94
+ default:
95
+ return `pnpm add -D ${depsStr}`;
96
+ }
97
+ }
7
98
  async function main() {
8
99
  console.clear();
9
100
  p.intro(" @eslint-sets/eslint-config ");
10
101
  const answers = {
102
+ type: "app",
11
103
  a11y: false,
12
104
  formatter: "prettier",
13
105
  frameworks: [],
14
106
  gitignore: true,
15
107
  sortPackageJson: true,
16
108
  sortTsconfig: true,
17
- type: "app",
18
109
  typescript: true
19
110
  };
20
111
  const projectType = await p.select({
21
112
  message: "What type of project is this?",
22
113
  options: [
23
- { hint: "Web application with relaxed rules", label: "Application", value: "app" },
24
- { hint: "Library with stricter rules", label: "Library", value: "lib" }
114
+ { value: "app", hint: "Web application with relaxed rules", label: "Application" },
115
+ { value: "lib", hint: "Library with stricter rules", label: "Library" }
25
116
  ]
26
117
  });
27
118
  if (p.isCancel(projectType)) {
@@ -41,15 +132,15 @@ async function main() {
41
132
  const frameworks = await p.multiselect({
42
133
  message: "Select frameworks you use",
43
134
  options: [
44
- { hint: "Vue.js framework", label: "Vue", value: "vue" },
45
- { hint: "React library", label: "React", value: "react" },
46
- { hint: "Svelte framework", label: "Svelte", value: "svelte" },
47
- { hint: "SolidJS framework", label: "Solid", value: "solid" },
48
- { hint: "React framework", label: "Next.js", value: "nextjs" },
49
- { hint: "Vue framework", label: "Nuxt", value: "nuxt" },
50
- { hint: "Static site builder", label: "Astro", value: "astro" },
51
- { hint: "Angular framework", label: "Angular", value: "angular" },
52
- { hint: "Atomic CSS engine", label: "UnoCSS", value: "unocss" }
135
+ { value: "vue", hint: "Vue.js framework", label: "Vue" },
136
+ { value: "react", hint: "React library", label: "React" },
137
+ { value: "svelte", hint: "Svelte framework", label: "Svelte" },
138
+ { value: "solid", hint: "SolidJS framework", label: "Solid" },
139
+ { value: "nextjs", hint: "React framework", label: "Next.js" },
140
+ { value: "nuxt", hint: "Vue framework", label: "Nuxt" },
141
+ { value: "astro", hint: "Static site builder", label: "Astro" },
142
+ { value: "angular", hint: "Angular framework", label: "Angular" },
143
+ { value: "unocss", hint: "Atomic CSS engine", label: "UnoCSS" }
53
144
  ],
54
145
  required: false
55
146
  });
@@ -72,8 +163,8 @@ async function main() {
72
163
  const formatter = await p.select({
73
164
  message: "Choose a formatter",
74
165
  options: [
75
- { hint: "Popular code formatter", label: "Prettier", value: "prettier" },
76
- { hint: "ESLint-based formatting", label: "ESLint Stylistic", value: "stylistic" }
166
+ { value: "prettier", hint: "Popular code formatter", label: "Prettier" },
167
+ { value: "stylistic", hint: "ESLint-based formatting", label: "ESLint Stylistic" }
77
168
  ]
78
169
  });
79
170
  if (p.isCancel(formatter)) {
@@ -126,10 +217,10 @@ async function main() {
126
217
  const packageManager = await p.select({
127
218
  message: "Choose a package manager",
128
219
  options: [
129
- { label: "pnpm", value: "pnpm" },
130
- { label: "npm", value: "npm" },
131
- { label: "yarn", value: "yarn" },
132
- { label: "bun", value: "bun" }
220
+ { value: "pnpm", label: "pnpm" },
221
+ { value: "npm", label: "npm" },
222
+ { value: "yarn", label: "yarn" },
223
+ { value: "bun", label: "bun" }
133
224
  ]
134
225
  });
135
226
  if (p.isCancel(packageManager)) {
@@ -143,98 +234,12 @@ async function main() {
143
234
  ${installCommand}`, "Next steps");
144
235
  p.outro(" Done! ");
145
236
  }
146
- function generateConfig(answers) {
147
- const lines = [
148
- "// eslint.config.ts",
149
- "import eslintConfig from '@eslint-sets/eslint-config'",
150
- "",
151
- "export default eslintConfig({",
152
- ` type: '${answers.type}',`
153
- ];
154
- if (answers.frameworks.length > 0) {
155
- for (const fw of answers.frameworks) {
156
- if (fw === "vue" || fw === "react") {
157
- lines.push(` ${fw}: {`);
158
- if (answers.a11y) {
159
- lines.push(" a11y: true,");
160
- }
161
- lines.push(" },");
162
- } else {
163
- lines.push(` ${fw}: true,`);
164
- }
165
- }
166
- }
167
- if (answers.formatter === "stylistic") {
168
- lines.push(" prettier: false,");
169
- lines.push(" stylistic: true,");
170
- }
171
- if (!answers.gitignore) {
172
- lines.push(" gitignore: false,");
173
- }
174
- if (!answers.sortPackageJson) {
175
- lines.push(" sortPackageJson: false,");
176
- }
177
- if (!answers.sortTsconfig) {
178
- lines.push(" sortTsconfig: false,");
179
- }
180
- lines.push("})");
181
- return lines.join("\n");
182
- }
183
- function getDependencies(answers) {
184
- const deps = ["@eslint-sets/eslint-config", "eslint"];
185
- if (answers.typescript) {
186
- deps.push("typescript");
187
- }
188
- if (answers.formatter === "prettier") {
189
- deps.push("prettier");
190
- }
191
- if (answers.frameworks.includes("react")) {
192
- deps.push("@eslint-react/eslint-plugin");
193
- deps.push("eslint-plugin-react-refresh");
194
- }
195
- if (answers.frameworks.includes("nextjs")) {
196
- deps.push("@next/eslint-plugin-next");
197
- deps.push("@eslint-react/eslint-plugin");
198
- deps.push("eslint-plugin-react-refresh");
199
- }
200
- if (answers.frameworks.includes("astro")) {
201
- deps.push("eslint-plugin-astro");
202
- deps.push("astro-eslint-parser");
203
- }
204
- if (answers.frameworks.includes("angular")) {
205
- deps.push("@angular-eslint/eslint-plugin");
206
- deps.push("@angular-eslint/eslint-plugin-template");
207
- deps.push("@angular-eslint/template-parser");
208
- }
209
- if (answers.frameworks.includes("unocss")) {
210
- deps.push("@unocss/eslint-plugin");
211
- }
212
- if (answers.a11y) {
213
- if (answers.frameworks.includes("react")) {
214
- deps.push("eslint-plugin-jsx-a11y");
215
- }
216
- if (answers.frameworks.includes("vue")) {
217
- deps.push("eslint-plugin-vuejs-accessibility");
218
- }
219
- }
220
- return deps;
221
- }
222
- function getInstallCommand(packageManager, deps) {
223
- const depsStr = deps.join(" ");
224
- switch (packageManager) {
225
- case "pnpm":
226
- return `pnpm add -D ${depsStr}`;
227
- case "npm":
228
- return `npm install -D ${depsStr}`;
229
- case "yarn":
230
- return `yarn add -D ${depsStr}`;
231
- case "bun":
232
- return `bun add -D ${depsStr}`;
233
- default:
234
- return `pnpm add -D ${depsStr}`;
235
- }
236
- }
237
237
  main().catch((error) => {
238
238
  console.error(error);
239
239
  process.exit(1);
240
240
  });
241
+ export {
242
+ generateConfig,
243
+ getDependencies,
244
+ getInstallCommand
245
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../src/configs/node.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAYpC;;GAEG;AACH,wBAAgB,IAAI,IAAI,MAAM,CAAC,MAAM,EAAE,CAoDtC"}
1
+ {"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../src/configs/node.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAYpC;;GAEG;AACH,wBAAgB,IAAI,IAAI,MAAM,CAAC,MAAM,EAAE,CAuDtC"}
@@ -1 +1 @@
1
- {"version":3,"file":"perfectionist.d.ts","sourceRoot":"","sources":["../../src/configs/perfectionist.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAIpC;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACpC;;;OAGG;IACH,KAAK,CAAC,EAAE,KAAK,GAAG,MAAM,CAAA;IAEtB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC,WAAW,CAAA;IAE9B;;;OAGG;IACH,IAAI,CAAC,EAAE,SAAS,GAAG,aAAa,GAAG,cAAc,CAAA;CACjD;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,OAAO,GAAE,oBAAyB,GAAG,MAAM,CAAC,MAAM,CA2D/E"}
1
+ {"version":3,"file":"perfectionist.d.ts","sourceRoot":"","sources":["../../src/configs/perfectionist.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAIpC;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACpC;;;OAGG;IACH,KAAK,CAAC,EAAE,KAAK,GAAG,MAAM,CAAA;IAEtB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC,WAAW,CAAA;IAE9B;;;OAGG;IACH,IAAI,CAAC,EAAE,SAAS,GAAG,aAAa,GAAG,cAAc,CAAA;CACjD;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,OAAO,GAAE,oBAAyB,GAAG,MAAM,CAAC,MAAM,CA2F/E"}
@@ -1 +1 @@
1
- {"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../../src/configs/react.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AACpC,OAAO,KAAK,EAAE,gBAAgB,EAAE,8BAA8B,EAAE,0BAA0B,EAAE,MAAM,UAAU,CAAA;AAI5G;;GAEG;AACH,MAAM,WAAW,YAAa,SAAQ,gBAAgB,EAAE,8BAA8B,EAAE,0BAA0B;IACjH;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,EAAE,CAAA;IAEhB;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAA;CACvB;AA4BD;;;GAGG;AACH,wBAAsB,KAAK,CAAC,OAAO,GAAE,YAAiB,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CAiKhF"}
1
+ {"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../../src/configs/react.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AACpC,OAAO,KAAK,EAAE,gBAAgB,EAAE,8BAA8B,EAAE,0BAA0B,EAAE,MAAM,UAAU,CAAA;AAI5G;;GAEG;AACH,MAAM,WAAW,YAAa,SAAQ,gBAAgB,EAAE,8BAA8B,EAAE,0BAA0B;IACjH;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,EAAE,CAAA;IAEhB;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAA;CACvB;AA4BD;;;GAGG;AACH,wBAAsB,KAAK,CAAC,OAAO,GAAE,YAAiB,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CA8JhF"}
@@ -1 +1 @@
1
- {"version":3,"file":"stylistic.d.ts","sourceRoot":"","sources":["../../src/configs/stylistic.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAIpC;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAChC;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,CAAA;IAEtB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,KAAK,CAAA;IAEvB;;;OAGG;IACH,GAAG,CAAC,EAAE,OAAO,CAAA;IAEb;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAA;IAEzB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC,WAAW,CAAA;IAE9B;;;OAGG;IACH,MAAM,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAA;IAE5B;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,CAAA;CACd;AAED;;GAEG;AACH,eAAO,MAAM,uBAAuB,EAAE,gBAOrC,CAAA;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,OAAO,GAAE,gBAAqB,GAAG,MAAM,CAAC,MAAM,EAAE,CAwDzE"}
1
+ {"version":3,"file":"stylistic.d.ts","sourceRoot":"","sources":["../../src/configs/stylistic.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAIpC;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAChC;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,CAAA;IAEtB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,KAAK,CAAA;IAEvB;;;OAGG;IACH,GAAG,CAAC,EAAE,OAAO,CAAA;IAEb;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAA;IAEzB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC,WAAW,CAAA;IAE9B;;;OAGG;IACH,MAAM,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAA;IAE5B;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,CAAA;CACd;AAED;;GAEG;AACH,eAAO,MAAM,uBAAuB,EAAE,gBAOrC,CAAA;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,OAAO,GAAE,gBAAqB,GAAG,MAAM,CAAC,MAAM,EAAE,CA2DzE"}
package/dist/index.js CHANGED
@@ -328,13 +328,13 @@ async function angular(options = {}) {
328
328
  {
329
329
  name: "eslint-sets/angular/setup",
330
330
  plugins: {
331
- "angular": angularPlugin,
331
+ angular: angularPlugin,
332
332
  "angular-template": angularTemplatePlugin
333
333
  }
334
334
  },
335
335
  {
336
- files: [GLOB_TS],
337
336
  name: "eslint-sets/angular/rules/ts",
337
+ files: [GLOB_TS],
338
338
  processor: angularTemplatePlugin.processors?.["extract-inline-html"],
339
339
  rules: {
340
340
  // Core Angular rules
@@ -355,11 +355,11 @@ async function angular(options = {}) {
355
355
  }
356
356
  },
357
357
  {
358
+ name: "eslint-sets/angular/rules/template",
358
359
  files: templateFiles,
359
360
  languageOptions: {
360
361
  parser: templateParser
361
362
  },
362
- name: "eslint-sets/angular/rules/template",
363
363
  rules: {
364
364
  // Core template rules
365
365
  "angular-template/banana-in-box": "error",
@@ -385,6 +385,7 @@ async function astro(options = {}) {
385
385
  }
386
386
  return [
387
387
  {
388
+ name: "eslint-sets/astro",
388
389
  files: [GLOB_ASTRO],
389
390
  languageOptions: {
390
391
  parser: astroParser,
@@ -393,7 +394,6 @@ async function astro(options = {}) {
393
394
  sourceType: "module"
394
395
  }
395
396
  },
396
- name: "eslint-sets/astro",
397
397
  plugins: {
398
398
  astro: astroPlugin
399
399
  },
@@ -433,8 +433,8 @@ function comments(options = {}) {
433
433
  const { overrides = {} } = options;
434
434
  return [
435
435
  {
436
- files: [GLOB_SRC],
437
436
  name: "eslint-sets/comments",
437
+ files: [GLOB_SRC],
438
438
  plugins: {
439
439
  "eslint-comments": eslintCommentsPlugin
440
440
  },
@@ -455,28 +455,28 @@ function comments(options = {}) {
455
455
  function disables() {
456
456
  return [
457
457
  {
458
- files: [`**/scripts/${GLOB_SRC}`],
459
458
  name: "eslint-sets/disables/scripts",
459
+ files: [`**/scripts/${GLOB_SRC}`],
460
460
  rules: {
461
461
  "no-console": "off",
462
462
  "ts/explicit-function-return-type": "off"
463
463
  }
464
464
  },
465
465
  {
466
- files: [`**/cli/${GLOB_SRC}`, `**/cli.${GLOB_SRC_EXT}`],
467
466
  name: "eslint-sets/disables/cli",
467
+ files: [`**/cli/${GLOB_SRC}`, `**/cli.${GLOB_SRC_EXT}`],
468
468
  rules: {
469
469
  "no-console": "off"
470
470
  }
471
471
  },
472
472
  {
473
- files: ["**/bin/**/*", `**/bin.${GLOB_SRC_EXT}`],
474
473
  name: "eslint-sets/disables/bin",
474
+ files: ["**/bin/**/*", `**/bin.${GLOB_SRC_EXT}`],
475
475
  rules: {}
476
476
  },
477
477
  {
478
- files: ["**/*.d.?([cm])ts"],
479
478
  name: "eslint-sets/disables/dts",
479
+ files: ["**/*.d.?([cm])ts"],
480
480
  rules: {
481
481
  "eslint-comments/no-unlimited-disable": "off",
482
482
  "no-restricted-syntax": "off",
@@ -484,15 +484,15 @@ function disables() {
484
484
  }
485
485
  },
486
486
  {
487
- files: ["**/*.js", "**/*.cjs"],
488
487
  name: "eslint-sets/disables/cjs",
488
+ files: ["**/*.js", "**/*.cjs"],
489
489
  rules: {
490
490
  "ts/no-require-imports": "off"
491
491
  }
492
492
  },
493
493
  {
494
- files: [`**/*.config.${GLOB_SRC_EXT}`, `**/*.config.*.${GLOB_SRC_EXT}`],
495
494
  name: "eslint-sets/disables/config-files",
495
+ files: [`**/*.config.${GLOB_SRC_EXT}`, `**/*.config.*.${GLOB_SRC_EXT}`],
496
496
  rules: {
497
497
  "no-console": "off",
498
498
  "ts/explicit-function-return-type": "off"
@@ -553,7 +553,7 @@ async function formatters(options = {}, stylistic2 = {}) {
553
553
  const { indent = 2, quotes = "single" } = stylistic2;
554
554
  const prettierOptions = {
555
555
  endOfLine: "auto",
556
- printWidth: 120,
556
+ printWidth: 100,
557
557
  semi: false,
558
558
  singleQuote: quotes === "single",
559
559
  tabWidth: typeof indent === "number" ? indent : 2,
@@ -584,12 +584,12 @@ async function formatters(options = {}, stylistic2 = {}) {
584
584
  if (cssOption) {
585
585
  configs.push(
586
586
  {
587
+ name: "eslint-sets/formatters/css",
587
588
  files: ["**/*.css", "**/*.postcss"],
588
589
  languageOptions: {
589
590
  parser: null
590
591
  // plain parser
591
592
  },
592
- name: "eslint-sets/formatters/css",
593
593
  rules: {
594
594
  "format/prettier": [
595
595
  "error",
@@ -598,11 +598,11 @@ async function formatters(options = {}, stylistic2 = {}) {
598
598
  }
599
599
  },
600
600
  {
601
+ name: "eslint-sets/formatters/scss",
601
602
  files: ["**/*.scss"],
602
603
  languageOptions: {
603
604
  parser: null
604
605
  },
605
- name: "eslint-sets/formatters/scss",
606
606
  rules: {
607
607
  "format/prettier": [
608
608
  "error",
@@ -611,11 +611,11 @@ async function formatters(options = {}, stylistic2 = {}) {
611
611
  }
612
612
  },
613
613
  {
614
+ name: "eslint-sets/formatters/less",
614
615
  files: ["**/*.less"],
615
616
  languageOptions: {
616
617
  parser: null
617
618
  },
618
- name: "eslint-sets/formatters/less",
619
619
  rules: {
620
620
  "format/prettier": [
621
621
  "error",
@@ -627,11 +627,11 @@ async function formatters(options = {}, stylistic2 = {}) {
627
627
  }
628
628
  if (htmlOption) {
629
629
  configs.push({
630
+ name: "eslint-sets/formatters/html",
630
631
  files: [GLOB_HTML],
631
632
  languageOptions: {
632
633
  parser: null
633
634
  },
634
- name: "eslint-sets/formatters/html",
635
635
  rules: {
636
636
  "format/prettier": [
637
637
  "error",
@@ -642,11 +642,11 @@ async function formatters(options = {}, stylistic2 = {}) {
642
642
  }
643
643
  if (xmlOption) {
644
644
  configs.push({
645
+ name: "eslint-sets/formatters/xml",
645
646
  files: ["**/*.xml"],
646
647
  languageOptions: {
647
648
  parser: null
648
649
  },
649
- name: "eslint-sets/formatters/xml",
650
650
  rules: {
651
651
  "format/prettier": [
652
652
  "error",
@@ -660,11 +660,11 @@ async function formatters(options = {}, stylistic2 = {}) {
660
660
  }
661
661
  if (svgOption) {
662
662
  configs.push({
663
+ name: "eslint-sets/formatters/svg",
663
664
  files: ["**/*.svg"],
664
665
  languageOptions: {
665
666
  parser: null
666
667
  },
667
- name: "eslint-sets/formatters/svg",
668
668
  rules: {
669
669
  "format/prettier": [
670
670
  "error",
@@ -680,12 +680,12 @@ async function formatters(options = {}, stylistic2 = {}) {
680
680
  const formatter = markdownOption === true ? "prettier" : markdownOption;
681
681
  const slidevFiles = !slidevOption ? [] : slidevOption === true ? ["**/slides.md"] : slidevOption.files || [];
682
682
  configs.push({
683
+ name: "eslint-sets/formatters/markdown",
683
684
  files: [GLOB_MD],
684
685
  ignores: slidevFiles,
685
686
  languageOptions: {
686
687
  parser: null
687
688
  },
688
- name: "eslint-sets/formatters/markdown",
689
689
  rules: {
690
690
  [`format/${formatter}`]: [
691
691
  "error",
@@ -701,11 +701,11 @@ async function formatters(options = {}, stylistic2 = {}) {
701
701
  });
702
702
  if (slidevOption) {
703
703
  configs.push({
704
+ name: "eslint-sets/formatters/slidev",
704
705
  files: slidevFiles.length > 0 ? slidevFiles : ["**/slides.md"],
705
706
  languageOptions: {
706
707
  parser: null
707
708
  },
708
- name: "eslint-sets/formatters/slidev",
709
709
  rules: {
710
710
  "format/prettier": [
711
711
  "error",
@@ -721,11 +721,11 @@ async function formatters(options = {}, stylistic2 = {}) {
721
721
  }
722
722
  if (astroOption) {
723
723
  configs.push({
724
+ name: "eslint-sets/formatters/astro",
724
725
  files: [GLOB_ASTRO],
725
726
  languageOptions: {
726
727
  parser: null
727
728
  },
728
- name: "eslint-sets/formatters/astro",
729
729
  rules: {
730
730
  "format/prettier": [
731
731
  "error",
@@ -737,8 +737,8 @@ async function formatters(options = {}, stylistic2 = {}) {
737
737
  }
738
738
  });
739
739
  configs.push({
740
- files: [GLOB_ASTRO, GLOB_ASTRO_TS],
741
740
  name: "eslint-sets/formatters/astro/disables",
741
+ files: [GLOB_ASTRO, GLOB_ASTRO_TS],
742
742
  rules: {
743
743
  "style/arrow-parens": "off",
744
744
  "style/block-spacing": "off",
@@ -752,11 +752,11 @@ async function formatters(options = {}, stylistic2 = {}) {
752
752
  }
753
753
  if (graphqlOption) {
754
754
  configs.push({
755
+ name: "eslint-sets/formatters/graphql",
755
756
  files: ["**/*.graphql", "**/*.gql"],
756
757
  languageOptions: {
757
758
  parser: null
758
759
  },
759
- name: "eslint-sets/formatters/graphql",
760
760
  rules: {
761
761
  "format/prettier": [
762
762
  "error",
@@ -771,8 +771,8 @@ async function formatters(options = {}, stylistic2 = {}) {
771
771
  // src/configs/ignores.ts
772
772
  function ignores(userIgnores = []) {
773
773
  return {
774
- ignores: userIgnores,
775
- name: "eslint-sets/ignores"
774
+ name: "eslint-sets/ignores",
775
+ ignores: userIgnores
776
776
  };
777
777
  }
778
778
 
@@ -781,8 +781,8 @@ import importPlugin from "eslint-plugin-import-lite";
781
781
  function imports(options = {}) {
782
782
  const { overrides = {}, stylistic: stylistic2 = true } = options;
783
783
  return {
784
- files: [GLOB_SRC],
785
784
  name: "eslint-sets/imports",
785
+ files: [GLOB_SRC],
786
786
  plugins: {
787
787
  import: importPlugin
788
788
  },
@@ -810,6 +810,7 @@ import globals from "globals";
810
810
  function javascript(options = {}) {
811
811
  const { isInEditor = false, overrides = {} } = options;
812
812
  return {
813
+ name: "eslint-sets/javascript",
813
814
  files: [GLOB_SRC],
814
815
  languageOptions: {
815
816
  ecmaVersion: 2022,
@@ -831,7 +832,6 @@ function javascript(options = {}) {
831
832
  linterOptions: {
832
833
  reportUnusedDisableDirectives: true
833
834
  },
834
- name: "eslint-sets/javascript",
835
835
  plugins: {
836
836
  "unused-imports": unusedImports
837
837
  },
@@ -844,8 +844,8 @@ function javascript(options = {}) {
844
844
  "constructor-super": "error",
845
845
  "default-case-last": "error",
846
846
  "dot-notation": ["error", { allowKeywords: true }],
847
- "eqeqeq": ["error", "smart"],
848
- "indent": "off",
847
+ eqeqeq: ["error", "smart"],
848
+ indent: "off",
849
849
  // Let Prettier handle
850
850
  "new-cap": ["error", { capIsNew: false, newIsCap: true, properties: true }],
851
851
  "no-alert": "error",
@@ -902,8 +902,8 @@ function javascript(options = {}) {
902
902
  "no-regex-spaces": "error",
903
903
  "no-restricted-globals": [
904
904
  "error",
905
- { message: "Use `globalThis` instead.", name: "global" },
906
- { message: "Use `globalThis` instead.", name: "self" }
905
+ { name: "global", message: "Use `globalThis` instead." },
906
+ { name: "self", message: "Use `globalThis` instead." }
907
907
  ],
908
908
  "no-restricted-properties": [
909
909
  "error",
@@ -922,7 +922,7 @@ function javascript(options = {}) {
922
922
  "TSExportAssignment"
923
923
  ],
924
924
  "no-self-assign": ["error", { props: true }],
925
- "no-self-compare": "error",
925
+ "no-self-compare": "off",
926
926
  "no-sequences": "error",
927
927
  "no-shadow": "off",
928
928
  "no-shadow-restricted-names": "error",
@@ -968,7 +968,7 @@ function javascript(options = {}) {
968
968
  "no-var": "error",
969
969
  "no-with": "error",
970
970
  "object-shorthand": ["error", "always", { avoidQuotes: true, ignoreConstructors: false }],
971
- "one-var": ["error", { initialized: "never" }],
971
+ "one-var": ["error", { const: "never", let: "always" }],
972
972
  "operator-linebreak": "off",
973
973
  "prefer-arrow-callback": [
974
974
  "error",
@@ -1006,7 +1006,7 @@ function javascript(options = {}) {
1006
1006
  "use-isnan": ["error", { enforceForIndexOf: true, enforceForSwitchCase: true }],
1007
1007
  "valid-typeof": ["error", { requireStringLiterals: true }],
1008
1008
  "vars-on-top": "error",
1009
- "yoda": ["error", "never"],
1009
+ yoda: ["error", "never"],
1010
1010
  // User overrides
1011
1011
  ...overrides
1012
1012
  }
@@ -1022,8 +1022,8 @@ async function jsdoc(options = {}) {
1022
1022
  }
1023
1023
  return [
1024
1024
  {
1025
- files: [GLOB_SRC],
1026
1025
  name: "eslint-sets/jsdoc",
1026
+ files: [GLOB_SRC],
1027
1027
  plugins: {
1028
1028
  jsdoc: jsdocPlugin
1029
1029
  },
@@ -1065,11 +1065,11 @@ function jsonc(options = {}) {
1065
1065
  } = typeof stylistic2 === "boolean" ? {} : stylistic2;
1066
1066
  return [
1067
1067
  {
1068
+ name: "eslint-sets/jsonc",
1068
1069
  files: [GLOB_JSON, GLOB_JSON5, GLOB_JSONC],
1069
1070
  languageOptions: {
1070
1071
  parser: jsoncParser
1071
1072
  },
1072
- name: "eslint-sets/jsonc",
1073
1073
  plugins: {
1074
1074
  jsonc: jsoncPlugin
1075
1075
  },
@@ -1126,6 +1126,7 @@ function jsonc(options = {}) {
1126
1126
  async function jsx(options = {}) {
1127
1127
  const { a11y = false, overrides = {} } = options;
1128
1128
  const baseConfig = {
1129
+ name: "eslint-sets/jsx",
1129
1130
  files: [GLOB_JSX, GLOB_TSX],
1130
1131
  languageOptions: {
1131
1132
  parserOptions: {
@@ -1134,7 +1135,6 @@ async function jsx(options = {}) {
1134
1135
  }
1135
1136
  }
1136
1137
  },
1137
- name: "eslint-sets/jsx",
1138
1138
  plugins: {},
1139
1139
  rules: {
1140
1140
  ...overrides
@@ -1156,12 +1156,12 @@ async function jsx(options = {}) {
1156
1156
  {
1157
1157
  ...baseConfig,
1158
1158
  ...a11yConfig,
1159
+ name: baseConfig.name,
1159
1160
  files: baseConfig.files,
1160
1161
  languageOptions: {
1161
1162
  ...baseConfig.languageOptions,
1162
1163
  ...a11yConfig.languageOptions || {}
1163
1164
  },
1164
- name: baseConfig.name,
1165
1165
  plugins: {
1166
1166
  ...baseConfig.plugins,
1167
1167
  "jsx-a11y": jsxA11yPlugin
@@ -1192,9 +1192,9 @@ async function markdown(options = {}) {
1192
1192
  }
1193
1193
  },
1194
1194
  {
1195
+ name: "eslint-sets/markdown/processor",
1195
1196
  files: [GLOB_MD],
1196
1197
  ignores: [GLOB_MD_IN_MD],
1197
- name: "eslint-sets/markdown/processor",
1198
1198
  // `eslint-plugin-markdown` only creates virtual files for code blocks,
1199
1199
  // but not the markdown file itself. We use `eslint-merge-processors` to
1200
1200
  // add a pass-through processor for the markdown file itself.
@@ -1204,13 +1204,13 @@ async function markdown(options = {}) {
1204
1204
  ])
1205
1205
  },
1206
1206
  {
1207
+ name: "eslint-sets/markdown/parser",
1207
1208
  files: [GLOB_MD],
1208
- language: gfm ? "markdown/gfm" : "markdown/commonmark",
1209
- name: "eslint-sets/markdown/parser"
1209
+ language: gfm ? "markdown/gfm" : "markdown/commonmark"
1210
1210
  },
1211
1211
  {
1212
- files: [GLOB_MD],
1213
1212
  name: "eslint-sets/markdown/rules",
1213
+ files: [GLOB_MD],
1214
1214
  rules: {
1215
1215
  ...plugin.configs?.recommended?.at?.(0)?.rules || {},
1216
1216
  "markdown/fenced-code-language": "off",
@@ -1220,8 +1220,8 @@ async function markdown(options = {}) {
1220
1220
  }
1221
1221
  },
1222
1222
  {
1223
- files: [GLOB_MD],
1224
1223
  name: "eslint-sets/markdown/disables/markdown",
1224
+ files: [GLOB_MD],
1225
1225
  rules: {
1226
1226
  // Disable rules that do not work with markdown sourcecode.
1227
1227
  "no-irregular-whitespace": "off",
@@ -1235,6 +1235,7 @@ async function markdown(options = {}) {
1235
1235
  }
1236
1236
  },
1237
1237
  {
1238
+ name: "eslint-sets/markdown/disables/code",
1238
1239
  files: [GLOB_MD_CODE],
1239
1240
  languageOptions: {
1240
1241
  parserOptions: {
@@ -1243,7 +1244,6 @@ async function markdown(options = {}) {
1243
1244
  }
1244
1245
  }
1245
1246
  },
1246
- name: "eslint-sets/markdown/disables/code",
1247
1247
  rules: {
1248
1248
  "no-alert": "off",
1249
1249
  "no-console": "off",
@@ -1276,8 +1276,8 @@ async function markdown(options = {}) {
1276
1276
  }
1277
1277
  return [
1278
1278
  {
1279
- files: [GLOB_MD],
1280
1279
  name: "eslint-sets/markdown/setup",
1280
+ files: [GLOB_MD],
1281
1281
  rules: {
1282
1282
  // No markdown-specific rules available
1283
1283
  ...overrides
@@ -1295,8 +1295,8 @@ async function nextjs(options = {}) {
1295
1295
  }
1296
1296
  return [
1297
1297
  {
1298
- files: [GLOB_SRC],
1299
1298
  name: "eslint-sets/nextjs",
1299
+ files: [GLOB_SRC],
1300
1300
  plugins: {
1301
1301
  "@next/next": nextPlugin
1302
1302
  },
@@ -1339,8 +1339,8 @@ var nodeRecommendedRules = renameRules(
1339
1339
  function node() {
1340
1340
  return [
1341
1341
  {
1342
- files: [GLOB_SRC],
1343
1342
  name: "eslint-sets/node",
1343
+ files: [GLOB_SRC],
1344
1344
  plugins: {
1345
1345
  node: nodePlugin
1346
1346
  },
@@ -1352,7 +1352,7 @@ function node() {
1352
1352
  "node/file-extension-in-import": "off",
1353
1353
  "node/global-require": "off",
1354
1354
  "node/handle-callback-err": "error",
1355
- "node/hashbang": "error",
1355
+ "node/hashbang": "off",
1356
1356
  "node/no-callback-literal": "off",
1357
1357
  "node/no-deprecated-api": "error",
1358
1358
  "node/no-exports-assign": "error",
@@ -1371,6 +1371,9 @@ function node() {
1371
1371
  "node/no-sync": "off",
1372
1372
  "node/no-unpublished-import": "off",
1373
1373
  "node/no-unpublished-require": "off",
1374
+ "node/no-unsupported-features/es-syntax": "off",
1375
+ "node/no-unsupported-features/node-builtins": "off",
1376
+ "node/no-unsupported-features/es-builtins": "off",
1374
1377
  "node/prefer-global/buffer": ["error", "always"],
1375
1378
  "node/prefer-global/console": ["error", "always"],
1376
1379
  "node/prefer-global/process": ["error", "always"],
@@ -1393,8 +1396,8 @@ function nuxt(options = {}) {
1393
1396
  const { overrides = {} } = options;
1394
1397
  return [
1395
1398
  {
1396
- files: [GLOB_VUE, GLOB_TS],
1397
1399
  name: "eslint-sets/nuxt",
1400
+ files: [GLOB_VUE, GLOB_TS],
1398
1401
  rules: {
1399
1402
  // Nuxt-specific rules
1400
1403
  // Note: Most Nuxt-specific linting is handled by @nuxt/eslint
@@ -1412,13 +1415,13 @@ function nuxt(options = {}) {
1412
1415
  import perfectionistPlugin from "eslint-plugin-perfectionist";
1413
1416
  function perfectionist(options = {}) {
1414
1417
  const {
1418
+ type = "natural",
1415
1419
  order = "asc",
1416
- overrides = {},
1417
- type = "natural"
1420
+ overrides = {}
1418
1421
  } = options;
1419
1422
  return {
1420
- files: [GLOB_SRC],
1421
1423
  name: "eslint-sets/perfectionist",
1424
+ files: [GLOB_SRC],
1422
1425
  plugins: {
1423
1426
  perfectionist: perfectionistPlugin
1424
1427
  },
@@ -1426,13 +1429,14 @@ function perfectionist(options = {}) {
1426
1429
  "perfectionist/sort-exports": [
1427
1430
  "error",
1428
1431
  {
1429
- order,
1430
- type
1432
+ type,
1433
+ order
1431
1434
  }
1432
1435
  ],
1433
1436
  "perfectionist/sort-imports": [
1434
1437
  "error",
1435
1438
  {
1439
+ type,
1436
1440
  groups: [
1437
1441
  "type-import",
1438
1442
  ["type-parent", "type-sibling", "type-index", "type-internal"],
@@ -1445,22 +1449,53 @@ function perfectionist(options = {}) {
1445
1449
  "unknown"
1446
1450
  ],
1447
1451
  newlinesBetween: "ignore",
1448
- order,
1449
- type
1452
+ order
1450
1453
  }
1451
1454
  ],
1452
1455
  "perfectionist/sort-named-exports": [
1453
1456
  "error",
1454
1457
  {
1455
- order,
1456
- type
1458
+ type,
1459
+ customGroups: [
1460
+ {
1461
+ groupName: "default",
1462
+ elementNamePattern: "default"
1463
+ },
1464
+ {
1465
+ groupName: "values",
1466
+ modifiers: ["value"]
1467
+ },
1468
+ {
1469
+ groupName: "types",
1470
+ modifiers: ["type"]
1471
+ }
1472
+ ],
1473
+ groups: ["default", "values", "types"],
1474
+ order
1457
1475
  }
1458
1476
  ],
1459
1477
  "perfectionist/sort-named-imports": [
1460
1478
  "error",
1461
1479
  {
1462
- order,
1463
- type
1480
+ type,
1481
+ order
1482
+ }
1483
+ ],
1484
+ "perfectionist/sort-objects": [
1485
+ "error",
1486
+ {
1487
+ type: "unsorted",
1488
+ customGroups: [
1489
+ {
1490
+ groupName: "id",
1491
+ elementNamePattern: "^(id|key|name)$"
1492
+ },
1493
+ {
1494
+ groupName: "required",
1495
+ elementNamePattern: "^(type|value)$"
1496
+ }
1497
+ ],
1498
+ groups: ["id", "required", "unknown"]
1464
1499
  }
1465
1500
  ],
1466
1501
  // User overrides
@@ -1478,8 +1513,8 @@ async function pnpm(options = {}) {
1478
1513
  }
1479
1514
  return [
1480
1515
  {
1481
- files: ["**/package.json"],
1482
1516
  name: "eslint-sets/pnpm",
1517
+ files: ["**/package.json"],
1483
1518
  plugins: {
1484
1519
  pnpm: plugin
1485
1520
  },
@@ -1514,8 +1549,8 @@ function prettier(options = {}) {
1514
1549
  } = options;
1515
1550
  return [
1516
1551
  {
1517
- files: [GLOB_SRC],
1518
1552
  name: "eslint-sets/prettier",
1553
+ files: [GLOB_SRC],
1519
1554
  plugins: {
1520
1555
  prettier: eslintPluginPrettier
1521
1556
  },
@@ -1550,7 +1585,7 @@ function prettier(options = {}) {
1550
1585
  function renameRules2(rules) {
1551
1586
  const result = {};
1552
1587
  for (const [key, value] of Object.entries(rules)) {
1553
- const newKey = key.replace("@eslint-react/rsc/", "react-rsc/").replace("@eslint-react/dom/", "react-dom/").replace("@eslint-react/web-api/", "react-web-api/").replace("@eslint-react/naming-convention/", "react-naming-convention/").replace("@eslint-react/", "react/");
1588
+ const newKey = key.replace("@eslint-react/dom/", "react-dom/").replace("@eslint-react/web-api/", "react-web-api/").replace("@eslint-react/naming-convention/", "react-naming-convention/").replace("@eslint-react/hooks-extra/", "react-hooks-extra/").replace("@eslint-react/", "react/");
1554
1589
  if (value !== void 0) {
1555
1590
  result[newKey] = value;
1556
1591
  }
@@ -1569,12 +1604,10 @@ async function react(options = {}) {
1569
1604
  const [
1570
1605
  pluginReact,
1571
1606
  pluginReactHooks,
1572
- pluginReactHooksExtra,
1573
1607
  pluginReactRefresh
1574
1608
  ] = await Promise.all([
1575
1609
  loadPlugin("@eslint-react/eslint-plugin"),
1576
1610
  loadPlugin("eslint-plugin-react-hooks"),
1577
- loadPlugin("eslint-plugin-react-hooks-extra"),
1578
1611
  loadPlugin("eslint-plugin-react-refresh")
1579
1612
  ]);
1580
1613
  if (!pluginReact) {
@@ -1595,17 +1628,17 @@ async function react(options = {}) {
1595
1628
  {
1596
1629
  name: "eslint-sets/react/setup",
1597
1630
  plugins: {
1598
- "react": allPlugins["@eslint-react"],
1631
+ react: allPlugins["@eslint-react"],
1599
1632
  "react-dom": allPlugins["@eslint-react/dom"],
1600
1633
  "react-hooks": pluginReactHooks,
1601
- "react-hooks-extra": pluginReactHooksExtra,
1634
+ "react-hooks-extra": allPlugins["@eslint-react/hooks-extra"],
1602
1635
  "react-naming-convention": allPlugins["@eslint-react/naming-convention"],
1603
1636
  "react-refresh": pluginReactRefresh,
1604
- "react-rsc": allPlugins["@eslint-react/rsc"],
1605
1637
  "react-web-api": allPlugins["@eslint-react/web-api"]
1606
1638
  }
1607
1639
  },
1608
1640
  {
1641
+ name: "eslint-sets/react/rules",
1609
1642
  files,
1610
1643
  languageOptions: {
1611
1644
  parserOptions: {
@@ -1615,12 +1648,11 @@ async function react(options = {}) {
1615
1648
  },
1616
1649
  sourceType: "module"
1617
1650
  },
1618
- name: "eslint-sets/react/rules",
1619
1651
  rules: {
1620
1652
  // Use recommended rules from @eslint-react/eslint-plugin (renamed)
1621
1653
  ...recommendedRules,
1622
1654
  // Additional rules
1623
- "react/prefer-namespace-import": "error",
1655
+ "react/prefer-react-namespace-import": "error",
1624
1656
  // React hooks rules
1625
1657
  "react-hooks/rules-of-hooks": "error",
1626
1658
  "react-hooks/exhaustive-deps": "warn",
@@ -1683,8 +1715,8 @@ async function react(options = {}) {
1683
1715
  }
1684
1716
  },
1685
1717
  {
1686
- files: filesTypeAware,
1687
1718
  name: "eslint-sets/react/typescript",
1719
+ files: filesTypeAware,
1688
1720
  rules: {
1689
1721
  // Disables rules that are already handled by TypeScript
1690
1722
  "react-dom/no-string-style-prop": "off",
@@ -1694,9 +1726,9 @@ async function react(options = {}) {
1694
1726
  ];
1695
1727
  if (isTypeAware) {
1696
1728
  configs.push({
1729
+ name: "eslint-sets/react/type-aware",
1697
1730
  files: filesTypeAware,
1698
1731
  ignores: ignoresTypeAware,
1699
- name: "eslint-sets/react/type-aware",
1700
1732
  rules: typeAwareRules
1701
1733
  });
1702
1734
  }
@@ -1707,8 +1739,8 @@ async function react(options = {}) {
1707
1739
  import regexpPlugin from "eslint-plugin-regexp";
1708
1740
  function regexp() {
1709
1741
  return {
1710
- files: [GLOB_SRC],
1711
1742
  name: "eslint-sets/regexp",
1743
+ files: [GLOB_SRC],
1712
1744
  plugins: {
1713
1745
  regexp: regexpPlugin
1714
1746
  },
@@ -1756,9 +1788,9 @@ async function solid() {
1756
1788
  const flatRecommended = solidPlugin.configs?.["flat/recommended"];
1757
1789
  return [
1758
1790
  {
1791
+ name: "eslint-sets/solid",
1759
1792
  files: [GLOB_SOLID],
1760
1793
  languageOptions: flatRecommended?.languageOptions,
1761
- name: "eslint-sets/solid",
1762
1794
  plugins: {
1763
1795
  solid: flatRecommended?.plugins?.solid ?? solidPlugin
1764
1796
  },
@@ -1783,8 +1815,8 @@ async function sortPackageJson(options = {}) {
1783
1815
  const { files = ["**/package.json"], overrides = {} } = options;
1784
1816
  return [
1785
1817
  {
1786
- files,
1787
1818
  name: "eslint-sets/sort-package-json",
1819
+ files,
1788
1820
  rules: {
1789
1821
  "jsonc/sort-keys": [
1790
1822
  "error",
@@ -1859,8 +1891,8 @@ async function sortTsconfig(options = {}) {
1859
1891
  const { files = ["**/[jt]sconfig.json", "**/[jt]sconfig.*.json"], overrides = {} } = options;
1860
1892
  return [
1861
1893
  {
1862
- files,
1863
1894
  name: "eslint-sets/sort-tsconfig",
1895
+ files,
1864
1896
  rules: {
1865
1897
  "jsonc/sort-keys": [
1866
1898
  "error",
@@ -2015,8 +2047,8 @@ function stylistic(options = {}) {
2015
2047
  });
2016
2048
  return [
2017
2049
  {
2018
- files: [GLOB_SRC],
2019
2050
  name: "eslint-sets/stylistic",
2051
+ files: [GLOB_SRC],
2020
2052
  plugins: {
2021
2053
  style: stylisticPlugin
2022
2054
  },
@@ -2031,6 +2063,8 @@ function stylistic(options = {}) {
2031
2063
  "style/generator-star-spacing": ["error", { after: true, before: false }],
2032
2064
  "style/multiline-ternary": ["error", "never"],
2033
2065
  "style/yield-star-spacing": ["error", { after: true, before: false }],
2066
+ // quote-props: only quote when needed (not consistent-as-needed)
2067
+ "style/quote-props": ["error", "as-needed"],
2034
2068
  // Less opinionated mode uses basic curly rule
2035
2069
  ...lessOpinionated ? {
2036
2070
  curly: ["error", "all"]
@@ -2054,6 +2088,7 @@ async function svelte(options = {}) {
2054
2088
  }
2055
2089
  return [
2056
2090
  {
2091
+ name: "eslint-sets/svelte",
2057
2092
  files: [GLOB_SVELTE],
2058
2093
  languageOptions: {
2059
2094
  parser: svelteParser,
@@ -2064,7 +2099,6 @@ async function svelte(options = {}) {
2064
2099
  sourceType: "module"
2065
2100
  }
2066
2101
  },
2067
- name: "eslint-sets/svelte",
2068
2102
  plugins: {
2069
2103
  svelte: sveltePlugin
2070
2104
  },
@@ -2128,8 +2162,8 @@ async function test(options = {}) {
2128
2162
  const recommendedRules = renameVitestRules(vitest.configs.recommended.rules);
2129
2163
  return [
2130
2164
  {
2131
- files: [GLOB_TESTS],
2132
2165
  name: "eslint-sets/test",
2166
+ files: [GLOB_TESTS],
2133
2167
  plugins: {
2134
2168
  test: testPlugin
2135
2169
  },
@@ -2141,7 +2175,7 @@ async function test(options = {}) {
2141
2175
  "test/no-identical-title": "error",
2142
2176
  "test/no-import-node-test": "error",
2143
2177
  "test/prefer-hooks-in-order": "error",
2144
- "test/prefer-lowercase-title": "error",
2178
+ "test/prefer-lowercase-title": "off",
2145
2179
  // no-only-tests rule (renamed)
2146
2180
  "test/no-only-tests": isInEditor ? "warn" : "error",
2147
2181
  // Disables for test files
@@ -2169,11 +2203,11 @@ function toml(options = {}) {
2169
2203
  } = typeof stylistic2 === "boolean" ? {} : stylistic2;
2170
2204
  return [
2171
2205
  {
2206
+ name: "eslint-sets/toml",
2172
2207
  files: [GLOB_TOML],
2173
2208
  languageOptions: {
2174
2209
  parser: tomlParser
2175
2210
  },
2176
- name: "eslint-sets/toml",
2177
2211
  plugins: {
2178
2212
  toml: tomlPlugin
2179
2213
  },
@@ -2215,6 +2249,7 @@ function toml(options = {}) {
2215
2249
  import tsParser from "@typescript-eslint/parser";
2216
2250
  async function typescript(options = {}) {
2217
2251
  const {
2252
+ type = "app",
2218
2253
  erasableOnly = false,
2219
2254
  filesTypeAware = [GLOB_TS],
2220
2255
  ignoresTypeAware = ["**/*.md/**", "**/*.astro/*.ts"],
@@ -2222,7 +2257,6 @@ async function typescript(options = {}) {
2222
2257
  overridesTypeAware = {},
2223
2258
  parserOptions = {},
2224
2259
  tsconfigPath,
2225
- type = "app",
2226
2260
  typeAware = false
2227
2261
  } = options;
2228
2262
  const tseslint = await loadPlugin("@typescript-eslint/eslint-plugin");
@@ -2260,6 +2294,7 @@ async function typescript(options = {}) {
2260
2294
  };
2261
2295
  const configs = [
2262
2296
  {
2297
+ name: "eslint-sets/typescript",
2263
2298
  files: [GLOB_TS, GLOB_SRC],
2264
2299
  languageOptions: {
2265
2300
  parser: tsParser,
@@ -2276,7 +2311,6 @@ async function typescript(options = {}) {
2276
2311
  ...parserOptions
2277
2312
  }
2278
2313
  },
2279
- name: "eslint-sets/typescript",
2280
2314
  plugins: {
2281
2315
  ts: tseslint
2282
2316
  },
@@ -2334,9 +2368,9 @@ async function typescript(options = {}) {
2334
2368
  ];
2335
2369
  if (isTypeAware) {
2336
2370
  configs.push({
2371
+ name: "eslint-sets/typescript/type-aware",
2337
2372
  files: filesTypeAware,
2338
2373
  ignores: ignoresTypeAware,
2339
- name: "eslint-sets/typescript/type-aware",
2340
2374
  rules: {
2341
2375
  ...typeAwareRules,
2342
2376
  ...overridesTypeAware
@@ -2361,8 +2395,8 @@ async function typescript(options = {}) {
2361
2395
  }
2362
2396
  }
2363
2397
  configs.push({
2364
- files: ["**/*.d.ts"],
2365
2398
  name: "eslint-sets/typescript/disables/dts",
2399
+ files: ["**/*.d.ts"],
2366
2400
  rules: {
2367
2401
  "eslint-comments/no-unlimited-disable": "off",
2368
2402
  "import/no-duplicates": "off",
@@ -2371,15 +2405,15 @@ async function typescript(options = {}) {
2371
2405
  }
2372
2406
  });
2373
2407
  configs.push({
2374
- files: ["**/*.{test,spec}.ts?(x)"],
2375
2408
  name: "eslint-sets/typescript/disables/test",
2409
+ files: ["**/*.{test,spec}.ts?(x)"],
2376
2410
  rules: {
2377
2411
  "no-unused-expressions": "off"
2378
2412
  }
2379
2413
  });
2380
2414
  configs.push({
2381
- files: ["**/*.js", "**/*.cjs"],
2382
2415
  name: "eslint-sets/typescript/disables/cjs",
2416
+ files: ["**/*.js", "**/*.cjs"],
2383
2417
  rules: {
2384
2418
  "ts/no-require-imports": "off",
2385
2419
  "ts/no-var-requires": "off"
@@ -2393,8 +2427,8 @@ import unicornPlugin from "eslint-plugin-unicorn";
2393
2427
  function unicorn(options = {}) {
2394
2428
  const { allRecommended = false, overrides = {} } = options;
2395
2429
  return {
2396
- files: [GLOB_SRC],
2397
2430
  name: "eslint-sets/unicorn",
2431
+ files: [GLOB_SRC],
2398
2432
  plugins: {
2399
2433
  unicorn: unicornPlugin
2400
2434
  },
@@ -2412,7 +2446,7 @@ function unicorn(options = {}) {
2412
2446
  "unicorn/prefer-dom-node-text-content": "error",
2413
2447
  "unicorn/prefer-includes": "error",
2414
2448
  "unicorn/prefer-node-protocol": "error",
2415
- "unicorn/prefer-number-properties": "error",
2449
+ "unicorn/prefer-number-properties": "off",
2416
2450
  "unicorn/prefer-string-starts-ends-with": "error",
2417
2451
  "unicorn/prefer-type-error": "error",
2418
2452
  "unicorn/throw-new-error": "error"
@@ -2448,8 +2482,8 @@ async function unocss(options = {}) {
2448
2482
  const pluginRules = flatConfig?.plugins?.unocss?.rules || {};
2449
2483
  return [
2450
2484
  {
2451
- files: [GLOB_SRC],
2452
2485
  name: "eslint-sets/unocss",
2486
+ files: [GLOB_SRC],
2453
2487
  plugins: {
2454
2488
  unocss: {
2455
2489
  rules: pluginRules
@@ -2497,9 +2531,9 @@ async function vue(options = {}) {
2497
2531
  if (vueBlocksProcessor && typeof sfcBlocks !== "boolean") {
2498
2532
  const processorOptions = typeof sfcBlocks === "object" ? sfcBlocks : {};
2499
2533
  configs.push({
2500
- files: [GLOB_VUE],
2501
2534
  name: "eslint-sets/vue/sfc-blocks",
2502
- processor: vueBlocksProcessor.default({
2535
+ files: [GLOB_VUE],
2536
+ processor: vueBlocksProcessor({
2503
2537
  blocks: {
2504
2538
  styles: processorOptions.styles ?? true,
2505
2539
  customBlocks: processorOptions.customBlocks ?? false
@@ -2508,9 +2542,9 @@ async function vue(options = {}) {
2508
2542
  });
2509
2543
  } else if (vueBlocksProcessor) {
2510
2544
  configs.push({
2511
- files: [GLOB_VUE],
2512
2545
  name: "eslint-sets/vue/sfc-blocks",
2513
- processor: vueBlocksProcessor.default({
2546
+ files: [GLOB_VUE],
2547
+ processor: vueBlocksProcessor({
2514
2548
  blocks: {
2515
2549
  styles: true,
2516
2550
  customBlocks: false
@@ -2520,6 +2554,7 @@ async function vue(options = {}) {
2520
2554
  }
2521
2555
  configs.push(
2522
2556
  {
2557
+ name: "eslint-sets/vue",
2523
2558
  files: [GLOB_VUE],
2524
2559
  languageOptions: {
2525
2560
  globals: vueVersion === 3 ? {
@@ -2583,7 +2618,6 @@ async function vue(options = {}) {
2583
2618
  sourceType: "module"
2584
2619
  }
2585
2620
  },
2586
- name: "eslint-sets/vue",
2587
2621
  plugins: {
2588
2622
  vue: vuePlugin,
2589
2623
  ...vueA11yPlugin ? { "vue-a11y": vueA11yPlugin } : {}
@@ -2705,11 +2739,11 @@ function yaml(options = {}) {
2705
2739
  } = typeof stylistic2 === "boolean" ? {} : stylistic2;
2706
2740
  return [
2707
2741
  {
2742
+ name: "eslint-sets/yaml",
2708
2743
  files: [GLOB_YAML],
2709
2744
  languageOptions: {
2710
2745
  parser: yamlParser
2711
2746
  },
2712
- name: "eslint-sets/yaml",
2713
2747
  plugins: {
2714
2748
  yaml: ymlPlugin
2715
2749
  },
@@ -2773,6 +2807,7 @@ function resolveOptionsOverrides(options, key) {
2773
2807
  }
2774
2808
  async function config(options = {}) {
2775
2809
  const {
2810
+ type: _type = "app",
2776
2811
  angular: angularOption = "auto",
2777
2812
  astro: astroOption = "auto",
2778
2813
  autoDetect = true,
@@ -2805,7 +2840,6 @@ async function config(options = {}) {
2805
2840
  svelte: svelteOption = "auto",
2806
2841
  test: testOption = true,
2807
2842
  toml: tomlOption = true,
2808
- type: _type = "app",
2809
2843
  typescript: tsOption = true,
2810
2844
  unicorn: unicornOption = true,
2811
2845
  unocss: unocssOption = "auto",
@@ -1 +1 @@
1
- {"version":3,"file":"git.d.ts","sourceRoot":"","sources":["../../src/utils/git.ts"],"names":[],"mappings":"AAuCA;;GAEG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAuBxD;AAED;;GAEG;AACH,wBAAsB,aAAa,CAAC,GAAG,GAAE,MAAsB,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAclF;AAED;;GAEG;AACH,wBAAsB,oBAAoB,CAAC,GAAG,GAAE,MAAsB,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CA8BzF"}
1
+ {"version":3,"file":"git.d.ts","sourceRoot":"","sources":["../../src/utils/git.ts"],"names":[],"mappings":"AAwCA;;GAEG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAuBxD;AAED;;GAEG;AACH,wBAAsB,aAAa,CAAC,GAAG,GAAE,MAAsB,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAclF;AAED;;GAEG;AACH,wBAAsB,oBAAoB,CAAC,GAAG,GAAE,MAAsB,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CA8BzF"}
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@eslint-sets/eslint-config",
3
3
  "description": "Modern ESLint config with flat config support for Vue, React, Svelte, TypeScript, Next.js, Nuxt, Astro, Angular, UnoCSS and more",
4
4
  "type": "module",
5
- "version": "6.3.0-beta.1",
5
+ "version": "6.3.0-beta.2",
6
6
  "packageManager": "pnpm@9.0.6",
7
7
  "bin": {
8
8
  "eslint-sets": "./dist/cli/index.js"