Skip to content

Commit d9b7258

Browse files
committed
Only run tests using typescript-eslint-parser on eslint@<6
1 parent c2b19d0 commit d9b7258

File tree

4 files changed

+15
-4
lines changed

4 files changed

+15
-4
lines changed

tests/src/core/getExports.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -336,13 +336,16 @@ describe('ExportMap', function () {
336336

337337
const configs = [
338338
// ['string form', { 'typescript-eslint-parser': '.ts' }],
339-
['array form', { 'typescript-eslint-parser': ['.ts', '.tsx'] }],
340339
]
341340

342341
if (semver.satisfies(eslintPkg.version, '>5.0.0')) {
343342
configs.push(['array form', { '@typescript-eslint/parser': ['.ts', '.tsx'] }])
344343
}
345344

345+
if (semver.satisfies(eslintPkg.version, '<6.0.0')) {
346+
configs.push(['array form', { 'typescript-eslint-parser': ['.ts', '.tsx'] }])
347+
}
348+
346349
configs.forEach(([description, parserConfig]) => {
347350

348351
describe(description, function () {

tests/src/rules/export.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -112,12 +112,16 @@ ruleTester.run('export', rule, {
112112

113113
context('Typescript', function () {
114114
// Typescript
115-
const parsers = [require.resolve('typescript-eslint-parser')]
115+
const parsers = []
116116

117117
if (semver.satisfies(eslintPkg.version, '>5.0.0')) {
118118
parsers.push(require.resolve('@typescript-eslint/parser'))
119119
}
120120

121+
if (semver.satisfies(eslintPkg.version, '<6.0.0')) {
122+
parsers.push(require.resolve('typescript-eslint-parser'))
123+
}
124+
121125
parsers.forEach((parser) => {
122126
const parserConfig = {
123127
parser: parser,

tests/src/rules/named.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -286,12 +286,16 @@ ruleTester.run('named (export *)', rule, {
286286

287287
context('Typescript', function () {
288288
// Typescript
289-
const parsers = [require.resolve('typescript-eslint-parser')]
289+
const parsers = []
290290

291291
if (semver.satisfies(eslintPkg.version, '>5.0.0')) {
292292
parsers.push(require.resolve('@typescript-eslint/parser'))
293293
}
294294

295+
if (semver.satisfies(eslintPkg.version, '<6.0.0')) {
296+
parsers.push(require.resolve('typescript-eslint-parser'))
297+
}
298+
295299
parsers.forEach((parser) => {
296300
['typescript', 'typescript-declare', 'typescript-export-assign'].forEach((source) => {
297301
ruleTester.run(`named`, rule, {

tests/src/rules/order.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1373,7 +1373,7 @@ ruleTester.run('order', rule, {
13731373
}],
13741374
})),
13751375
// fix incorrect order with typescript-eslint-parser
1376-
test({
1376+
testVersion('<6.0.0', {
13771377
code: `
13781378
var async = require('async');
13791379
var fs = require('fs');

0 commit comments

Comments
 (0)