Skip to content

gspot/no-index-imports

Finds an import that names an index file instead of the module that declares the value, including module paths in Vitest and Jest mocks. Folder imports such as ./lib are not reported.

The all config turns it on.

An import that names an index file hides the module that declares the value.

Import from the leaf module directly.

The import import { a } from "./index.js"; reports index. If a.js declares the value, use import { a } from "./a.js";.

This rule has no options.