Typescript: Opsi penyusun tidak dikenal 'kecualikan'

Dibuat pada 26 Mei 2017  ·  4Komentar  ·  Sumber: microsoft/TypeScript



TypeScript Version: 2.2.3

Kode

$ 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"
    ]
  }
}

Perilaku yang diharapkan:
Kecualikan daftar jalur yang diberikan.

Perilaku sebenarnya:
Kesalahan lemparan: error TS5023: Unknown compiler option 'exclude'

Catatan Terakhir
Ini juga terjadi saat menggunakan opsi include atau files . Apakah opsi ini disusutkan dalam pembaruan terkini untuk skrip ketikan? Saya tidak dapat menemukan dokumentasi apa pun yang menyarankan ini ...

Question

Komentar yang paling membantu

Sebenarnya, files , include , dll. Adalah bidang tingkat atas

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

Semua 4 komentar

Sebenarnya, files , include , dll. Adalah bidang tingkat atas

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

@ikatyang terima kasih - tidak percaya saya melewatkan itu 🙄

{
"compilerOptions": {
"deklarasi": benar,
"target": "es5",
"module": "commonjs",
"moduleResolution": "node",
"emitDecoratorMetadata": benar,
"eksperimentalDecorators": benar,
"removeComments": salah,
"noImplicitAny": false,
"outDir": "dist",
"typeRoots": [
"./node_modules/@types/"
]
},
"exclude": [
"dist"
]
}

Apakah halaman ini membantu?
0 / 5 - 0 peringkat