mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-15 11:35:42 -06:00
fix falling tests and linter issues
(cherry picked from commit 7404b901b962d0673b7d4522cd961c3dd8859e9b)
This commit is contained in:
parent
dd5dc3a967
commit
7d2ce0f5c1
@ -554,14 +554,14 @@ namespace ts {
|
||||
const filesSeen: Map<boolean> = {};
|
||||
|
||||
let exclude: string[] = [];
|
||||
if(json["exclude"] instanceof Array){
|
||||
if (json["exclude"] instanceof Array) {
|
||||
exclude = json["exclude"];
|
||||
}
|
||||
else {
|
||||
// by default exclude node_modules, and any specificied output directory
|
||||
exclude = ["node_modules"]
|
||||
let outDir = json["compilerOptions"] && json["compilerOptions"]["outDir"];
|
||||
if(outDir) {
|
||||
exclude = ["node_modules"];
|
||||
const outDir = json["compilerOptions"] && json["compilerOptions"]["outDir"];
|
||||
if (outDir) {
|
||||
exclude.push(outDir);
|
||||
}
|
||||
}
|
||||
|
||||
@ -7,10 +7,16 @@ module ts {
|
||||
}
|
||||
|
||||
function createDefaultServerHost(fileMap: Map<File>): server.ServerHost {
|
||||
const directories: Map<string> = {};
|
||||
for (const f in fileMap) {
|
||||
directories[getDirectoryPath(f)] = f;
|
||||
}
|
||||
let existingDirectories: Map<boolean> = {};
|
||||
forEachValue(fileMap, v => {
|
||||
let dir = getDirectoryPath(v.name);
|
||||
let previous: string;
|
||||
do {
|
||||
existingDirectories[dir] = true;
|
||||
previous = dir;
|
||||
dir = getDirectoryPath(dir);
|
||||
} while (dir !== previous);
|
||||
});
|
||||
return {
|
||||
args: <string[]>[],
|
||||
newLine: "\r\n",
|
||||
@ -30,7 +36,7 @@ module ts {
|
||||
return hasProperty(fileMap, path);
|
||||
},
|
||||
directoryExists: (path: string): boolean => {
|
||||
return hasProperty(directories, path);
|
||||
return hasProperty(existingDirectories, path);
|
||||
},
|
||||
createDirectory: (path: string) => {
|
||||
},
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user