【发布时间】:2018-05-20 08:55:03
【问题描述】:
我有打字稿课
class UserModel
{
public vipTiers: Array<VipTierDto>;
public games: Array<GameDto>;
}
这导致在 VisualStudio 2015、TypeScript 2.0.6 中向我显示此警告 您的代码风格要求没有“公共”修饰符
显然我更喜欢保留私有/公共修饰符。在哪里可以设置编码风格?
这是我的 tsconfig.json
{
"compileOnSave": true,
"compilerOptions": {
"module": "commonjs",
"noImplicitAny": true,
"preserveConstEnums": true,
"removeComments": true,
"sourceMap": true
},
"include": [
"**/*.ts"
]
}
【问题讨论】:
-
一些很好的讨论 here 关于这方面的最佳实践。