noUnresolvedImports
Summary
Section titled “Summary”- Rule available since:
v2.0.0
- 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 “Description”Warn 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 “Examples”Invalid
Section titled “Invalid”foo.js
export function foo() {};
bar.js
// Attempt to import symbol with a typo:import { fooo } from "./foo.js";
bar.js
// Fixed typo:import { foo } from "./foo.js";
How to configure
Section titled “How to configure”{ "linter": { "rules": { "nursery": { "noUnresolvedImports": "error" } } }}