Typescript: Missing support for `allowJS` in `tsconfig.json`

Created on 29 Jan 2016  路  11Comments  路  Source: microsoft/TypeScript

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.

Bug

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.

All 11 comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rwyborn picture rwyborn  路  210Comments

rbuckton picture rbuckton  路  139Comments

nitzantomer picture nitzantomer  路  135Comments

tenry92 picture tenry92  路  146Comments

Gaelan picture Gaelan  路  231Comments