相关疑难解决方法(0)

如何用单个道具用括号修复更漂亮和更薄的错误?

我使用更漂亮的tslint和https://github.com/alexjoverm/tslint-config-prettierhttps://github.com/ikatyang/tslint-plugin-prettier

tslint.json就像

{
  "defaultSeverity": "error",
  "extends": [
    "tslint-config-airbnb",
    "tslint-react",
    "tslint-config-prettier"
  ],
  "jsRules": {},
  "rules": {
    "max-line-length": [true, 80],
    "import-name": false,
    "variable-name": false,
    "jsx-boolean-value": false,
    "jsx-no-multiline-js": false,
    "no-else-after-return": false,
    "object-shorthand-properties-first": false,
    "ter-arrow-parens": false,
    "ter-indent": false,
    "prettier": true
  },
  "rulesDirectory": ["tslint-plugin-prettier"]
}
Run Code Online (Sandbox Code Playgroud)

而我.prettierrc就像

{
  "trailingComma": "all",
  "singleQuote": true
}
Run Code Online (Sandbox Code Playgroud)

之后tslint --fix "src/**/*.ts",出现如下代码:

import { getChildrenProceduresSelector } from '@src/entities/procedures/selectors';
Run Code Online (Sandbox Code Playgroud)

错误说[tslint] Exceeds maximum line length of 80 (max-line-length)

但是当我手动修复它

import {
  getChildrenProceduresSelector, …
Run Code Online (Sandbox Code Playgroud)

javascript typescript tslint prettier

1
推荐指数
1
解决办法
3196
查看次数

标签 统计

javascript ×1

prettier ×1

tslint ×1

typescript ×1