We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
no-duplicates
Repro repo
eslint-plugin-import-x: v4.6.1
import { config, configs } from 'typescript-eslint' import pluginImportX from 'eslint-plugin-import-x' const { createNodeResolver } = pluginImportX export default config({ extends: [configs.recommended], plugins: { 'import-x': pluginImportX }, settings: { 'import-x/resolver-next': [ createNodeResolver({ extensions: ['.js', '.mjs', '.ts', '.mts', '.d.ts', '.json'], }), ], }, rules: { 'import-x/no-duplicates': ['error'] } })
import { createRouter, createWebHashHistory } from 'vue-router' import { routes } from 'vue-router/auto-routes' export const router = createRouter({ history: createWebHashHistory(), routes, })
'/Users/ntnyq/Desktop/github/ntnyq/repro-import-x-no-duplicates/node_modules/.pnpm/[email protected][email protected][email protected]_/node_modules/vue-router/dist/vue-router.mjs' imported multiple times.
With --fix passed, code will change to:
--fix
import { createRouter, createWebHashHistory, routes } from 'vue-router' export const router = createRouter({ history: createWebHashHistory(), routes, })
The text was updated successfully, but these errors were encountered:
Their import/require conditions point to same file ./dist/vue-router.mjs, so they are considered duplicates.
import/require
./dist/vue-router.mjs
If you use eslint-import-resolver-typescript, types condition will be preferred, then it should work as expected.
eslint-import-resolver-typescript
types
Sorry, something went wrong.
Got it. Thanks.
I'll try typescript resolver.
No branches or pull requests
Repro repo
eslint-plugin-import-x: v4.6.1
ESLint config
Code:
Errors:
With
--fix
passed, code will change to:The text was updated successfully, but these errors were encountered: