Skip to content

Commit 45382c5

Browse files
committed
fix: add support for default
1 parent 8a432e8 commit 45382c5

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/rules/no-wildcard-imports.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -386,10 +386,11 @@ module.exports = {
386386
throw new Error('Import Declaration has no specifiers')
387387
}
388388

389-
let lastSpecifier = importDeclaration.specifiers[importDeclaration.specifiers.length - 1]
389+
const firstSpecifier = importDeclaration.specifiers[0]
390+
const lastSpecifier = importDeclaration.specifiers[importDeclaration.specifiers.length - 1]
390391

391392
if (hasDefaultSpecifier) {
392-
console.log('wat')
393+
yield fixer.insertTextBefore(firstSpecifier, `${defaultSpecifier}, `)
393394
}
394395

395396
if (hasNamedSpecifiers) {

0 commit comments

Comments
 (0)