Skip to content

Commit

Permalink
fix(eslint-plugin): [no-import-type-side-effects] correctly ignore ze…
Browse files Browse the repository at this point in the history
…ro-specifier imports (#6444)
  • Loading branch information
bradzacher committed Feb 9, 2023
1 parent a9cb860 commit d5a6688
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
Expand Up @@ -29,6 +29,10 @@ export default util.createRule<Options, MessageIds>({
'ImportDeclaration[importKind!="type"]'(
node: TSESTree.ImportDeclaration,
): void {
if (node.specifiers.length === 0) {
return;
}

const specifiers: TSESTree.ImportSpecifier[] = [];
for (const specifier of node.specifiers) {
if (
Expand Down
Expand Up @@ -18,6 +18,7 @@ ruleTester.run('no-import-type-side-effects', rule, {
"import type T, { U } from 'mod';",
"import T, { type U } from 'mod';",
"import type * as T from 'mod';",
"import 'mod';",
],
invalid: [
{
Expand Down

0 comments on commit d5a6688

Please sign in to comment.