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