Skip to content

Commit

Permalink
Add comment and fix sq
Browse files Browse the repository at this point in the history
  • Loading branch information
zglicz committed Dec 12, 2024
1 parent a41db43 commit 7a50945
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 5 additions & 0 deletions packages/jsts/src/rules/helpers/package-json.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ type Dependency = MinimatchDependency | NamedDependency;
*/
const cache: Map<string, Set<Dependency>> = new Map();

/**
* Returns the dependencies of the root package.json file collected in the cache.
* As the cache is populated lazily, it could be null in case no rule execution has touched it.
* This removes duplicate dependencies and keeps the last occurrence.
*/
export function getAllDependencies(): NamedDependency[] {
const dependencies = [...cache.values()]
.flatMap(dependencies => [...dependencies])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
import org.sonar.plugins.javascript.analysis.HtmlSensor;
import org.sonar.plugins.javascript.analysis.JsTsChecks;
import org.sonar.plugins.javascript.analysis.JsTsSensor;
import org.sonar.plugins.javascript.analysis.PluginTelemetry;
import org.sonar.plugins.javascript.analysis.TsConfigProvider;
import org.sonar.plugins.javascript.analysis.YamlSensor;
import org.sonar.plugins.javascript.bridge.AnalysisWarningsWrapper;
Expand Down

0 comments on commit 7a50945

Please sign in to comment.