Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upCheckjs implies allowjs #40275
Checkjs implies allowjs #40275
Conversation
|
@DanielRosenwasser @RyanCavanaugh @orta Do you think the new behaviour is reasonable? @sheetalkamat @weswigham Is |
|
For other defaulted flags dependent on other flags, we have something like a |
|
I thought that might be the case. I switched to an accessor function |
| @@ -3160,7 +3160,7 @@ namespace ts { | |||
| createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_when_option_target_is_ES3, "useDefineForClassFields"); | |||
| } | |||
|
|
|||
| if (options.checkJs && !options.allowJs) { | |||
| if (options.checkJs && !getAllowJSCompilerOption(options)) { | |||
This comment has been minimized.
This comment has been minimized.
sheetalkamat
Aug 27, 2020
Member
This seems incorrect condition. You want to check if options.allowJs === false here instead
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
sandersn
Sep 1, 2020
Author
Member
No, wait, that undoes the loosening from this PR. THe current code only errors when checkJs: true but allowJs: false explicitly.
|
I'm not so sure how I feel about this. But I can't think of any reason why it's bad. |
|
Chatted with @RyanCavanaugh, he couldn't either. He also pointed out that maybe allowJs should default to true now. I'll investigate that next. |
sandersn commentedAug 26, 2020
If it's not explicitly provided.
Note that it's still an error to explicitly provide
checkJs: true, allowJs: false.This change makes the compiler options easier to use and to describe.