`allowJs` compiler option doesn't document its conditional default behavior
Closed this issue ยท 1 comments
manbearwiz commented
๐ Search Terms
allowJs, checkJs, default value, help
๐ Version & Regression Information
- The default value changed in this PR, without corresponding documentation changes.
โฏ Playground Link
No response
๐ป Code
No response
๐ Actual behavior
tsc just states that the default is false
$ tsc --help --all | grep -A3 "allowJs"
--allowJs
Allow JavaScript files to be a part of your program. Use the 'checkJs' option to get errors from these files.
type: boolean
default: false๐ Expected behavior
tsc correctly states that is is conditional
$ tsc --help --all | grep -A3 "allowJs"
--allowJs
Allow JavaScript files to be a part of your program. Use the 'checkJs' option to get errors from these files.
type: boolean
default: `false`, unless `checkJs` is setAdditional information about the issue
Similar conditional defaults are already documented for other options:
% tsc --help --all | grep -A3 "noImplicitAny"
--noImplicitAny
Enable error reporting for expressions and declarations with an implied 'any' type.
type: boolean
default: `false`, unless `strict` is set% tsc --help --all | grep -A3 "\-\-declaration"
--declaration, -d
Generate .d.ts files from TypeScript and JavaScript files in your project.
type: boolean
default: `false`, unless `composite` is setI've seen some confusion around this, most recently in @tsconfig/strictest, where they set checkJs: true and allowJs: undefined with the intention of not allowing js unless explicitly set by extending configs (tsconfig/bases#88).
I opened #62611 to update the default value description to fix this
jakebailey commented
Fixed by #62611