no-duplicates
Configuration
rslint.config.ts
Rule Details
Reports if a resolved path is imported more than once.
This rule is similar to ESLint core's no-duplicate-imports, but differs in two key ways:
- The paths in the source code don't have to exactly match — they just have to point to the same module on the filesystem (e.g.,
./fooand./foo.js). - This version distinguishes
typeimports from standard imports.
Examples of incorrect code for this rule:
Examples of correct code for this rule:
Options
considerQueryString
When set to true, imports with different query strings are treated as different modules.
prefer-inline
When set to true, supports TypeScript inline type imports, allowing import type { X } to be merged into import { type X }.