美文网首页
tslint 规则配置,中文,通用

tslint 规则配置,中文,通用

作者: 森林迷了鹿_a9e9 | 来源:发表于2020-12-16 12:24 被阅读0次

适用于vue脚手架开发习惯 直接复制即可

{

  "defaultSeverity": "warning",

  "extends": [

    "tslint:recommended"

  ],

  "linterOptions": {

    "exclude": [

      "node_modules/**"

    ]

  },

  "rules": {

    "indent": [true, "spaces", 2],

    "interface-name": false,

    "no-consecutive-blank-lines": false,

    "object-literal-sort-keys": false,

    "ordered-imports": false,

    "quotemark": [true, "single"],

    "semicolon": [false, "always"],

    "trailing-comma": [false, {"multiline": "always", "singleline": "never"}],

    "arrow-parens": [false, "ban-single-arg-parens"],

    "no-console": false,

    "space-before-function-paren": true

  }

}

"no-console": false // console.log 警告

"arrow-parens": [false, "ban-single-arg-parens"] // 箭头函数单个参数不加括号警告

"trailing-comma": [false, {"multiline": "always", "singleline": "never"}] // 限制对象、数组、解构赋值等的最后一项末尾是否需要逗号

"semicolon": [false, "always"] // 行尾必须有分号

"indent": [true, "spaces", 2] // 缩进 两个

"space-before-function-paren": true // 函数名前必须要有空格

详细配置 tslint配置 | 易学教程

相关文章

网友评论

      本文标题:tslint 规则配置,中文,通用

      本文链接:https://www.haomeiwen.com/subject/eupngktx.html