.eslintrc.js 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  1. module.exports = {
  2. root: true,
  3. env: {
  4. node: true
  5. },
  6. extends: ['plugin:vue/essential', 'plugin:prettier/recommended'],
  7. parserOptions: {
  8. parser: '@babel/eslint-parser'
  9. },
  10. rules: {
  11. '@typescript-eslint/type-annotation-spacing': [
  12. 0,
  13. {
  14. before: true,
  15. after: true
  16. }
  17. ],
  18. 'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
  19. 'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
  20. quotes: ['error', 'single', 'avoid-escape'], //逗号风格,换行时在行首还是行尾
  21. blockBindings: 0, // 块级作用域,允许使用let const
  22. 'no-useless-escape': 0, // 允许使用转义字符
  23. 'vue/multi-word-component-names': 0,
  24. //如何关闭此Eslint错误 html标签之前和之后的预期新换行符
  25. 'vue/singleline-html-element-content-newline': 'off',
  26. 'vue/multiline-html-element-content-newline': 'off',
  27. 'no-unused-vars': 'off',
  28. 'vue/no-mutating-props': 0, // eslint不建议子元素修改父元素传的props值 修改为可以修改
  29. camelcase: 0,
  30. prettyhtml: 0,
  31. printWidth: 0,
  32. singleQuote: 0,
  33. wrapAttributes: 0,
  34. sortAttributes: 0
  35. }
  36. }