vue3 - .eslintrc.js配置,包括开启debugger 等能力
2023-09-14 09:06:39 时间
在 package.json 文件 的 eslintConfig 配置部分加入
"no-debugger": "off", "no-console": "off",
意思为让eslint将debugger开启,并开启控制台
也可以在 .eslintrc.js 文件 里添加,这是等效的,因为 .eslintrc.js是eslint的专属配置文件,同时其配置也可以写在 package.json 文件中
这是我常用的.eslintrc.js配置
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
module.exports = { root: true, env: { node: true, "vue/setup-compiler-macros": true }, extends: [ "plugin:vue/vue3-essential", "eslint:recommended", "@vue/typescript/recommended", "@vue/prettier" ], parserOptions: { ecmaVersion: 2020, ecmaFeatures: { jsx: true } }, rules: { "no-console": "off", "no-debugger": "off", "generator-star-spacing": "off", "no-tabs": "off", "no-unused-vars": "off", "no-irregular-whitespace": "off", "@typescript-eslint/no-explicit-any": ["off"], "@typescript-eslint/no-var-requires": 0, "vue/multi-word-component-names": "off" } };
意思如下
开启控制台
"no-console": "off",
开启debugger "no-debugger": "off",
关闭代码编写时以空格开头 "generator-star-spacing": "off",
开启代码编写时可写tab键 "no-tabs": "off",
开启var定义 "no-unused-vars": "off",
开启不规则空白 "no-irregular-whitespace": "off",
关闭泛型为any的报错 "@typescript-eslint/no-explicit-any": ["off"],
使用require()方法引入文件赋值给常量时,关闭报错 "@typescript-eslint/no-var-requires": 0,
关闭强制组件命名时必须多个并驼峰名称 "vue/multi-word-component-names": "off"
相关文章
- 前端提升生产力系列三(vant3 vue3 移动端H5下拉刷新,上拉加载组件的封装)
- vue3:vue+nginx+php进行服务端部署的配置(nginx/1.18.0 / vue@3.2.37)
- vue3:vue+nginx+php进行服务端部署的配置(nginx/1.18.0 / vue@3.2.37)
- vue3: 动态修改favicon(网站的ico 图标)(vue@3.2.26)
- vue3中的应该知道的setup
- 怎样安装vue2和vue3的Vue.js devtools
- vue3 - import js文件eslint报错-解决
- Vue2.js迁移到Vue3.js的API变化
- vue3如何获取绑定在组件上的 textarea DOM元素
- vue3 中如何实现数组响应式
- vue3 报错解决:找不到模块‘xxx.vue’或其相应的类型声明。(Vue 3 can not find module)
- vue3 watch和 watchEffec和 computed 对比
- Vue3学习笔记(七)—— 状态管理、Vuex、Pinia
- 从0搭建Vue3组件库(一): 开篇
- vue3 + element plus + vite 迁移实践
- Vue3 对比Vue2,你找到哪些变化?
- vue3面试题:2022 最新前端 Vue 3.0 面试题及答案(持续更新中……)
- 学习vue3系列生命周期