File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -7,6 +7,10 @@ const messages = {
77} ;
88
99const getActualImportDeclarationStyles = importDeclaration => {
10+ if ( importDeclaration . importKind === 'type' ) {
11+ return [ ] ;
12+ }
13+
1014 const { specifiers} = importDeclaration ;
1115
1216 if ( specifiers . length === 0 ) {
@@ -27,6 +31,10 @@ const getActualImportDeclarationStyles = importDeclaration => {
2731 }
2832
2933 if ( specifier . type === 'ImportSpecifier' ) {
34+ if ( specifier . importKind === 'type' ) {
35+ continue ;
36+ }
37+
3038 if ( specifier . imported . type === 'Identifier' && specifier . imported . name === 'default' ) {
3139 styles . add ( 'default' ) ;
3240 continue ;
Original file line number Diff line number Diff line change @@ -714,6 +714,20 @@ test.babel({
714714 ] . map ( test => addDefaultOptions ( test ) ) ,
715715} ) ;
716716
717+ test . typescript ( {
718+ valid : [
719+ {
720+ code : 'import {type ChalkInstance} from \'chalk\'' ,
721+ options : [ ] ,
722+ } ,
723+ {
724+ code : 'import type {ChalkInstance} from \'chalk\'' ,
725+ options : [ ] ,
726+ } ,
727+ ] ,
728+ invalid : [ ] ,
729+ } ) ;
730+
717731test . snapshot ( {
718732 valid : [
719733 'let a' ,
You can’t perform that action at this time.
0 commit comments