注意注意注意,如有侵权立马删:文章来源

配置之后npm run serve重启一下

{// 禁止自动检测末尾行必须使用逗号,always总是检测,never从不检测,ignore忽略检测"trailing-comma": [true, {"singleline": "never","multiline": {"objects": "ignore","arrays": "always","functions": "never","typeLiterals": "ignore"}}],// 禁止给类的构造函数的参数添加修饰符"no-parameter-properties": false,// 禁止使用 debugger"no-debugger": false,// 禁止行尾有空格"no-trailing-whitespace": false,// 禁止无用的表达式"no-unused-expression": true,// 定义过的变量必须使用"no-unused-variable": true,// 变量必须先定义后使用"no-use-before-declare": true,// 禁止使用 var"no-var-keyword": true,// 必须使用 === 或 !==,禁止使用 == 或 !=,与 null 比较时除外"triple-equals": true,// 指定类成员的排序规则"member-ordering": false,// 禁止将 this 赋值给其他变量,除非是解构赋值"no-this-assignment": [false,{"allowed-names": ["^self$","^that$"],"allow-destructuring": true}],// 必须使用箭头函数,除非是单独的函数声明或是命名函数"only-arrow-functions": [true,"allow-declarations","allow-named-functions"],// 禁止出现空代码块,允许 catch 是空代码块"no-empty": [true,"allow-empty-catch"],// 禁止无用的类型断言"no-unnecessary-type-assertion": true,// 使用 return; 而不是 return undefined;"return-undefined": true,// 禁止对 array 使用 for in 循环"no-for-in-array": true,"comment-format": [true,"check-space"],// 单行注释格式化规则// 定义函数时如果用到了覆写,则必须将覆写的函数写到一起"adjacent-overload-signatures": true,// 禁止对函数的参数重新赋值"no-parameter-reassignment": true,// if 后面必须有 {,除非是单行 if"curly": [true,"ignore-same-line"],// for in 内部必须有 hasOwnProperty"forin": true,// 禁止在分支条件判断中有赋值操作"no-conditional-assignment": true,// 禁止使用 new 来生成 String, Number 或 Boolean"no-construct": true,// 禁止 super 在一个构造函数中出现两次"no-duplicate-super": true,// 禁止在 switch 语句中出现重复测试表达式的 case"no-duplicate-switch-case": true,// 禁止出现重复的变量定义或函数参数名"no-duplicate-variable": [true,"check-parameters"],// 禁止使用 eval"no-eval": true,// 禁止对对象字面量进行类型断言(断言成 any 是允许的)"no-object-literal-type-assertion": true,// 禁止没必要的 return await"no-return-await": true,// 禁止在数组中出现连续的逗号,如 let foo = [,,]"no-sparse-arrays": true,// 禁止 throw 字符串,必须 throw 一个 Error 对象"no-string-throw": true,// switch 的 case 必须 return 或 break"no-switch-case-fall-through": true,// 使用实例的方法时,必须 bind 到实例上"no-unbound-method": [true,"ignore-static"],// 使用 { ...foo, bar: 1 } 代替 Object.assign({}, foo, { bar: 1 })// 前者的类型检查更完善"prefer-object-spread": true,// parseInt 必须传入第二个参数"radix": true,// 必须使用 isNaN(foo) 而不是 foo === NaN"use-isnan": true,////// 可维护性// 这些规则可以增加代码的可维护性//// 禁止函数的循环复杂度超过 20,https://en.wikipedia.org/wiki/Cyclomatic_complexity"cyclomatic-complexity": [true,20],// 禁止使用废弃(被标识了 @deprecated)的 API"deprecation": true,// 一个缩进必须用四个空格替代"indent": [true,"spaces",4],// 禁止出现重复的 import"no-duplicate-imports": true,// 禁止一个文件中出现多个相同的 namespace"no-mergeable-namespace": true,// 文件类型必须时 utf-8"encoding": true,// import 语句中,关键字之间的间距必须是一个空格"import-spacing": true,// 接口可以 implement extend 和 merge"interface-over-type-literal": true,// new 后面只必须有一个空格"new-parens": true,// 类型断言必须使用 as Type,禁止使用 <Type>// <Type> 容易被理解为 jsx"no-angle-bracket-type-assertion": true,// 禁止连续超过三行空行"no-consecutive-blank-lines": [true,3],// 禁止使用特殊空白符(比如全角空格)"no-irregular-whitespace": true,// 禁止使用 JSDoc,因为 TypeScirpt 已经包含了大部分功能"no-redundant-jsdoc": true,// 禁止使用三斜杠引入类型定义文件"no-reference-import": true,// 禁止变量定义时赋值为 undefined"no-unnecessary-initializer": true,// 小数必须以 0. 开头,禁止以 . 开头,并且不能以 0 结尾"number-literal-format": true,// 必须使用 a = {b} 而不是 a = {b: b}"object-literal-shorthand": true,// 变量申明必须每行一个,for 循环的初始条件中除外"one-variable-per-declaration": [true,"ignore-for-loop"],// if 后的 { 禁止换行"one-line": true,// 必须使用单引号,jsx 中必须使用双引号"quotemark": [true,"single","jsx-double","avoid-template","avoid-escape"],// 行尾必须有分号"semicolon": [true,"always","ignore-interfaces"],// 函数名前必须有空格"space-before-function-paren": [true,"asyncArrow"],// 括号内首尾禁止有空格"space-within-parens": [true,0],// 禁止 finally 内出现 return, continue, break, throw 等// finally 会比 catch 先执行"no-unsafe-finally": true
}

