-
-
Notifications
You must be signed in to change notification settings - Fork 24
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
docs: add flat config configuration #135
Conversation
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. |
fbd80f6
to
01aacbd
Compare
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.
LGTM, thanks!
@marcalexiei It seems that README doesn't pass the lint. |
01aacbd
to
e592170
Compare
e592170
to
81c3ca6
Compare
Hi @SukkaW, |
I think you have to add the settings config in the typescript example. It should be something like this: import js from '@eslint/js'
import eslintPluginImportX from 'eslint-plugin-import-x'
import tsParser from '@typescript-eslint/parser'
export default [
js.configs.recommended,
eslintPluginImportX.flatConfigs.recommended,
eslintPluginImportX.flatConfigs.typescript,
{
files: ['**/*.{js,mjs,cjs,jsx,mjsx,ts,tsx,mtsx}'],
languageOptions: {
parser: tsParser,
ecmaVersion: 'latest',
sourceType: 'module',
},
ignores: ['eslint.config.js'],
rules: {
'no-unused-vars': 'off',
'import/no-dynamic-require': 'warn',
'import/no-nodejs-modules': 'warn',
},
settings: {
'import-x/resolver': {
typescript: true,
},
},
},
] |
IMHO they should be added to the typescript presets directly instead. Currently they are missing: eslint-plugin-import-x/src/config/flat/typescript.ts Lines 23 to 34 in 709f86f
|
Adding I added settings to the typescript example with a note that instructs the user to install |
When the typescript preset is enabled, we could assume they are lining a TypeScript project, which |
@SukkaW would you like that I setup another PR adding: settings: {
'import-x/resolver': {
typescript: true,
},
}, to the two typescript configs? |
Sure! Please do. |
Greetings,
I noticed the README is currently missing reference to the flat config which has been supported on new version 4.1.0.
I added two new sections under "Installation" section:
.eslintrc*
)" contains the previous content of "Installation that was after installlation commandeslint.config.js
)" contains two simple examples (js and ts).They are both wrapped in a
<details />
tag to avoid they take too much space.On the bottom of the section I added a link to reference the folder where all flat configs are present
I also added a few alert on the already present information to make them more visible (Github markdown reference)
Thanks for your work supporting the new config format!