Skip to content

import/no-empty-named-blocks incorrectly auto-fixes non-import code #2666

Closed
@EvHaus

Description

@EvHaus

The import/no-empty-named-blocks rule seems to have a bug where it affects regular objects.

The following code:

module.exports = {
	rules: {
		'keyword-spacing': ['error', {overrides: {}}],
	}
};

Gets auto-fixed to:

module.exports = {
	rules: {
		'keyword-spacing': ['error', {overrides: }],
	}
};

Note the invalid broken syntax in the overrides key. I think the rule should ignore any module.export definitions and only impact import statements.

CC @guilhermelimak

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions