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.
Examples
Section titled “Examples”import {} from "module";import defaultExport from "module";export {} from "module";import { something } from "module";import "module";import defaultExport from "module";import * as namespace from "module";export { something } from "module";export * from "module";Options
Section titled “Options”This rule is not configurable.
When Not To Use It
Section titled “When Not To Use It”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.
Further Reading
Section titled “Further Reading”Equivalents in Other Linters
Section titled “Equivalents in Other Linters”
Made with ❤️🔥 in Boston by
Josh Goldberg and contributors.