إصدار TypeScript: 2.2.3
الشفرة
$ 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"
]
}
}
سلوك متوقع:
استبعاد قائمة المسارات المعطاة.
السلوك الفعلي:
يلقي الخطأ: error TS5023: Unknown compiler option 'exclude'
آخر ملاحظة
يحدث هذا أيضًا عند استخدام الخيارات include
أو files
. هل تم إهمال هذه الخيارات في تحديث حديث للطباعة؟ لا يمكنني العثور على أي وثائق لاقتراح هذا ...
في الواقع ، files
، include
، وما إلى ذلك هي حقول المستوى الأعلى
{
"compilerOptions": {},
"exclude": []
}
يتوفر المزيد من المستندات على http://www.typescriptlang.org/docs/handbook/tsconfig-json.html
ikatyang شكرا - لا أصدق أنني فاتني ذلك 🙄
{
"compilerOptions": {
"إعلان": صحيح ،
"الهدف": "es5"،
"الوحدة النمطية": "commonjs" ،
"moduleResolution": "عقدة"،
"emitDecoratorMetadata": صحيح ،
"ديكورات تجريبية": صحيح ،
"removeComments": خطأ ،
"noImplicitAny": خطأ ،
"outDir": "dist"،
"typeRoots": [
"./node_modules/@types/"
]
} ،
"استبعاد": [
"dist"
]
}
التعليق الأكثر فائدة
في الواقع ،
files
،include
، وما إلى ذلك هي حقول المستوى الأعلى