SKY-Q414 · Quality, structure and performance
Unresolved import
A literal relative import, or one that matches a tsconfig paths alias or a package.json imports key, names no file in the project. Extensions, index files, TypeScript source for .js specifiers and directory package.json files have all been tried.
- Languages
- TypeScript, JavaScript, Vue, Svelte, Astro
- Turned on by
skylos . --quality- Quality gate
- counted toward the gate limits (full and diff scans). Reported as quality; counts toward max_quality.
- Finding type
- defect
Why it matters
The build or the first run of the importing module fails with a module-not-found error. A renamed or deleted file usually leaves such imports behind.
What Skylos flags
{"name":"shop","version":"1.0.0"}export const price = (cents: number) => (cents / 100).toFixed(2);import { price } from "./format";console.log(price(1999));What Skylos leaves alone
import { price } from "./formatting.js";console.log(price(1999));Why Skylos leaves it alone
The .js specifier maps to the TypeScript source formatting.ts, as tsc and bundlers resolve it.
How Skylos decides
- Runs with quality analysis on literal
import,export ... from,require()andimport()requests in scanned JS/TS files and in Vue, Svelte and Astro script blocks. Type-only imports are erased at build time and left to the type checker; bare package names are SKY-Q408's concern; config files are parsed, never executed. - Tries the exact path, source, declaration, component and data extensions, platform variants,
.jsto TypeScript source, index files, a directory package.json and tsconfigrootDirs. An alias is tried through every mapped target, with build output mapped to source. - Stays quiet for query or loader suffixes, virtual modules (
virtual:,astro:,~icons/,$app/,$env/), loads in atrybody or with.catch, ambientdeclare modulenames, prefixes aliased by a JS bundler config (an unreadable alias holds back every alias below it), targets in node_modules, outside the project, excluded or Git-ignored, fixture, snapshot and template directories, unimported non-test files under test directories, and aliases under a tsconfig extending a generated config that is missing. - Reports MEDIUM at the import line.
analysis_summary.unresolved_import_analysiscounts the requests checked and why others were held back.
How to fix it
Point the import at the file that exists, restore the missing file, or remove the import.
Removed: import { price } from "./format";Added: import { price } from "./formatting";console.log(price(1999));When it can be wrong
- A file produced by a build step that is neither Git-ignored nor in an excluded directory is missing from a clean checkout and is reported.
- Aliases defined only in code Skylos does not read (a plugin computing aliases, a tsconfig other than the nearest tsconfig.json) are not recognised, so their imports are not checked.
Seeing a case that isn't listed here? Report the wrong result so the rule can be fixed. Don't paste company code: describe the shape of it.
How to silence it
Add
// skylos: ignore[SKY-Q414]to the import line to accept one import.TypeScript import { price } from "./format"; // skylos: ignore[SKY-Q414] generated in CISet
[tool.skylos] ignore = ["SKY-Q414"]to disable this rule project-wide.