mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-15 04:43:37 -05:00
Fix parsing of globalPlugins and pluginProbeLocations: Don't include empty string (#17143)
This commit is contained in:
@@ -760,8 +760,16 @@ namespace ts.server {
|
||||
const typingSafeListLocation = findArgument(Arguments.TypingSafeListLocation);
|
||||
const npmLocation = findArgument(Arguments.NpmLocation);
|
||||
|
||||
const globalPlugins = (findArgument("--globalPlugins") || "").split(",");
|
||||
const pluginProbeLocations = (findArgument("--pluginProbeLocations") || "").split(",");
|
||||
function parseStringArray(argName: string): string[] {
|
||||
const arg = findArgument(argName);
|
||||
if (arg === undefined) {
|
||||
return emptyArray as string[]; // TODO: https://github.com/Microsoft/TypeScript/issues/16312
|
||||
}
|
||||
return arg.split(",").filter(name => name !== "");
|
||||
}
|
||||
|
||||
const globalPlugins = parseStringArray("--globalPlugins");
|
||||
const pluginProbeLocations = parseStringArray("--pluginProbeLocations");
|
||||
const allowLocalPluginLoads = hasArgument("--allowLocalPluginLoads");
|
||||
|
||||
const useSingleInferredProject = hasArgument("--useSingleInferredProject");
|
||||
|
||||
Reference in New Issue
Block a user