【问题标题】:Typescript: How to supress any semicolon warnings打字稿:如何抑制任何分号警告
【发布时间】:2019-11-02 15:26:01
【问题描述】:

我想像所有酷孩子一样,所以我非常想使用打字稿。除了不输入不必要的分号之外,有没有办法抑制不必要的分号警告?我不想让 tslint 抱怨分号。

我的 tslint.json:

{
  "defaultSeverity": "warning",
  "extends": [
    "tslint:recommended"
  ],
  "linterOptions": {
    "exclude": [
      "node_modules/**",
      "src/plugins/**"
    ]
  },
  "rules": {
    "quotemark": [true, "single"],
    "indent": [true, "spaces", 2],
    "interface-name": false,
    "ordered-imports": false,
    "object-literal-sort-keys": false,
    "no-consecutive-blank-lines": false,
    "member-access": [true, "no-public"],
    "semicolon": [true, "never"],
    "trailing-comma": "ignore",
    "no-console": false
  }
}

【问题讨论】:

  • 如果你不想让它抱怨,为什么要把它设置为true
  • @jhpratt 不管它的设置是什么,仍然抱怨
  • 我试图在我的机器上解决这个问题 - 使用最新的 TS 和 tslint,似乎 no 规则根本起作用 .
  • @jhpratt 是的,我尝试将其设置为所有可用选项,结果相同,非常烦人

标签: tslint


【解决方案1】:

问题原来是 vscode 的 tslint 扩展。 vscode-tslint 已被弃用,建议使用此扩展名 vscode-typescript-tslint-plugin 代替它。

这个post 引导我找到解决方案。

【讨论】:

    猜你喜欢
    • 2019-02-25
    • 2011-03-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-07-13
    • 2017-01-24
    • 2012-11-11
    相关资源
    最近更新 更多