今日更新至PhpStorm 2016.2.1
突然之间,根据我的TSLint规则,我在TS文件中的格式不正确。
"typedef-whitespace": [
true,
{
"call-signature": "nospace",
"index-signature": "nospace",
"parameter": "nospace",
"property-declaration": "nospace",
"variable-declaration": "nospace"
},
{
"call-signature": "nospace",
"index-signature": "nospace",
"parameter": "nospace",
"property-declaration": "nospace",
"variable-declaration": "nospace"
}
]

在Editor > Code Style > Typescript中,不存在在类型断言之后删除空格的示例或规则。

发布于 2016-09-27 10:17:24
In Editor > Code Style > Typescript没有示例或规则来删除类型断言后的空格。
嗯..。我在PhpStorm 2016.2.1中清楚地看到了这一点(删除屏幕截图中箭头指向的这两个空格的选项)。我自己也不是TypeScript的人。所以也许它不会影响你的代码。但对我来说,这似乎是正确的选择。
Settings/Preferences | Editor | Code Style | TypeScriptSpaces | Other | After type reference colon ':'

https://stackoverflow.com/questions/39716322
复制相似问题