.eslintrc.js 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. module.exports = {
  2. root: true,
  3. env: {
  4. node: true,
  5. },
  6. settings: {
  7. 'import/resolver': {
  8. 'node': {
  9. 'paths': ['src']
  10. }
  11. }
  12. },
  13. extends: [
  14. 'plugin:vue/essential',
  15. '@vue/airbnb',
  16. ],
  17. parserOptions: {
  18. parser: '@babel/eslint-parser',
  19. },
  20. rules: {
  21. 'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
  22. 'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
  23. "linebreak-style": [0 ,"error", "windows"],
  24. 'class-methods-use-this': 0,
  25. 'no-param-reassign': [
  26. 'error',
  27. {
  28. props: true,
  29. ignorePropertyModificationsFor: ['state', 'vm', 'item'],
  30. },
  31. ],
  32. 'import/extensions': [
  33. 'error',
  34. 'always',
  35. {
  36. js: 'never',
  37. vue: 'always',
  38. },
  39. ],
  40. indent: [
  41. 'error',
  42. 4,
  43. {
  44. SwitchCase: 1,
  45. },
  46. ],
  47. 'max-len': [2, 260, 4],
  48. 'vue/attribute-hyphenation': [
  49. 'error',
  50. 'always',
  51. ],
  52. 'vue/attributes-order': 'error',
  53. 'vue/html-closing-bracket-newline': [
  54. 'error',
  55. {
  56. singleline: 'never',
  57. multiline: 'always',
  58. },
  59. ],
  60. 'vue/html-closing-bracket-spacing': 'error',
  61. 'vue/html-end-tags': 'error',
  62. 'vue/html-indent': [
  63. 'error',
  64. 4,
  65. ],
  66. 'vue/html-quotes': [
  67. 'error',
  68. 'double',
  69. ],
  70. 'vue/html-self-closing': 'error',
  71. 'vue/max-attributes-per-line': [
  72. 'error',
  73. {
  74. singleline: 6,
  75. multiline: {
  76. max: 1,
  77. allowFirstLine: false,
  78. },
  79. },
  80. ],
  81. 'vue/no-confusing-v-for-v-if': 'error',
  82. 'vue/no-parsing-error': 'error',
  83. 'vue/no-use-v-if-with-v-for': 'error',
  84. // 'vue/no-v-html': 'error',
  85. 'vue/order-in-components': 'error',
  86. 'vue/prop-name-casing': 'error',
  87. 'vue/require-default-prop': 'error',
  88. 'vue/require-prop-types': 'error',
  89. 'vue/script-indent': [
  90. 'error',
  91. 4,
  92. {
  93. baseIndent: 0,
  94. switchCase: 1,
  95. ignores: [],
  96. },
  97. ],
  98. 'vue/this-in-template': 'error',
  99. },
  100. };