From aa09234d3a1a1cb9db1c8f0e5d5cc535488f2027 Mon Sep 17 00:00:00 2001 From: Tibor Blenessy Date: Thu, 30 Jul 2020 21:31:08 +0200 Subject: [PATCH] fix supported TS version --- eslint-bridge/src/parser.ts | 3 ++- eslint-bridge/tests/parser.test.ts | 2 +- .../com/sonar/javascript/it/plugin/TypeScriptAnalysisTest.java | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/eslint-bridge/src/parser.ts b/eslint-bridge/src/parser.ts index 397adc7225a..efbd6379538 100644 --- a/eslint-bridge/src/parser.ts +++ b/eslint-bridge/src/parser.ts @@ -28,7 +28,8 @@ import * as semver from 'semver'; // still we might consider extending this range // if everything which we need is working on older/newer versions const TYPESCRIPT_MINIMUM_VERSION = '3.3.1'; -const TYPESCRIPT_MAXIMUM_VERSION = '4.0.0'; +// next released version is 4.0.0, we need version which is above current 3.9.x and below 4.0.0 +const TYPESCRIPT_MAXIMUM_VERSION = '3.10.0'; export const PARSER_CONFIG_MODULE: Linter.ParserOptions = { tokens: true, diff --git a/eslint-bridge/tests/parser.test.ts b/eslint-bridge/tests/parser.test.ts index 4329d0fcbaf..10a1b44aff4 100644 --- a/eslint-bridge/tests/parser.test.ts +++ b/eslint-bridge/tests/parser.test.ts @@ -196,7 +196,7 @@ describe('parseTypeScriptSourceFile', () => { resetReportedNewerTypeScriptVersion(); checkTypeScriptVersionCompatibility('5.0.0'); expect(console.log).toHaveBeenCalledWith( - 'WARN You are using version of TypeScript 5.0.0 which is not officially supported; supported versions >=3.3.1 <4.0.0', + 'WARN You are using version of TypeScript 5.0.0 which is not officially supported; supported versions >=3.3.1 <3.10.0', ); console.log = jest.fn(); checkTypeScriptVersionCompatibility('5.0.0'); diff --git a/its/plugin/tests/src/test/java/com/sonar/javascript/it/plugin/TypeScriptAnalysisTest.java b/its/plugin/tests/src/test/java/com/sonar/javascript/it/plugin/TypeScriptAnalysisTest.java index 9783b4e3c25..25f62d1cfcb 100644 --- a/its/plugin/tests/src/test/java/com/sonar/javascript/it/plugin/TypeScriptAnalysisTest.java +++ b/its/plugin/tests/src/test/java/com/sonar/javascript/it/plugin/TypeScriptAnalysisTest.java @@ -164,7 +164,7 @@ public void test_new_typescript() throws Exception { Tests.setProfile(projectKey, "eslint-based-rules-profile", "ts"); BuildResult result = orchestrator.executeBuild(build); assertThat(result.isSuccess()).isTrue(); - assertThat(result.getLogsLines(l -> l.contains("You are using version of TypeScript " + tsVersion + " which is not officially supported; supported versions >=3.3.1 <4.0.0"))).hasSize(1); + assertThat(result.getLogsLines(l -> l.contains("You are using version of TypeScript " + tsVersion + " which is not officially supported; supported versions >=3.3.1 <3.10.0"))).hasSize(1); } @Test