mirror of
https://github.com/github/codeql.git
synced 2026-05-02 04:05:14 +02:00
TS: Other review comments
This commit is contained in:
@@ -318,7 +318,7 @@ function handleOpenProjectCommand(command: OpenProjectCommand) {
|
||||
console.warn('TypeScript: reported ' + diagnostics.length + ' semantic errors.');
|
||||
for (let diagnostic of diagnostics) {
|
||||
let text = diagnostic.messageText;
|
||||
if (typeof text !== 'string') {
|
||||
if (text && typeof text !== 'string') {
|
||||
text = text.messageText;
|
||||
}
|
||||
let locationStr = '';
|
||||
|
||||
@@ -2,7 +2,8 @@ import * as pathlib from "path";
|
||||
import * as ts from "./typescript";
|
||||
|
||||
/**
|
||||
* Mapping from the source root to the virtual source root.
|
||||
* Mapping from the real source root to the virtual source root,
|
||||
* a directory whose folder structure mirrors the real source root, but with `node_modules` installed.
|
||||
*/
|
||||
export class VirtualSourceRoot {
|
||||
constructor(
|
||||
|
||||
@@ -709,12 +709,12 @@ public class AutoBuild {
|
||||
propsToRemove.add(packageName);
|
||||
} else {
|
||||
// Remove file dependency on a package that don't exist in the checkout.
|
||||
String dependecy = getChildAsString(dependencyObj, packageName);
|
||||
if (dependecy != null && (dependecy.startsWith("file:") || dependecy.startsWith("./") || dependecy.startsWith("../"))) {
|
||||
if (dependecy.startsWith("file:")) {
|
||||
dependecy = dependecy.substring("file:".length());
|
||||
String dependency = getChildAsString(dependencyObj, packageName);
|
||||
if (dependency != null && (dependency.startsWith("file:") || dependency.startsWith("./") || dependency.startsWith("../"))) {
|
||||
if (dependency.startsWith("file:")) {
|
||||
dependency = dependency.substring("file:".length());
|
||||
}
|
||||
Path resolvedPackage = path.getParent().resolve(dependecy + "/package.json");
|
||||
Path resolvedPackage = path.getParent().resolve(dependency + "/package.json");
|
||||
if (!Files.exists(resolvedPackage)) {
|
||||
propsToRemove.add(packageName);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user