一个关于eslint的问题

有没有胖友遇到过
vscode不提示eslint 的问题
时好时坏
1 .eslintrc.js 配好了

module.exports = {
  root: true,
  parserOptions: {
    parser: 'babel-eslint',
    sourceType: 'module'
  },
  env: {
    'browser': true
  },
  globals: {
    $: true,
    Vue: true,
    Vuex: true,
    VueRouter: true,
    hiidoEvent: true
  },
  extends: [
    'airbnb-base',
    'plugin:vue/essential'
  ],
  plugins: [
    'vue'
  ],
  settings: {
    "html/html-extensions": [".html", ".vue"],  // consider .html and .we files as HTML
  },
  rules: {
    'no-debugger': 2,
    'no-console': 1,
    'func-names': 0,
    'import/no-unresolved': 0,
    'import/extensions': 0,
    "import/prefer-default-export": 0,
    'import/no-extraneous-dependencies': 0,
    'import/first': 0,
    'linebreak-style': 0,
    'no-param-reassign': [2, { 'props': false }],
    'comma-dangle': [2, 'never'],
    'quote-props': ["error", "consistent"],
    "indent": ["error", 4],
    "prefer-const": 0,
    "global-require": 0,
    "require-await": "error"
  }
};

2 vscode 的配置

   "eslint.options": {},
    "eslint.validate": [
        "javascript",
        "javascriptreact",
        {
           "language": "vue",
           "autoFix": true
        }, {
           "language": "html",
           "autoFix": true
        }
   ],
阅读 1.7k
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进