chore: enable eslint-plugin-import-x, bump related dev deps#654
chore: enable eslint-plugin-import-x, bump related dev deps#654JounQin wants to merge 3 commits intoamilajack:mainfrom
eslint-plugin-import-x, bump related dev deps#654Conversation
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
| export default defineConfig([ | ||
| includeIgnoreFile(gitignorePath), | ||
| eslint.configs.recommended, | ||
| ...tseslint.configs.recommended, | ||
| tseslint.configs.recommended, | ||
| eslintPlugin.configs["flat/recommended"], |
There was a problem hiding this comment.
[P1] Spread TypeScript ESLint configs in flat config array
tseslint.configs.recommended returns a FlatConfigArray. After switching to defineConfig, it is now inserted as a single array element ([ …, tseslint.configs.recommended, … ]), so ESLint receives a nested array instead of individual config objects and will error when loading the config. Spread the configs (...tseslint.configs.recommended) so the array is flattened.
Useful? React with 👍 / 👎.
| compat.configs["flat/recommended"], | ||
| importX.flatConfigs.recommended, | ||
| importX.flatConfigs.typescript, | ||
| eslintConfigPrettier, | ||
| { |
There was a problem hiding this comment.
[P1] Spread Prettier flat config to avoid nested array
eslint-config-prettier/flat also exports an array of flat configs. Adding it directly to the exported config list yields [ ..., importX.flatConfigs.typescript, eslintConfigPrettier, … ], which passes a nested array to ESLint and prevents the Prettier overrides from loading. Use ...eslintConfigPrettier so each entry is merged at the top level.
Useful? React with 👍 / 👎.
0fa10f5 to
c528510
Compare
- Remove deprecated 'extensions' and 'useEslintrc' properties from ESLint options - Remove unnecessary @ts-expect-error directives that are no longer needed - Fixes TypeScript compilation errors in e2e tests
https://github.com/un-ts/eslint-plugin-import-x
Also close #646
cc @amilajack