Skip to content

moduleSpecifierLists

Require non-empty specifier lists in import and export statements.

✅ This rule is included in the ts logical presets.

Empty specifier lists in import and export statements like import {} from 'module' serve no purpose. They can appear due to refactoring or code generation errors. If you need to run a module’s code without importing any values, use a side-effect import instead.

This rule reports import and export statements that have empty braces with no specifiers.

import {} from "module";
import defaultExport from "module";
export {} from "module";

This rule is not configurable.

If your codebase intentionally uses empty import braces for specific purposes, such as ensuring module execution order or for tooling that processes imports in a special way, you may not need this rule.

Made with ❤️‍🔥 in Boston by Josh Goldberg and contributors.