首页 > 解决方案 > tslint 的空白规则的配置选项

问题描述

有没有办法配置tslint在通常情况下期望空格,但在check-module(例如:导入)情况下特别警告空格。我们有一些不一致之处,因为不同的工具以不同的间距生成/复制。

import {ComponentFixture} from "@angular/core/testing";   
import { DebugElement } from "@angular/core";           // <-- Based on what I want to configure, this should generate white-space warning

我不确定这是否足够清楚,如果有意义的话,让我尝试用 config 展示这个想法:

有没有这样的(tslint.config):

"whitespace": [
  true,
  "check-branch",
  "check-decl",
  "check-operator",
  "check-separator",
  "check-type"
],
"whitespace": [
  false,
  "check-module"
],

我确信我不是第一个面临这个问题的人。任何参考/提示都会有所帮助。

标签: typescripttslint

解决方案


推荐阅读