Allow only package names as plugin names (#42713)

* Allow only package names as plugin names

* Remove extra argument following merge from master branch.

* kipped -> Skipped

Co-authored-by: Sheetal Nandi <shkamat@microsoft.com>
This commit is contained in:
Daniel Rosenwasser
2021-02-09 11:30:09 -08:00
committed by GitHub
parent fe2899c2ac
commit 664ed17ebd
3 changed files with 55 additions and 0 deletions

View File

@@ -1581,6 +1581,10 @@ namespace ts.server {
protected enablePlugin(pluginConfigEntry: PluginImport, searchPaths: string[], pluginConfigOverrides: Map<any> | undefined) {
this.projectService.logger.info(`Enabling plugin ${pluginConfigEntry.name} from candidate paths: ${searchPaths.join(",")}`);
if (parsePackageName(pluginConfigEntry.name).rest) {
this.projectService.logger.info(`Skipped loading plugin ${pluginConfigEntry.name} because only package name is allowed plugin name`);
return;
}
const log = (message: string) => this.projectService.logger.info(message);
let errorLogs: string[] | undefined;