-
Notifications
You must be signed in to change notification settings - Fork 12.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Report positionless tsconfig option errors on compilerOptions
key
#58254
Report positionless tsconfig option errors on compilerOptions
key
#58254
Conversation
"compilerOptions": { | ||
~~~~~~~~~~~~~~~~~ | ||
!!! error TS5095: Option 'bundler' can only be used when 'module' is set to 'preserve' or to 'es2015' or later. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that this test is simulating a combination of tsconfig options and CLI flags. This would have been reported on "moduleResolution": "bundler"
if it were in the tsconfig, but it was passed in as a flag instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ohh
Any program error that is talking about a compiler option but can’t find an option name/value to report the error on now reports the error on the
compilerOptions
key (if present) instead of positionlessly in the file. I noticed while investigating #58214 that these positionless errors are very easy to miss in the editor.Before:
After:
A common one that’s still positionless is “Cannot write file 'foo.js' because it would overwrite input file.” We could consider moving that to
compilerOptions
too since the correct fix is to add eitheroutDir
ornoEmit
99% of the time, along with suggesting that in the error message. Anyone have opinions on that?