TSLint 与 VS code 格式文档的冲突

Conflict of TSLint and VS code Format Document

你能告诉我如何解决这个 TSLint 和 VS 代码格式文档问题吗?即 TsLint 格式化规则和 VS 代码文档格式做 2 件事。

这是关于该冲突的 Youtube 视频:https://youtu.be/1MoUX8BdO9E

tslint.json

{
  "extends": "tslint:recommended",
  "rulesDirectory": [
    "codelyzer"
  ],
  "rules": {
    "array-type": false,
    "arrow-parens": false,
    "deprecation": {
      "severity": "warn"
    },
    "import-blacklist": [
      true,
      "rxjs/Rx"
    ],
    "interface-name": false,
    "max-classes-per-file": false,
    "max-line-length": [
      true,
      200
    ],
    "member-access": false,
    "member-ordering": [
      true,
      {
        "order": [
          "static-field",
          "instance-field",
          "static-method",
          "instance-method"
        ]
      }
    ],
    "no-consecutive-blank-lines": false,
    "no-console": [
      true,
      "debug",
      "info",
      "time",
      "timeEnd",
      "trace"
    ],
    "no-empty": false,
    "no-inferrable-types": [
      true,
      "ignore-params"
    ],
    "no-non-null-assertion": true,
    "no-redundant-jsdoc": true,
    "no-switch-case-fall-through": true,
    "no-use-before-declare": true,
    "no-var-requires": false,
    "object-literal-key-quotes": [
      true,
      "as-needed"
    ],
    "object-literal-sort-keys": false,
    "ordered-imports": false,
    "quotemark": [
      true,
      "single"
    ],
    "trailing-comma": false,
    "no-output-on-prefix": true,
    "no-inputs-metadata-property": true,
    "no-host-metadata-property": true,
    "no-input-rename": true,
    "no-output-rename": true,
    "use-lifecycle-interface": true,
    "use-pipe-transform-interface": true,
    "one-variable-per-declaration": false,
    "component-class-suffix": [
      true,
      "Page",
      "Component"
    ],
    "directive-class-suffix": true,
    "directive-selector": [
      true,
      "attribute",
      "app",
      "camelCase"
    ],
    "component-selector": [
      true,
      "element",
      "app",
      "page",
      "kebab-case"
    ]
  }
}

这里有两件事:

1) 真的不推荐再使用tslint了。其实差不多deprecated and should be replaced by ESLint.

2) 我建议集成 Prettier instead of using VSCode's default formatter. Prettier can work with ESLint 以确保格式一致而不会出现冲突错误。

我能够像这样解决这个问题:也就是说,你可以看到所有的新行。

constructor(
    private router: Router,
    private modalController: ModalController,
    public detectBackendService: DetectBackendService,
    private formBuilder: FormBuilder,
    public departmentsDataService: DepartmentsDataService,

  ) { }