vue-cli3.0中Tslint配置相关推荐

  1. Vue CLI3.0 中使用jQuery 和 Bootstrap

    Vue 中使用 jQuery 和 Bootstrap 不是特别符合 Vue 原生的写法,但是有时候又要用,所以放上我的引入设置,供大家参考. 在 Vue CLI2.0 中引入 jQuery 和 Boo ...

  2. 可视化构建工具探索之Vue Cli3.0 阿里飞冰

    Vue Cli3.0可视化构建工具--Vue UI 一.安装环境 安装了最新的Vue CLI.打开Terminal,输入: npm install -g @vue/cli or yarn global ...

  3. vue cli3.0打包上线不同环境

    vue cli3.0打包上线不同环境 1. cli3.0支持".env"文件配置,在项目的根目录下配置".env"文件,根据不同的环境命名不同的文件名称,如: ...

  4. 01-路由跳转 安装less this.$router.replace(path) 解决vue/cli3.0语法报错问题

    01-路由跳转 安装less this.$router.replace(path) 解决vue/cli3.0语法报错问题 参考文章: (1)01-路由跳转 安装less this.$router.re ...

  5. vue 2.0 中 函数`return false` 使用

    vue 2.0 中 函数return false 使用 问题 在注册页面下,判断输入框是否为空,想把这种函数封装一下,外部调用,返回return false 时,只是终止当前的判断函数,不是终止整个注 ...

  6. vue cli3.0 引入eslint 结合vscode使用

    ESLint 它的目标是提供一个插件化的javascript代码检测工具. 官网地址 最近一个项目里,最开始使用cli3.0搭建的时候没有默认选用eslint,导致现在有的人使用其他编辑器,就会出现格 ...

  7. Vue 3.0 中配置原生高德地图

    直接引用高德地图 SDK 1.在根目录 public 文件夹下的 index.html 中加入 <script type="text/javascript" src=&quo ...

  8. vue cli3.3 以上版本配置vue.config.js 及反向代理操作解决跨域操作

    const webpack = require('webpack') module.exports = { configureWebpack: { plugins: [ new webpack.Pro ...

  9. vue cli3.3 以上版本配置vue.config.js

    // vue.config.js 配置说明 //官方vue.config.js 参考文档 https://cli.vuejs.org/zh/config/#css-loaderoptions // 这 ...

最新文章

  1. 项目需求 | PC VR头戴显示器实时三维坐标(项目经费20万)
  2. 谈 JavaScript 浮点数计算精度问题(如0.1+0.2!==0.3)
  3. 微软宣布公开预览其内容分发网络
  4. atitit.跨语言实现备份mysql数据库 为sql文件特性 api 兼容性java c#.net php js
  5. mft按钮设计_奥林巴斯M4/3系统新品激情再燃 以轻量化设计铸就微单极致体验
  6. 关于windows注册表重定向和虚拟化分析
  7. gradle运行测试代码_Gradle的好处:运行单个测试
  8. c语言编写自由落体运动程序,3个C语言程序急求大神编写,再次先谢过了、
  9. mysql查询季度数据统计_mysql按年度、季度、月度、周、日SQL统计查询代码
  10. VMClean(vmware卸载清理,解决卸载MSI问题)
  11. 怎样设置计算机硬盘的空间,如何调整电脑硬盘的分区容量
  12. android 页面回滚焦点位置 解决方案
  13. 如何给PDF文件加密?PDF文件加密操作步骤来了
  14. d盘格式化了能正常使用吗
  15. 直播app代码公布:视频直播源码转盘功能的实现
  16. MySQL参数优化:back_log
  17. 国服Cytus2解密与注入
  18. 【详细教程】-Python绘图模块Matplotlib
  19. 交换机与路由技术-14-三层交换机配置
  20. IDS 和 IPS 日志监控

热门文章

  1. 《深入理解计算机系统》CSAPP第3版术语索引表
  2. 用js实现上传图片的效果
  3. [Windows] 4k对齐(无损对齐) [ 技术分享 ]
  4. qemu-system-riscv64 源码编译 及 运行参数
  5. 【机器学习】集成学习—Boosting—GBM(Gradient Boosting Machine)解析
  6. 需求分析和需求评审-三
  7. 面试心得(富士康,格力)
  8. android 如花调用so库,SO文件是什么文件
  9. 学生HTML个人网页作业作品下载 动漫主题网页设计制作 大学生个人网站作业模板 dreamweaver简单个人网页制作
  10. 使用putty的pscp与服务器上传下载文件