diff --git a/.cirrus/nodejs.Dockerfile b/.cirrus/nodejs.Dockerfile index 3d4de748acc..16c08fac9e9 100644 --- a/.cirrus/nodejs.Dockerfile +++ b/.cirrus/nodejs.Dockerfile @@ -3,7 +3,7 @@ FROM ${CIRRUS_AWS_ACCOUNT}.dkr.ecr.eu-central-1.amazonaws.com/base:j17-latest USER root -ARG NODE_VERSION=16 +ARG NODE_VERSION=18 RUN curl -fsSL https://deb.nodesource.com/setup_${NODE_VERSION}.x | bash - \ && apt-get install -y nodejs=${NODE_VERSION}.* \ diff --git a/sonar-plugin/sonar-javascript-plugin/pom.xml b/sonar-plugin/sonar-javascript-plugin/pom.xml index f16fe121820..9c30034e0fd 100644 --- a/sonar-plugin/sonar-javascript-plugin/pom.xml +++ b/sonar-plugin/sonar-javascript-plugin/pom.xml @@ -312,7 +312,7 @@ ${project.version} - 16.0.0 + 18.18.0 diff --git a/sonar-plugin/sonar-javascript-plugin/src/main/java/org/sonar/plugins/javascript/bridge/NodeDeprecationWarning.java b/sonar-plugin/sonar-javascript-plugin/src/main/java/org/sonar/plugins/javascript/bridge/NodeDeprecationWarning.java index ded2acde4b2..4b3e494dfe5 100644 --- a/sonar-plugin/sonar-javascript-plugin/src/main/java/org/sonar/plugins/javascript/bridge/NodeDeprecationWarning.java +++ b/sonar-plugin/sonar-javascript-plugin/src/main/java/org/sonar/plugins/javascript/bridge/NodeDeprecationWarning.java @@ -32,11 +32,10 @@ /** * Currently supported versions ('supported' means that we execute the analysis): - * 14 - deprecated (support will be removed not earlier than April 1, 2023) - * 15 - deprecated (support will be removed not earlier than April 1, 2023), not recommended - * 16 - nothing to warn, recommended version - * 17 - not recommended * 18 - nothing to warn, recommended version + * 19 - not recommended + * 20 - nothing to warn, recommended version + * 21 - nothing to warn, recommended version */ @ScannerSide @SonarLintSide(lifespan = SonarLintSide.MULTIPLE_ANALYSES) @@ -54,10 +53,10 @@ public class NodeDeprecationWarning { * The minor version is a requirement from the ESLint version that the bridge uses. * @see https://github.com/eslint/eslint/blob/d75d3c68ad8c98828aaa522b87ec267ab2dcb002/package.json#L169 */ - static final Version MIN_SUPPORTED_NODE_VERSION = Version.create(16, 0, 0); + static final Version MIN_SUPPORTED_NODE_VERSION = Version.create(18, 18, 0); static final int MIN_RECOMMENDED_NODE_VERSION = 18; static final List RECOMMENDED_NODE_VERSIONS = Arrays.asList(18, 20); - static final List ALL_RECOMMENDED_NODE_VERSIONS = Arrays.asList(16, 18, 20); + static final List ALL_RECOMMENDED_NODE_VERSIONS = Arrays.asList(18, 20, 21); private final AnalysisWarningsWrapper analysisWarnings; public NodeDeprecationWarning(AnalysisWarningsWrapper analysisWarnings) { diff --git a/sonar-plugin/sonar-javascript-plugin/src/test/java/org/sonar/plugins/javascript/bridge/NodeDeprecationWarningTest.java b/sonar-plugin/sonar-javascript-plugin/src/test/java/org/sonar/plugins/javascript/bridge/NodeDeprecationWarningTest.java index 9d3596580b9..ed1a19e9d04 100644 --- a/sonar-plugin/sonar-javascript-plugin/src/test/java/org/sonar/plugins/javascript/bridge/NodeDeprecationWarningTest.java +++ b/sonar-plugin/sonar-javascript-plugin/src/test/java/org/sonar/plugins/javascript/bridge/NodeDeprecationWarningTest.java @@ -54,23 +54,15 @@ public void addUnique(String text) { void test_recommended() { deprecationWarning.logNodeDeprecation(18); deprecationWarning.logNodeDeprecation(20); + deprecationWarning.logNodeDeprecation(21); assertWarnings(); } @Test - void test_16() { - deprecationWarning.logNodeDeprecation(16); + void test_19() { + deprecationWarning.logNodeDeprecation(19); assertWarnings( - "Using Node.js version 16 to execute analysis is deprecated and will stop being supported no earlier than Jan 31th, 2024. Please upgrade to a newer LTS version of Node.js [18, 20]" - ); - } - - @Test - void test_17() { - deprecationWarning.logNodeDeprecation(17); - assertWarnings( - "Using Node.js version 17 to execute analysis is deprecated and will stop being supported no earlier than Jan 31th, 2024. Please upgrade to a newer LTS version of Node.js [18, 20]", - "Node.js version 17 is not recommended, you might experience issues. Please use a recommended version of Node.js [18, 20]" + "Node.js version 19 is not recommended, you might experience issues. Please use a recommended version of Node.js [18, 20]" ); }