-
-
Notifications
You must be signed in to change notification settings - Fork 115
chore: enable eslint-plugin-import-x, bump related dev deps
#654
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
@codex review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[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