Typescript: Unknown compiler option 'exclude'

Created on 26 May 2017  ·  4Comments  ·  Source: microsoft/TypeScript



TypeScript Version: 2.2.3

Code

$ tsc
// tsconfig.json
{
  "compilerOptions": {
    "declaration": true,
    "target": "es5",
    "module": "commonjs",
    "moduleResolution": "node",
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "removeComments": false,
    "noImplicitAny": false,
    "outDir": "dist",
    "typeRoots": [
      "./node_modules/@types/"
    ],
    "exclude": [
      "dist"
    ]
  }
}

Expected behavior:
Exclude the list of paths given.

Actual behavior:
Throws error: error TS5023: Unknown compiler option 'exclude'

Last Note
This also occurs when using the options include or files. Were these options depreciated in a recent update to typescript? I can't find any documentation to suggest this...

Question

Most helpful comment

Actually, files, include, etc. are top level fields

{
  "compilerOptions": {},
  "exclude": []
}

All 4 comments

Actually, files, include, etc. are top level fields

{
  "compilerOptions": {},
  "exclude": []
}

@ikatyang thanks - can't believe I missed that 🙄

{
"compilerOptions": {
"declaration": true,
"target": "es5",
"module": "commonjs",
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"removeComments": false,
"noImplicitAny": false,
"outDir": "dist",
"typeRoots": [
"./node_modules/@types/"
]
},
"exclude": [
"dist"
]
}

Was this page helpful?
0 / 5 - 0 ratings

Related issues

siddjain picture siddjain  ·  3Comments

Antony-Jones picture Antony-Jones  ·  3Comments

weswigham picture weswigham  ·  3Comments

remojansen picture remojansen  ·  3Comments

dlaberge picture dlaberge  ·  3Comments