@infernodesign/eslint-config 1.9.2 → 1.10.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.
package/dist/cli.js CHANGED
@@ -8,7 +8,7 @@ import parse from "parse-gitignore";
8
8
  import { execSync } from "node:child_process";
9
9
 
10
10
  //#region package.json
11
- var version = "1.9.2";
11
+ var version = "1.10.0";
12
12
 
13
13
  //#endregion
14
14
  //#region src/cli/constants.ts
@@ -171,20 +171,20 @@ async function updateEslintFiles(result) {
171
171
  //#endregion
172
172
  //#region src/cli/constants-generated.ts
173
173
  const versionsMap = {
174
- "@eslint-react/eslint-plugin": "^2.3.9",
175
- "@next/eslint-plugin-next": "^16.0.4",
176
- "@unocss/eslint-plugin": "^66.5.9",
174
+ "@eslint-react/eslint-plugin": "^2.3.12",
175
+ "@next/eslint-plugin-next": "^16.0.7",
176
+ "@unocss/eslint-plugin": "^66.5.10",
177
177
  "astro-eslint-parser": "^1.2.2",
178
178
  "eslint": "^9.39.1",
179
179
  "eslint-plugin-astro": "^1.5.0",
180
- "eslint-plugin-format": "^1.0.2",
180
+ "eslint-plugin-format": "^1.1.0",
181
181
  "eslint-plugin-react-hooks": "^7.0.1",
182
182
  "eslint-plugin-react-refresh": "^0.4.24",
183
183
  "eslint-plugin-solid": "^0.14.5",
184
184
  "eslint-plugin-svelte": "^3.13.0",
185
185
  "prettier-plugin-astro": "^0.14.1",
186
186
  "prettier-plugin-slidev": "^1.0.5",
187
- "svelte-eslint-parser": "^1.4.0"
187
+ "svelte-eslint-parser": "^1.4.1"
188
188
  };
189
189
 
190
190
  //#endregion
package/dist/index.d.ts CHANGED
@@ -13499,6 +13499,7 @@ type ReactNoUnstableDefaultProps = [] | [{
13499
13499
  }];
13500
13500
  // ----- react/no-useless-fragment -----
13501
13501
  type ReactNoUselessFragment = [] | [{
13502
+ allowEmptyFragment?: boolean;
13502
13503
  allowExpressions?: boolean;
13503
13504
  }];
13504
13505
  // ----- regexp/hexadecimal-escape -----
@@ -18424,6 +18425,7 @@ declare function ensurePackages(packages: (string | undefined)[]): Promise<void>
18424
18425
  declare function interopDefault<T>(m: Awaitable<T>): Promise<T extends {
18425
18426
  default: infer U;
18426
18427
  } ? U : T>;
18428
+ declare function isInCursorAgent(): boolean;
18427
18429
  declare function isInEditorEnv(): boolean;
18428
18430
  declare function isInGitHooksOrLintStaged(): boolean;
18429
18431
  declare function isInVSCodeESLintExtension(): boolean;
@@ -18433,4 +18435,4 @@ declare function renamePluginInConfigs(configs: TypedFlatConfigItem[], map: Reco
18433
18435
  declare function renameRules(rules: Record<string, any>, map: Record<string, string>): Record<string, any>;
18434
18436
  declare function toArray<T>(value: T | T[]): T[];
18435
18437
  //#endregion
18436
- export { Awaitable, type ConfigNames, GLOB_ALL_SRC, GLOB_ASTRO, GLOB_ASTRO_TS, GLOB_CSS, GLOB_EXCLUDE, GLOB_GRAPHQL, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_MARKDOWN_IN_MARKDOWN, GLOB_POSTCSS, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STORYBOOK, GLOB_STYLE, GLOB_SVELTE, GLOB_SVG, GLOB_TESTS, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_XML, GLOB_YAML, OptionsComponentExts, OptionsConfig, OptionsFiles, OptionsFormatters, OptionsHasTypeScript, OptionsIsInEditor, OptionsJSX, OptionsJSXA11y, OptionsNextjs, OptionsOverrides, OptionsProjectType, OptionsRegExp, OptionsStylistic, OptionsTailwindcss, OptionsTypeScriptParserOptions, OptionsTypeScriptWithTypes, OptionsTypescript, OptionsUnicorn, OptionsUnoCSS, OptionsVue, ResolvedOptions, Rules, StylisticConfig, StylisticConfigDefaults, StylisticOptions, TypedFlatConfigItem, astro, combine, command, comments, inferno as default, inferno, defaultPluginRenaming, disables, ensurePackages, formatters, getOverrides, ignores, imports, interopDefault, isInEditorEnv, isInGitHooksOrLintStaged, isInVSCodeESLintExtension, isPackageInScope, javascript, jsdoc, jsonc, jsx, markdown, nextjs, node, normalizeRules, packageExportsSortOrder, packageSortOrder, parserPlain, perfectionist, pnpm, react, regexp, renamePluginInConfigs, renameRules, resolveSubOptions, solid, sortPackageJson, sortTsconfig, storybook, stylistic, svelte, tailwindcss, test, toArray, toml, typescript, unicorn, unocss, vue, yaml };
18438
+ export { Awaitable, type ConfigNames, GLOB_ALL_SRC, GLOB_ASTRO, GLOB_ASTRO_TS, GLOB_CSS, GLOB_EXCLUDE, GLOB_GRAPHQL, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_MARKDOWN_IN_MARKDOWN, GLOB_POSTCSS, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STORYBOOK, GLOB_STYLE, GLOB_SVELTE, GLOB_SVG, GLOB_TESTS, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_XML, GLOB_YAML, OptionsComponentExts, OptionsConfig, OptionsFiles, OptionsFormatters, OptionsHasTypeScript, OptionsIsInEditor, OptionsJSX, OptionsJSXA11y, OptionsNextjs, OptionsOverrides, OptionsProjectType, OptionsRegExp, OptionsStylistic, OptionsTailwindcss, OptionsTypeScriptParserOptions, OptionsTypeScriptWithTypes, OptionsTypescript, OptionsUnicorn, OptionsUnoCSS, OptionsVue, ResolvedOptions, Rules, StylisticConfig, StylisticConfigDefaults, StylisticOptions, TypedFlatConfigItem, astro, combine, command, comments, inferno as default, inferno, defaultPluginRenaming, disables, ensurePackages, formatters, getOverrides, ignores, imports, interopDefault, isInCursorAgent, isInEditorEnv, isInGitHooksOrLintStaged, isInVSCodeESLintExtension, isPackageInScope, javascript, jsdoc, jsonc, jsx, markdown, nextjs, node, normalizeRules, packageExportsSortOrder, packageSortOrder, parserPlain, perfectionist, pnpm, react, regexp, renamePluginInConfigs, renameRules, resolveSubOptions, solid, sortPackageJson, sortTsconfig, storybook, stylistic, svelte, tailwindcss, test, toArray, toml, typescript, unicorn, unocss, vue, yaml };
package/dist/index.js CHANGED
@@ -110,6 +110,11 @@ const GLOB_EXCLUDE = [
110
110
  //#region src/utils.ts
111
111
  const scopeUrl = fileURLToPath(new URL(".", import.meta.url));
112
112
  const isCwdInScope = isPackageExists("@infernodesign/eslint-config");
113
+ /**
114
+ * Plain parser.
115
+ *
116
+ * @returns {Linter.Parser} The plain parser.
117
+ */
113
118
  const parserPlain = {
114
119
  meta: { name: "parser-plain" },
115
120
  parseForESLint: (code) => ({
@@ -138,6 +143,12 @@ const parserPlain = {
138
143
  async function combine(...configs$1) {
139
144
  return (await Promise.all(configs$1)).flat();
140
145
  }
146
+ /**
147
+ * Ensure packages are installed.
148
+ *
149
+ * @param {string[]} packages The packages to ensure are installed.
150
+ * @returns {Promise<void>} The promise to ensure packages are installed.
151
+ */
141
152
  async function ensurePackages(packages) {
142
153
  if (process.env.CI || process.stdout.isTTY === false || isCwdInScope === false) return;
143
154
  const nonExistingPackages = packages.filter((i) => i && !isPackageInScope(i));
@@ -148,14 +159,38 @@ async function ensurePackages(packages) {
148
159
  }
149
160
  if (await (await import("@clack/prompts")).confirm({ message: `${nonExistingPackages.length === 1 ? "Package is" : "Packages are"} required for this config: ${nonExistingPackages.join(", ")}. Do you want to install them?` })) await import("@antfu/install-pkg").then((i) => i.installPackage(nonExistingPackages, { dev: true }));
150
161
  }
162
+ /**
163
+ * Interop default.
164
+ *
165
+ * @param {Awaitable<T>} m The module to interop default from.
166
+ * @returns {Promise<T extends { default: infer U } ? U : T>} The interop default.
167
+ */
151
168
  async function interopDefault(m) {
152
169
  const resolved = await m;
153
170
  return resolved.default || resolved;
154
171
  }
172
+ /**
173
+ * Check if running in Cursor Agent.
174
+ *
175
+ * @returns {boolean} True if running in Cursor Agent, false otherwise.
176
+ */
177
+ function isInCursorAgent() {
178
+ return !!process.env.CURSOR_AGENT;
179
+ }
180
+ /**
181
+ * Check if running in editor environment.
182
+ *
183
+ * @returns {boolean} True if running in editor environment, false otherwise.
184
+ */
155
185
  function isInEditorEnv() {
156
- if (process.env.CI || isInGitHooksOrLintStaged()) return false;
186
+ if (process.env.CI || isInGitHooksOrLintStaged() || isInCursorAgent()) return false;
157
187
  return !!(process.env.VSCODE_PID || process.env.VSCODE_CWD || process.env.JETBRAINS_IDE || process.env.VIM || process.env.NVIM);
158
188
  }
189
+ /**
190
+ * Check if running in git hooks or lint staged.
191
+ *
192
+ * @returns {boolean} True if running in git hooks or lint staged, false otherwise.
193
+ */
159
194
  function isInGitHooksOrLintStaged() {
160
195
  return !!(process.env.GIT_PARAMS || process.env.VSCODE_GIT_COMMAND || process.env.npm_lifecycle_script?.startsWith("lint-staged") || process.env.npm_lifecycle_script?.startsWith("lefthook pre-commit"));
161
196
  }
@@ -167,9 +202,21 @@ function isInGitHooksOrLintStaged() {
167
202
  function isInVSCodeESLintExtension() {
168
203
  return !!(typeof process.send === "function" && (process.env.VSCODE_PID || process.env.VSCODE_CWD) || process.env.VSCODE_ESL_DEBUG);
169
204
  }
205
+ /**
206
+ * Check if package is in scope.
207
+ *
208
+ * @param {string} name The name of the package to check.
209
+ * @returns {boolean} True if package is in scope, false otherwise.
210
+ */
170
211
  function isPackageInScope(name) {
171
212
  return isPackageExists(name, { paths: [scopeUrl] });
172
213
  }
214
+ /**
215
+ * Normalize rules.
216
+ *
217
+ * @param {Record<string, any>} rules The rules to normalize.
218
+ * @returns {Record<string, any>} The normalized rules.
219
+ */
173
220
  function normalizeRules(rules) {
174
221
  return Object.fromEntries(Object.entries(rules).map(([key, value]) => [key, typeof value === "string" ? [value] : value]));
175
222
  }
@@ -231,6 +278,12 @@ function renameRules(rules, map) {
231
278
  return [key, value];
232
279
  }));
233
280
  }
281
+ /**
282
+ * Convert value to array.
283
+ *
284
+ * @param {T | T[]} value The value to convert to array.
285
+ * @returns {T[]} The value as array.
286
+ */
234
287
  function toArray(value) {
235
288
  return Array.isArray(value) ? value : [value];
236
289
  }
@@ -2842,4 +2895,4 @@ function resolveSubOptions(options, key) {
2842
2895
  var src_default = inferno;
2843
2896
 
2844
2897
  //#endregion
2845
- export { GLOB_ALL_SRC, GLOB_ASTRO, GLOB_ASTRO_TS, GLOB_CSS, GLOB_EXCLUDE, GLOB_GRAPHQL, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_MARKDOWN_IN_MARKDOWN, GLOB_POSTCSS, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STORYBOOK, GLOB_STYLE, GLOB_SVELTE, GLOB_SVG, GLOB_TESTS, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_XML, GLOB_YAML, StylisticConfigDefaults, astro, combine, command, comments, src_default as default, defaultPluginRenaming, disables, ensurePackages, formatters, getOverrides, ignores, imports, inferno, interopDefault, isInEditorEnv, isInGitHooksOrLintStaged, isInVSCodeESLintExtension, isPackageInScope, javascript, jsdoc, jsonc, jsx, markdown, nextjs, node, normalizeRules, packageExportsSortOrder, packageSortOrder, parserPlain, perfectionist, pnpm, react, regexp, renamePluginInConfigs, renameRules, resolveSubOptions, solid, sortPackageJson, sortTsconfig, storybook, stylistic, svelte, tailwindcss, test, toArray, toml, typescript, unicorn, unocss, vue, yaml };
2898
+ export { GLOB_ALL_SRC, GLOB_ASTRO, GLOB_ASTRO_TS, GLOB_CSS, GLOB_EXCLUDE, GLOB_GRAPHQL, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_MARKDOWN_IN_MARKDOWN, GLOB_POSTCSS, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STORYBOOK, GLOB_STYLE, GLOB_SVELTE, GLOB_SVG, GLOB_TESTS, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_XML, GLOB_YAML, StylisticConfigDefaults, astro, combine, command, comments, src_default as default, defaultPluginRenaming, disables, ensurePackages, formatters, getOverrides, ignores, imports, inferno, interopDefault, isInCursorAgent, isInEditorEnv, isInGitHooksOrLintStaged, isInVSCodeESLintExtension, isPackageInScope, javascript, jsdoc, jsonc, jsx, markdown, nextjs, node, normalizeRules, packageExportsSortOrder, packageSortOrder, parserPlain, perfectionist, pnpm, react, regexp, renamePluginInConfigs, renameRules, resolveSubOptions, solid, sortPackageJson, sortTsconfig, storybook, stylistic, svelte, tailwindcss, test, toArray, toml, typescript, unicorn, unocss, vue, yaml };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@infernodesign/eslint-config",
3
3
  "description": "ESLint config for Inferno Design.",
4
- "version": "1.9.2",
4
+ "version": "1.10.0",
5
5
  "type": "module",
6
6
  "author": "Inferno Design <support@infernodesign.com>",
7
7
  "license": "MIT",
@@ -40,9 +40,9 @@
40
40
  "@eslint-community/eslint-plugin-eslint-comments": "^4.5.0",
41
41
  "@eslint/markdown": "^7.5.1",
42
42
  "@stylistic/eslint-plugin": "^5.6.1",
43
- "@typescript-eslint/eslint-plugin": "^8.48.0",
44
- "@typescript-eslint/parser": "^8.48.0",
45
- "@vitest/eslint-plugin": "^1.5.0",
43
+ "@typescript-eslint/eslint-plugin": "^8.48.1",
44
+ "@typescript-eslint/parser": "^8.48.1",
45
+ "@vitest/eslint-plugin": "^1.5.1",
46
46
  "ansis": "^4.2.0",
47
47
  "cac": "^6.7.14",
48
48
  "eslint-config-flat-gitignore": "^2.1.0",
@@ -57,12 +57,12 @@
57
57
  "eslint-plugin-n": "^17.23.1",
58
58
  "eslint-plugin-no-only-tests": "^3.3.0",
59
59
  "eslint-plugin-perfectionist": "^4.15.1",
60
- "eslint-plugin-pnpm": "^1.3.0",
60
+ "eslint-plugin-pnpm": "^1.4.0",
61
61
  "eslint-plugin-regexp": "^2.10.0",
62
62
  "eslint-plugin-toml": "^0.12.0",
63
63
  "eslint-plugin-unicorn": "^62.0.0",
64
64
  "eslint-plugin-unused-imports": "^4.3.0",
65
- "eslint-plugin-vue": "^10.6.1",
65
+ "eslint-plugin-vue": "^10.6.2",
66
66
  "eslint-plugin-yml": "^1.19.0",
67
67
  "eslint-processor-vue-blocks": "^2.0.0",
68
68
  "globals": "^16.5.0",
@@ -71,62 +71,62 @@
71
71
  "parse-gitignore": "^2.0.0",
72
72
  "toml-eslint-parser": "^0.10.0",
73
73
  "vue-eslint-parser": "^10.2.0",
74
- "yaml-eslint-parser": "^1.3.1"
74
+ "yaml-eslint-parser": "^1.3.2"
75
75
  },
76
76
  "devDependencies": {
77
- "@eslint-react/eslint-plugin": "^2.3.9",
77
+ "@eslint-react/eslint-plugin": "^2.3.12",
78
78
  "@eslint/config-inspector": "^1.4.2",
79
- "@next/eslint-plugin-next": "^16.0.4",
79
+ "@next/eslint-plugin-next": "^16.0.7",
80
80
  "@prettier/plugin-xml": "^3.4.2",
81
81
  "@types/eslint-plugin-jsx-a11y": "^6.10.1",
82
82
  "@types/node": "^24.10.1",
83
- "@unocss/eslint-plugin": "^66.5.9",
83
+ "@unocss/eslint-plugin": "^66.5.10",
84
84
  "astro-eslint-parser": "^1.2.2",
85
85
  "eslint": "^9.39.1",
86
86
  "eslint-plugin-astro": "^1.5.0",
87
- "eslint-plugin-format": "^1.0.2",
87
+ "eslint-plugin-format": "^1.1.0",
88
88
  "eslint-plugin-jsx-a11y": "^6.10.2",
89
89
  "eslint-plugin-react-hooks": "^7.0.1",
90
90
  "eslint-plugin-react-refresh": "^0.4.24",
91
91
  "eslint-plugin-solid": "^0.14.5",
92
- "eslint-plugin-storybook": "^10.1.0",
92
+ "eslint-plugin-storybook": "^10.1.4",
93
93
  "eslint-plugin-svelte": "^3.13.0",
94
94
  "eslint-plugin-vuejs-accessibility": "^2.4.1",
95
95
  "eslint-typegen": "^2.3.0",
96
- "execa": "^9.6.0",
96
+ "execa": "^9.6.1",
97
97
  "jiti": "^2.6.1",
98
- "pnpm-workspace-yaml": "^1.3.0",
98
+ "pnpm-workspace-yaml": "^1.4.0",
99
99
  "prettier-plugin-astro": "^0.14.1",
100
100
  "prettier-plugin-slidev": "^1.0.5",
101
- "svelte": "^5.44.1",
102
- "svelte-eslint-parser": "^1.4.0",
101
+ "svelte": "^5.45.5",
102
+ "svelte-eslint-parser": "^1.4.1",
103
103
  "tinyglobby": "^0.2.15",
104
- "tsdown": "^0.16.7",
105
- "tsx": "^4.20.6",
104
+ "tsdown": "^0.17.0",
105
+ "tsx": "^4.21.0",
106
106
  "typescript": "^5.9.3",
107
- "vitest": "^4.0.14",
107
+ "vitest": "^4.0.15",
108
108
  "vue": "^3.5.25",
109
109
  "@infernodesign/typescript-config": "1.3.0"
110
110
  },
111
111
  "peerDependencies": {
112
- "@eslint-react/eslint-plugin": "^2.3.9",
113
- "@next/eslint-plugin-next": "^16.0.4",
112
+ "@eslint-react/eslint-plugin": "^2.3.12",
113
+ "@next/eslint-plugin-next": "^16.0.7",
114
114
  "@prettier/plugin-xml": "^3.4.2",
115
- "@unocss/eslint-plugin": "^66.5.9",
115
+ "@unocss/eslint-plugin": "^66.5.10",
116
116
  "astro-eslint-parser": "^1.2.2",
117
117
  "eslint": "^9.39.1",
118
118
  "eslint-plugin-astro": "^1.5.0",
119
- "eslint-plugin-format": "^1.0.2",
119
+ "eslint-plugin-format": "^1.1.0",
120
120
  "eslint-plugin-jsx-a11y": "^6.10.2",
121
121
  "eslint-plugin-react-hooks": "^7.0.1",
122
122
  "eslint-plugin-react-refresh": "^0.4.24",
123
123
  "eslint-plugin-solid": "^0.14.5",
124
- "eslint-plugin-storybook": "^10.1.0",
124
+ "eslint-plugin-storybook": "^10.1.4",
125
125
  "eslint-plugin-svelte": "^3.13.0",
126
126
  "eslint-plugin-vuejs-accessibility": "^2.4.1",
127
127
  "prettier-plugin-astro": "^0.14.1",
128
128
  "prettier-plugin-slidev": "^1.0.5",
129
- "svelte-eslint-parser": "^1.4.0"
129
+ "svelte-eslint-parser": "^1.4.1"
130
130
  },
131
131
  "peerDependenciesMeta": {
132
132
  "@eslint-react/eslint-plugin": {