I am using Typescript 1.8.0 (installed via npm install [email protected]), and using the following tsconfig.json:
{
"compilerOptions": {
"target": "es5",
"sourceMap": true,
"allowJS": true
}
}
Running ./node_modules/bin/tsc fails with the following message:
error TS5023: Unknown compiler option 'allowJS'.
Whereas running ./node_modules/bin/tsc --allowJS seems to be ok.
It's allowJs, lowercase "S".
I've filed this related bug about the docs and the JS schema not matching:
https://github.com/Microsoft/TypeScript/issues/6490
I think the best solution is to always enforce one casing of compiler flags and disallow the others. It's really confusing otherwise.
Making the command-line args case sensitive is really user-hostile.
The JSON should match the schema, but there's no reason we shouldn't give you a suggestion (Unknown compiler option 'allowJS'. Did you mean 'allowJs' ?) when there's a case sensitivity mismatch.
Ah yes, that seems to be it. I just assumed that the command line arg name would be the same as the tsconfig.json arg name.
If the CLI is case-insentive though, I see no reason to not document it with the correct case sensitivity for the config file though.
I just assumed that the command line arg name would be the same as the tsconfig.json arg name.
It does.
Options:
--allowJs Allow javascript files to be compiled.
Oh I was following the instructions in the What's new page and they show it as --allowJS.
Where is that list you showed?
Fixed the wiki page (thanks!). The list there is what you see when you run tsc without any args (or --help).
Cheers! :+1:
Was it this one? I don't see it there but maybe it's a cache thing.
https://github.com/Microsoft/TypeScript/wiki/Compiler-Options
EDIT: ah no, the one I linked. Got it!
looks like this issue is already addressed. closing.
The migrating from Javascript doc still shows the incorrect spelling "allowJS".
There is a pull request up that seems to fix it on the handbook repo. https://github.com/Microsoft/TypeScript-Handbook/pull/393
should be updated now on the live site.
Most helpful comment
Making the command-line args case sensitive is really user-hostile.
The JSON should match the schema, but there's no reason we shouldn't give you a suggestion (
Unknown compiler option 'allowJS'. Did you mean 'allowJs' ?) when there's a case sensitivity mismatch.