Uh oh!
There was an error while loading. Please reload this page.
Checkjs implies allowjs - #40275
Conversation
Even if you have `"allowJs": false`. This is not a useful combination. Changing this makes the compiler more friendly and easier to describe.
Daniel Rosenwasser (@DanielRosenwasser)Ryan Cavanaugh (@RyanCavanaugh)Orta Therox (@orta) Do you think the new behaviour is reasonable? Sheetal Nandi (@sheetalkamat)Wesley Wigham (@weswigham) Is |
Wesley Wigham (weswigham)
commented
Aug 26, 2020
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 |
| } | ||
| if (options.checkJs && !options.allowJs) { | ||
| if (options.checkJs && !getAllowJSCompilerOption(options)) { |
There was a problem hiding this comment.
This seems incorrect condition. You want to check if options.allowJs === false here instead
There was a problem hiding this comment.
Duh, thanks for the catch.
There was a problem hiding this comment.
No, wait, that undoes the loosening from this PR. THe current code only errors when checkJs: true but allowJs: false explicitly.
There was a problem hiding this comment.
| if(options.checkJs&&!getAllowJSCompilerOption(options)){ | |
| if(options.checkJs&&options.allowJs===false){ |
will also work and won’t require a function call.
I'm not so sure how I feel about this. But I can't think of any reason why it's bad. |
Nathan Shively-Sanders (sandersn)
commented
Sep 1, 2020
Chatted with Ryan Cavanaugh (@RyanCavanaugh), he couldn't either. He also pointed out that maybe allowJs should default to true now. I'll investigate that next. |
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.