# 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.

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.

## Why

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

## What to do

Import from the leaf module directly.

## Example

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

## Options

This rule has no options.
