Skip to content
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

Configuration for rule "import/no-duplicates" is invalid: Value {"prefer-inline":true} should NOT have additional properties #2863

Closed
filipjakov opened this issue Aug 23, 2023 · 3 comments

Comments

@filipjakov
Copy link

filipjakov commented Aug 23, 2023

problem in both: "eslint-plugin-import": "2.27.5" & "eslint-plugin-import": "2.28.1" versions

Trying to add support for typescript's new flag verbatimModuleSyntax

Since the codebase is big, the idea is to add warning rules for imports and as soon as the developer touches a file, it will --fix its content based on the following rules:

'@typescript-eslint/consistent-type-exports': 'warn',
'@typescript-eslint/consistent-type-imports': 'warn',
'@typescript-eslint/no-import-type-side-effects': 'warn',
'import/no-duplicates': ['error', { 'prefer-inline': true }],

(The above rules are recommended in https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/consistent-type-imports.md)

The first 3 work as expected, but import/no-duplicates yields:

Configuration for rule "import/no-duplicates" is invalid:
Value {"prefer-inline":true} should NOT have additional properties.

Since prefer-inline is recommended as per this, what am I doing wrong?

@ljharb
Copy link
Member

ljharb commented Aug 23, 2023

Are you absolutely certain you have v2.28 of the import plugin? what does npm explain eslint-plugin-import output?

@filipjakov
Copy link
Author

filipjakov commented Aug 24, 2023

I was relying on the import provided by eslint-config-next@"13.3.0" which was [email protected] 😅

It seems like they have it as "eslint-plugin-import": "^2.26.0", in their package.json even on LTS.

Thanks, sorry for the trouble 🙏

@ljharb
Copy link
Member

ljharb commented Aug 24, 2023

^2.26.0 is a semver range that includes the latest v2 version, so that should be just fine, and you just need to update your lockfile.

@ljharb ljharb closed this as not planned Won't fix, can't repro, duplicate, stale Aug 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants