.eslintrc.js 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. // eslint 代码校正(自虐)配置
  2. module.exports = {
  3. // 是否为跟配置文件
  4. root: true,
  5. // 对环境定义的一组全局变量的预设
  6. env: {
  7. browser: true,
  8. es2021: true,
  9. node: true,
  10. },
  11. // 代码中所有用到的全局变量
  12. globals: {
  13. // '$': true,
  14. // 'console': false
  15. },
  16. // 解释器
  17. parser: 'vue-eslint-parser',
  18. // 继承的规则
  19. extends: ['plugin:vue/recommended', 'plugin:vue/vue3-essential'],
  20. plugins: ['vue'],
  21. /**
  22. * 自定义的规则,
  23. * 规则值:
  24. * off / 0:代表关闭,
  25. * warn / 1:代表警告,
  26. * error / 2:代表错误
  27. * 参考:
  28. * eslint 规则:http://eslint.cn/docs/rules/
  29. * vue 配置 eslint :https://eslint.vuejs.org/rules/
  30. */
  31. rules: {
  32. // 是否必须末尾分号,never=不、always=是
  33. // semi: [1, 'always'],
  34. // 规定代码缩进是几个空格
  35. "indent": [1, 4],
  36. "vue/html-indent": [1, 4],
  37. // 关闭组件名风格限制
  38. 'vue/component-options-name-casing': 'off',
  39. 'vue/component-definition-name-casing': 'off',
  40. //
  41. "vue/require-valid-default-prop": 'off',
  42. //
  43. 'vue/custom-event-name-casing': 'off',
  44. 'vue/attributes-order': 'off',
  45. 'vue/one-component-per-file': 'off',
  46. 'vue/html-closing-bracket-newline': 'off',
  47. 'vue/max-attributes-per-line': 'off',
  48. 'vue/multiline-html-element-content-newline': 'off',
  49. 'vue/singleline-html-element-content-newline': 'off',
  50. 'vue/attribute-hyphenation': 'off',
  51. 'vue/html-self-closing': 'off',
  52. 'vue/no-multiple-template-root': 'off',
  53. 'vue/require-default-prop': 'off',
  54. 'vue/no-v-model-argument': 'off',
  55. 'vue/no-arrow-functions-in-watch': 'off',
  56. 'vue/no-template-key': 'off',
  57. 'vue/no-v-html': 'off',
  58. 'vue/comment-directive': 'off',
  59. 'vue/no-parsing-error': 'off',
  60. 'vue/no-deprecated-v-on-native-modifier': 'off',
  61. 'vue/multi-word-component-names': 'off',
  62. 'no-useless-escape': 'off',
  63. 'no-sparse-arrays': 'off',
  64. 'no-prototype-builtins': 'off',
  65. 'no-constant-condition': 'off',
  66. 'no-use-before-define': 'off',
  67. 'no-restricted-globals': 'off',
  68. 'no-restricted-syntax': 'off',
  69. 'generator-star-spacing': 'off',
  70. 'no-unreachable': 'off',
  71. 'no-multiple-template-root': 'off',
  72. 'no-unused-vars': 'off',
  73. 'no-v-model-argument': 'off',
  74. 'no-case-declarations': 'off',
  75. 'no-console': 'off',
  76. 'no-undef': 'off',
  77. },
  78. };