Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import eslintConfigPrettier from 'eslint-config-prettier/flat';
import { defineConfig } from 'eslint/config';
import tseslint from 'typescript-eslint';

export default defineConfig(
export default defineConfig([
tseslint.configs.recommended,
reactPlugin.configs.flat.recommended,
reactPlugin.configs.flat['jsx-runtime'],
eslintPluginPrettierRecommended,
eslintConfigPrettier
);
eslintConfigPrettier,
]);
Comment on lines +7 to +13
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Spread array-based configs to avoid nested arrays in flat config

Several imported presets are arrays. Without spreading, defineConfig receives nested arrays and ESLint will fail at runtime. Spread array-based configs; keep object-based React configs as-is. Prettier should remain last.

-export default defineConfig([
-  tseslint.configs.recommended,
-  reactPlugin.configs.flat.recommended,
-  reactPlugin.configs.flat['jsx-runtime'],
-  eslintPluginPrettierRecommended,
-  eslintConfigPrettier,
-]);
+export default defineConfig([
+  ...tseslint.configs.recommended,
+  reactPlugin.configs.flat.recommended,
+  reactPlugin.configs.flat['jsx-runtime'],
+  ...eslintPluginPrettierRecommended,
+  ...eslintConfigPrettier,
+]);
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
export default defineConfig([
tseslint.configs.recommended,
reactPlugin.configs.flat.recommended,
reactPlugin.configs.flat['jsx-runtime'],
eslintPluginPrettierRecommended,
eslintConfigPrettier
);
eslintConfigPrettier,
]);
export default defineConfig([
...tseslint.configs.recommended,
reactPlugin.configs.flat.recommended,
reactPlugin.configs.flat['jsx-runtime'],
...eslintPluginPrettierRecommended,
...eslintConfigPrettier,
]);
🤖 Prompt for AI Agents
In eslint.config.js around lines 7 to 13, the array-based ESLint configs are
passed as nested arrays to defineConfig, causing runtime failures. To fix this,
spread the array-based configs using the spread operator (...) so that
defineConfig receives a flat array. Keep object-based React configs unchanged
and ensure the Prettier config remains last in the array.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@
"eslint-config-prettier": "^10.1.8",
"eslint-plugin-prettier": "^5.5.4",
"eslint-plugin-react": "^7.37.5",
"exbuild": "^0.2.2",
"http-server": "^14.1.1",
"husky": "^9.1.7",
"lint-staged": "^16.1.5",
Expand Down
Loading