Skip to content

前端项目配置

ESLint

开发中关闭ESLint检查

javascript
// 1、修改 .eslintrc.js
module.exports = {
  root: true,
  env: {
    node: true
  },
  extends: [
    'plugin:vue/vue3-essential',
    '@vue/standard',
    '@vue/typescript/recommended'
  ],
  parserOptions: {
    ecmaVersion: 2020
  },
  rules: {
    // 开启 or 关闭 console 报错
    'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
    // allow debugger during development
    'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
    // 禁止空格报错检查
    'no-irregular-whitespace': 'off'
  }
}


// 2、新建 vue.config.js
module.exports = {
  // 关闭eslint
  lintOnSave: false
}

上次更新: