From b70cbaa914798c13445dc67333bbc2f0f5a03b40 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Thu, 5 Sep 2024 00:14:04 +0200 Subject: [PATCH] [Tests] disable non-functioning tests --- tests/src/rules/order.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/src/rules/order.js b/tests/src/rules/order.js index d703110f4..561104658 100644 --- a/tests/src/rules/order.js +++ b/tests/src/rules/order.js @@ -3043,6 +3043,9 @@ context('TypeScript', function () { // Type-only imports were added in TypeScript ESTree 2.23.0 .filter((parser) => parser !== parsers.TS_OLD) .forEach((parser) => { + const supportsTypeSpecifiers = semver.satisfies(require('@typescript-eslint/parser/package.json').version, '>= 4'); + const supportsImportTypeSpecifiers = parser !== parsers.TS_NEW || supportsTypeSpecifiers; + const supportsExportTypeSpecifiers = parser === parsers.TS_NEW && supportsTypeSpecifiers; const parserConfig = { parser, settings: { @@ -3527,7 +3530,7 @@ context('TypeScript', function () { alphabetize: { order: 'asc' }, }], errors: [ - { message: '`A` import should occur before type import of `Z`' }, + { message: `\`A\` import should occur before${supportsImportTypeSpecifiers ? ' type' : ''} import of \`Z\`` }, { message: '`D` import should occur before import of `E`' }, { message: '`G` import should occur before import of `L`' }, ], @@ -3553,7 +3556,7 @@ context('TypeScript', function () { }], }), - parser !== parsers.BABEL_OLD ? [ + supportsExportTypeSpecifiers ? [ test({ code: ` export { type B, A };