Skip to content

Allow plugins to be loaded from package subpaths - #57266

Merged
Sheetal Nandi (sheetalkamat) merged 7 commits into
microsoft:mainfrom
kitten:fix/allow-plugins-in-package-subpath
Feb 21, 2024
Merged

Allow plugins to be loaded from package subpaths#57266
Sheetal Nandi (sheetalkamat) merged 7 commits into
microsoft:mainfrom
kitten:fix/allow-plugins-in-package-subpath

Conversation

@kitten

@kittenPhil Pluckthun (kitten) commented Feb 1, 2024

Copy link
Copy Markdown
Contributor

Fixes#57047

When merged, this allows plugins to also be loaded from package subpaths.

Before, tsconfig.json:compilerOptions.plugins[] would:

  • reject package-plugin/sub/path
  • reject @package-plugin/subpath
  • load .. and .

After, tsconfig.json:compilerOptions.plugins[] will:

  • load package-plugin/sub/path
  • load @package-plugin/subpath
  • reject @package-plugin/subpath/../../malicious
  • reject plugin/subpath/../../malicious
  • reject .. and .

I noticed while looking at the tests that . and .. are accepted plugin names, which is likely unintentional.

@typescript-botTypeScript Bot (typescript-bot) added the For Backlog Bug PRs that fix a backlog bug label Feb 1, 2024
@kitten

This comment was marked as resolved.

Comment threadsrc/compiler/moduleNameResolver.ts Outdated
Comment threadsrc/server/editorServices.ts
Co-authored-by: Sheetal Nandi <sheetalkamat@users.noreply.github.com>
@kitten
Phil Pluckthun (kitten)force-pushed the fix/allow-plugins-in-package-subpath branch from 30341f7 to 14324edCompareFebruary 21, 2024 06:42
@kitten

Copy link
Copy Markdown
ContributorAuthor

Sheetal Nandi (@sheetalkamat) That's all applied and test cases are looking good and pass 👍 Sorry for the delay!

Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

For Backlog BugPRs that fix a backlog bug

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

TSServer Plugins with sub-packages/paths are not loaded

5 participants

@kitten@sheetalkamat@sandersn@DanielRosenwasser@typescript-bot