Skip to content

Commit c248b7e

Browse files
author
Ye Zhu
committed
Fix tslint errors
1 parent 44b2781 commit c248b7e

File tree

3 files changed

+8
-10
lines changed

3 files changed

+8
-10
lines changed

src/upgrade/assessmentManager.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
import * as fs from 'fs';
55
import * as semver from 'semver';
6-
import {globby} from 'globby';
6+
import { globby } from 'globby';
77

88
import { Uri } from 'vscode';
99
import { Jdtls } from "../java/jdtls";
@@ -148,7 +148,7 @@ async function getDependencyIssues(dependencies: PackageDescription[]): Promise<
148148
return issues;
149149
}
150150

151-
async function getWorkspaceIssues(projectDeps:{projectNode: INodeData, dependencies: PackageDescription[]}[]): Promise<UpgradeIssue[]> {
151+
async function getWorkspaceIssues(projectDeps: {projectNode: INodeData, dependencies: PackageDescription[]}[]): Promise<UpgradeIssue[]> {
152152

153153
const issues: UpgradeIssue[] = [];
154154
const dependencyMap: Map<string, PackageDescription> = new Map();
@@ -186,7 +186,7 @@ async function findAllPomFiles(dir: string): Promise<string[]> {
186186
* Parse dependencies from a single pom.xml file
187187
*/
188188
function parseDependenciesFromSinglePom(pomPath: string): Set<string> {
189-
//TODO : Use a proper XML parser if needed
189+
// TODO : Use a proper XML parser if needed
190190
const directDeps = new Set<string>();
191191
try {
192192
const pomContent = fs.readFileSync(pomPath, 'utf-8');
@@ -371,7 +371,7 @@ export async function getDirectDependencies(projectNode: INodeData): Promise<Pac
371371
sendInfo("", {
372372
operationName: "java.dependency.assessmentManager.getDirectDependencies.noDirectDependencyInfo"
373373
});
374-
//TODO: fallback to return all dependencies if we cannot parse direct dependencies or just return empty?
374+
// TODO: fallback to return all dependencies if we cannot parse direct dependencies or just return empty?
375375
return dependencies;
376376
}
377377
// Filter to only direct dependencies if we have build file info

src/upgrade/display/notificationManager.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class NotificationManager implements IUpgradeIssuesRenderer {
6565
const prompt = buildFixPrompt(issue);
6666

6767
let notificationMessage = "";
68-
68+
6969
if (hasCVEIssue) {
7070
notificationMessage = buildCVENotificationMessage(cveIssues, hasExtension);
7171
} else {

src/upgrade/upgradeManager.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,9 @@ class UpgradeManager {
7474
}))
7575
);
7676

77-
const allProjectDirectDeps = projectDirectDepsResults
78-
.filter((result): result is PromiseFulfilledResult<{ projectNode: typeof projects[0]; dependencies: Awaited<ReturnType<typeof getDirectDependencies>> }> =>
79-
result.status === "fulfilled"
80-
)
81-
.map((result) => result.value);
77+
const allProjectDirectDeps = projectDirectDepsResults.flatMap(result =>
78+
result.status === "fulfilled" ? [result.value] : []
79+
);
8280

8381
if (allProjectDirectDeps.every((x) => x.dependencies.length === 0)) {
8482
sendInfo(_operationId, { skipReason: "notMavenGradleProject" });

0 commit comments

Comments
 (0)