diff --git a/sonar-plugin/sonar-javascript-plugin/src/main/java/org/sonar/plugins/javascript/eslint/JsTsSensor.java b/sonar-plugin/sonar-javascript-plugin/src/main/java/org/sonar/plugins/javascript/eslint/JsTsSensor.java index 02252cde836..cff22014686 100644 --- a/sonar-plugin/sonar-javascript-plugin/src/main/java/org/sonar/plugins/javascript/eslint/JsTsSensor.java +++ b/sonar-plugin/sonar-javascript-plugin/src/main/java/org/sonar/plugins/javascript/eslint/JsTsSensor.java @@ -51,13 +51,24 @@ public class JsTsSensor extends AbstractEslintSensor { private boolean createWildcardTSConfig = false; private boolean createProgram = true; + // Constructor for SonarCloud without the optional dependency (Pico doesn't support optional dependencies) public JsTsSensor( JsTsChecks checks, EslintBridgeServer eslintBridgeServer, AnalysisWarningsWrapper analysisWarnings, Monitoring monitoring, - @Nullable JavaScriptProjectChecker javaScriptProjectChecker, AnalysisProcessor analysisProcessor + ) { + this(checks, eslintBridgeServer, analysisWarnings, monitoring, analysisProcessor, null); + } + + public JsTsSensor( + JsTsChecks checks, + EslintBridgeServer eslintBridgeServer, + AnalysisWarningsWrapper analysisWarnings, + Monitoring monitoring, + AnalysisProcessor analysisProcessor, + @Nullable JavaScriptProjectChecker javaScriptProjectChecker ) { super(eslintBridgeServer, analysisWarnings, monitoring); this.checks = checks; diff --git a/sonar-plugin/sonar-javascript-plugin/src/test/java/org/sonar/plugins/javascript/eslint/JsTsSensorTest.java b/sonar-plugin/sonar-javascript-plugin/src/test/java/org/sonar/plugins/javascript/eslint/JsTsSensorTest.java index 4adc5678420..33057ec52bf 100644 --- a/sonar-plugin/sonar-javascript-plugin/src/test/java/org/sonar/plugins/javascript/eslint/JsTsSensorTest.java +++ b/sonar-plugin/sonar-javascript-plugin/src/test/java/org/sonar/plugins/javascript/eslint/JsTsSensorTest.java @@ -516,10 +516,10 @@ private JsTsSensor createSensor(SensorContext ctx) { eslintBridgeServerMock, analysisWarnings, monitoring, + processAnalysis, ctx.runtime().getProduct() == SonarProduct.SONARLINT ? new SonarLintJavaScriptProjectChecker() - : null, - processAnalysis + : null ); }