【发布时间】:2016-05-31 01:39:06
【问题描述】:
我一直在尝试搜索互联网以解决此问题,但无济于事。也许你可以帮助我。我收到 tslint 'missing whitespace' 警告,内容如下:
./src/app/content/content.controller.ts 中的警告 [4, 13]:缺少空格 [5, 21]: 缺少空格
我想摆脱警告
这是代码示例....基本上任何我有一个冒号声明类型的地方都是发生错误的地方。我不想在它之间留一个空格,所以我希望 linter 不会打扰我...
export class ContentCtrl {
filters:IFilter[];
selectedFilters:IFilter[];
filterToAdd:IFilter;
/** @ngInject */
constructor(private $log:angular.ILogService,
private $timeout:any,
private toastr:any,
private filterService:FilterService) {
const self = this;
我查看了 tslint.json 文件,但不知道如何摆脱它。
我看到了一个很有前途的属性,上面写着:“typedef-whitespace”
我将其更改为以下内容,但可惜没有用:
"typedef-whitespace": [true,
{
"callSignature": "noSpace",
"catchClause": "noSpace",
"indexSignature": "noSpace",
"parameter": "noSpace"
}
],
如何消除“缺少空格”错误?
【问题讨论】:
标签: typescript tslint