This rule raises an issue when import or export statements contain empty curly braces {}.

Why is this an issue?

Empty specifier lists in import and export statements serve no purpose and create unnecessary code clutter. They typically result from incomplete refactoring or copy-paste errors.

When you write import {} from 'module', you’re not actually importing anything from the module. If you need the module’s side effects (like running initialization code), you should use a side-effect import: import 'module'.

Similarly, export {} statements without any actual exports are meaningless and should be removed.

These empty statements can confuse other developers and make the codebase harder to maintain. They may also indicate incomplete code changes that need attention.

What is the potential impact?

This issue affects code maintainability and readability. While it doesn’t cause runtime errors, it can:

How to fix?

For imports with empty specifiers, convert to a side-effect import if you need the module’s side effects, or remove the statement entirely.

Non-compliant code example

import {} from 'lodash'; // Noncompliant

Compliant code example

import 'lodash'; // Side-effect import

Documentation