Skip to content

fix(typescript,vueTsc): quote the project path passed to tsc - #792

Open
Artur- wants to merge 1 commit into
fi3ework:mainfrom
Artur-:directory-with-space
Open

fix(typescript,vueTsc): quote the project path passed to tsc#792
Artur- wants to merge 1 commit into
fi3ework:mainfrom
Artur-:directory-with-space

Conversation

@Artur-

@Artur- Artur- commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Checker binaries are spawned through a shell, which splits the command on whitespace. The typescript and vueTsc checkers build the project path themselves from root and tsconfigPath, so a project living under a directory with a space in its name reached tsc as two arguments and failed with "TS5042: Option 'project' cannot be mixed with source files on a command line".

Quote the constructed path, per platform, since cmd.exe understands only double quotes while POSIX shells keep expanding inside them. Arguments that come from a user supplied lintCommand are left untouched: they are already split on spaces and carry their own quoting.

The same splitting applied to the fallback that runs tsc from PATH when the TypeScript package exposes no compiler API, as with TypeScript 7, so quote those arguments as well.

Checker binaries are spawned through a shell, which splits the command
on whitespace. The typescript and vueTsc checkers build the project path
themselves from `root` and `tsconfigPath`, so a project living under a
directory with a space in its name reached tsc as two arguments and
failed with "TS5042: Option 'project' cannot be mixed with source files
on a command line".

Quote the constructed path, per platform, since cmd.exe understands only
double quotes while POSIX shells keep expanding inside them. Arguments
that come from a user supplied `lintCommand` are left untouched: they
are already split on spaces and carry their own quoting.

The same splitting applied to the fallback that runs `tsc` from PATH
when the TypeScript package exposes no compiler API, as with TypeScript
7, so quote those arguments as well.
@netlify

netlify Bot commented Aug 12, 2026

Copy link
Copy Markdown

Deploy Preview for vite-plugin-checker ready!

Name Link
🔨 Latest commit 99301a9
🔍 Latest deploy log https://app.netlify.com/projects/vite-plugin-checker/deploys/6a7c6eb9c51bb700084be677
😎 Deploy Preview https://deploy-preview-792--vite-plugin-checker.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@pkg-pr-new

pkg-pr-new Bot commented Aug 12, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/vite-plugin-checker@792

commit: 99301a9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant