eslintrc.js 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. module.exports = {
  2. parser: 'vue-eslint-parser',
  3. extends: [
  4. 'plugin:vue/base',
  5. 'eslint:recommended',
  6. 'plugin:vue/vue3-recommended',
  7. 'plugin:vue/essential',
  8. 'plugin:@typescript-eslint/recommended', // caused by this line
  9. 'plugin:prettier/recommended',
  10. 'eslint-config-prettier'
  11. ],
  12. rules: {
  13. 'no-console': 'off',
  14. 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
  15. 'no-unused-vars': 'warn',
  16. 'vue/attribute-hyphenation': 'error', // enforce attribute naming style on custom components in template
  17. 'vue/component-definition-name-casing': ['error', 'PascalCase'],
  18. 'vue/html-closing-bracket-newline': ['error', {
  19. 'singleline': 'never',
  20. 'multiline': 'always'
  21. }],
  22. 'vue/html-closing-bracket-spacing': ['error', { // require or disallow a space before tag closing brackets
  23. 'startTag': 'never',
  24. 'endTag': 'never',
  25. 'selfClosingTag': 'always'
  26. }],
  27. 'vue/html-indent': ['error', 2, { // enforce consistent indentation in <template>
  28. 'attribute': 1,
  29. 'baseIndent': 1,
  30. 'closeBracket': 0,
  31. 'alignAttributesVertically': true
  32. }],
  33. 'vue/max-attributes-per-line': ['error', { // enforce the maximum number of attributes per line
  34. 'singleline': 3,
  35. 'multiline': {
  36. 'max': 1,
  37. 'allowFirstLine': false
  38. }
  39. }],
  40. 'vue/no-v-html': 'off', // disallow use of v-html to prevent XSS attack
  41. 'vue/require-default-prop': 'off',
  42. 'vue/singleline-html-element-content-newline': 'off',
  43. }
  44. };