Skip to content

Commit

Permalink
Add new constructor without optional dependency (#3974)
Browse files Browse the repository at this point in the history
  • Loading branch information
victor-diez-sonarsource committed Jun 13, 2023
1 parent dc9dcc3 commit f95f3d1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -516,10 +516,10 @@ private JsTsSensor createSensor(SensorContext ctx) {
eslintBridgeServerMock,
analysisWarnings,
monitoring,
processAnalysis,
ctx.runtime().getProduct() == SonarProduct.SONARLINT
? new SonarLintJavaScriptProjectChecker()
: null,
processAnalysis
: null
);
}

Expand Down

0 comments on commit f95f3d1

Please sign in to comment.