This rule raises an issue when import or export statements contain empty curly braces {}.
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.
This issue affects code maintainability and readability. While it doesn’t cause runtime errors, it can:
For imports with empty specifiers, convert to a side-effect import if you need the module’s side effects, or remove the statement entirely.
import {} from 'lodash'; // Noncompliant
import 'lodash'; // Side-effect import