File tree 1 file changed +5
-2
lines changed
1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -3043,6 +3043,9 @@ context('TypeScript', function () {
3043
3043
// Type-only imports were added in TypeScript ESTree 2.23.0
3044
3044
. filter ( ( parser ) => parser !== parsers . TS_OLD )
3045
3045
. forEach ( ( parser ) => {
3046
+ const supportsTypeSpecifiers = semver . satisfies ( require ( '@typescript-eslint/parser/package.json' ) . version , '>= 5' ) ;
3047
+ const supportsImportTypeSpecifiers = parser !== parsers . TS_NEW || supportsTypeSpecifiers ;
3048
+ const supportsExportTypeSpecifiers = parser === parsers . TS_NEW && supportsTypeSpecifiers ;
3046
3049
const parserConfig = {
3047
3050
parser,
3048
3051
settings : {
@@ -3527,7 +3530,7 @@ context('TypeScript', function () {
3527
3530
alphabetize : { order : 'asc' } ,
3528
3531
} ] ,
3529
3532
errors : [
3530
- { message : '`A ` import should occur before type import of `Z`' } ,
3533
+ { message : `\`A\ ` import should occur before${ supportsImportTypeSpecifiers ? ' type' : '' } import of \`Z\`` } ,
3531
3534
{ message : '`D` import should occur before import of `E`' } ,
3532
3535
{ message : '`G` import should occur before import of `L`' } ,
3533
3536
] ,
@@ -3553,7 +3556,7 @@ context('TypeScript', function () {
3553
3556
} ] ,
3554
3557
} ) ,
3555
3558
3556
- parser !== parsers . BABEL_OLD ? [
3559
+ supportsExportTypeSpecifiers ? [
3557
3560
test ( {
3558
3561
code : `
3559
3562
export { type B, A };
You can’t perform that action at this time.
0 commit comments