noUnresolvedImports
Summary
Section titled Summary- Diagnostic Category:
lint/nursery/noUnresolvedImports
- This rule doesn’t have a fix.
- The default severity of this rule is information.
- This rule belongs to the following domains:
- Sources:
- Inspired from
import/named
- Inspired from
Description
Section titled DescriptionWarn when importing non-existing exports.
Importing a non-existing export is an error at runtime or build time. Biome can detect such incorrect imports and report errors for them.
Note that if you use TypeScript, you probably don’t want to use this rule, since TypeScript already performs such checks for you.
Known Limitations
Section titled Known Limitations- This rule does not validate imports through dynamic
import()
expressions or CommonJSrequire()
calls.
Examples
Section titled ExamplesInvalid
Section titled Invalidfoo.js
export function foo() {};
bar.js
// Attempt to import symbol with a typo:import { fooo } from "./foo.js";
Valid
Section titled Validbar.js
// Fixed typo:import { foo } from "./foo.js";
How to configure
Section titled How to configure{ "linter": { "rules": { "nursery": { "noUnresolvedImports": "error" } } }}