.eslintrc.js 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. module.exports = {
  2. // https://eslint.org/docs/user-guide/configuring#configuration-cascading-and-hierarchy
  3. // This option interrupts the configuration hierarchy at this file
  4. // Remove this if you have a higher level ESLint config file (it usually happens into a mono repos)
  5. root: true,
  6. parserOptions: {
  7. ecmaVersion: '2021', // Allows for the parsing of modern ECMAScript features
  8. ecmaFeatures: {
  9. experimentalObjectRestSpread: true
  10. }
  11. },
  12. env: {
  13. node: true,
  14. browser: true,
  15. 'vue/setup-compiler-macros': true
  16. },
  17. // Rules order is important, please avoid shuffling them
  18. extends: [
  19. // Base ESLint recommended rules
  20. // 'eslint:recommended',
  21. // Uncomment any of the lines below to choose desired strictness,
  22. // but leave only one uncommented!
  23. // See https://eslint.vuejs.org/rules/#available-rules
  24. 'plugin:vue/vue3-essential', // Priority A: Essential (Error Prevention)
  25. // 'plugin:vue/vue3-strongly-recommended', // Priority B: Strongly Recommended (Improving Readability)
  26. // 'plugin:vue/vue3-recommended', // Priority C: Recommended (Minimizing Arbitrary Choices and Cognitive Overhead)
  27. 'standard'
  28. ],
  29. plugins: [
  30. // https://eslint.vuejs.org/user-guide/#why-doesn-t-it-work-on-vue-files
  31. // required to lint *.vue files
  32. 'vue'
  33. ],
  34. globals: {
  35. ga: 'readonly', // Google Analytics
  36. cordova: 'readonly',
  37. __statics: 'readonly',
  38. __QUASAR_SSR__: 'readonly',
  39. __QUASAR_SSR_SERVER__: 'readonly',
  40. __QUASAR_SSR_CLIENT__: 'readonly',
  41. __QUASAR_SSR_PWA__: 'readonly',
  42. process: 'readonly',
  43. Capacitor: 'readonly',
  44. chrome: 'readonly'
  45. },
  46. // add your custom rules here
  47. rules: {
  48. // allow async-await
  49. 'generator-star-spacing': 'off',
  50. // allow paren-less arrow functions
  51. 'arrow-parens': 'off',
  52. 'one-var': 'off',
  53. 'no-void': 'off',
  54. 'multiline-ternary': 'off',
  55. 'import/first': 'off',
  56. 'import/named': 'error',
  57. 'import/namespace': 'error',
  58. 'import/default': 'error',
  59. 'import/export': 'error',
  60. // 'simple-import-sort/imports': 'error',
  61. // 'simple-import-sort/exports': 'error',
  62. 'import/extensions': 'off',
  63. 'import/no-unresolved': 'off',
  64. 'import/no-extraneous-dependencies': 'off',
  65. 'prefer-promise-reject-errors': 'off',
  66. 'no-unused-vars': 'error',
  67. 'vue/attributes-order': 'error',
  68. 'vue/order-in-components': 'error',
  69. 'vue/max-attributes-per-line': 'error',
  70. 'vue/html-indent': 'error',
  71. 'vue/html-closing-bracket-spacing': 'error',
  72. 'vue/no-multi-spaces': 'error',
  73. 'no-console': [
  74. 'warn',
  75. { allow: ['clear', 'info', 'error', 'dir', 'trace', 'groupEnd', 'groupCollapsed'] }
  76. ],
  77. 'vue/multi-word-component-names': 'off',
  78. 'vue/no-v-text-v-html-on-component': 'off',
  79. 'vue/component-name-in-template-casing': [
  80. 'error',
  81. 'kebab-case',
  82. {
  83. ignores: []
  84. }
  85. ],
  86. 'vue/html-closing-bracket-newline': [
  87. 'error',
  88. {
  89. singleline: 'never',
  90. multiline: 'never'
  91. }
  92. ],
  93. 'vue/html-self-closing': [
  94. 'error',
  95. {
  96. html: {
  97. void: 'never',
  98. normal: 'always',
  99. component: 'always'
  100. },
  101. svg: 'always',
  102. math: 'always'
  103. }
  104. ],
  105. 'vue/first-attribute-linebreak': [
  106. 'error',
  107. {
  108. singleline: 'beside',
  109. multiline: 'beside'
  110. }
  111. ],
  112. // allow debugger during development only
  113. 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
  114. 'space-before-function-paren': 0
  115. }
  116. }