vue3 - .eslintrc.js配置,包括开启debugger 等能力

在 package.json 文件 的 eslintConfig 配置部分加入

 "no-debugger": "off",
"no-console": "off",

意思为让eslint将debugger开启,并开启控制台

 也可以在  .eslintrc.js 文件 里添加,这是等效的,因为  .eslintrc.js是eslint的专属配置文件,同时其配置也可以写在 package.json 文件中

 

 

 

这是我常用的.eslintrc.js配置
复制代码
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"
  }
};
View Code
复制代码

 

意思如下

复制代码
开启控制台
"
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"
复制代码

 

posted @   岑惜  阅读(1541)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 分享一个免费、快速、无限量使用的满血 DeepSeek R1 模型,支持深度思考和联网搜索!
· 基于 Docker 搭建 FRP 内网穿透开源项目(很简单哒)
· ollama系列01:轻松3步本地部署deepseek,普通电脑可用
· 按钮权限的设计及实现
· 25岁的心里话
历史上的今天:
2021-03-30 mysql 的 limit 与sql server 的 top n
2021-03-30 win 10 遇到某文件一直在占用导致无法关闭,或者去任务管理器找不到服务怎么办?具体解决
2020-03-30 js 将数字型 的字符串 转 数字 【整数 /浮点型数字】
点击右上角即可分享
微信分享提示