eslintrc.js 1.3 KB

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