eslint.config.mjs 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. import js from '@eslint/js'
  2. import neostandard from 'neostandard'
  3. import pluginVue from 'eslint-plugin-vue'
  4. import vueParser from 'vue-eslint-parser'
  5. import { FlatCompat } from '@eslint/eslintrc'
  6. const compat = new FlatCompat()
  7. export default [
  8. js.configs.recommended,
  9. ...pluginVue.configs['flat/essential'],
  10. ...neostandard(),
  11. ...compat.extends(
  12. 'plugin:vue-pug/vue3-recommended'
  13. ),
  14. {
  15. ignores: [
  16. '/dist',
  17. '/.quasar',
  18. '/node_modules'
  19. ],
  20. languageOptions: {
  21. ecmaVersion: 'latest',
  22. sourceType: 'module',
  23. parser: vueParser,
  24. globals: {
  25. __statics: 'readonly',
  26. __QUASAR_SSR__: 'readonly',
  27. __QUASAR_SSR_SERVER__: 'readonly',
  28. __QUASAR_SSR_CLIENT__: 'readonly',
  29. __QUASAR_SSR_PWA__: 'readonly',
  30. process: 'readonly',
  31. Capacitor: 'readonly',
  32. chrome: 'readonly',
  33. APOLLO_CLIENT: 'readonly',
  34. EVENT_BUS: 'readonly'
  35. }
  36. },
  37. rules: {
  38. // allow async-await
  39. 'generator-star-spacing': 'off',
  40. // allow paren-less arrow functions
  41. 'arrow-parens': 'off',
  42. 'one-var': 'off',
  43. 'no-void': 'off',
  44. 'multiline-ternary': 'off',
  45. 'import/first': 'off',
  46. 'import/named': 'error',
  47. 'import/namespace': 'error',
  48. 'import/default': 'error',
  49. 'import/export': 'error',
  50. 'import/extensions': 'off',
  51. 'import/no-unresolved': 'off',
  52. 'import/no-extraneous-dependencies': 'off',
  53. 'prefer-promise-reject-errors': 'off',
  54. 'no-unused-vars': 'off',
  55. 'vue/multi-word-component-names': 'off',
  56. // allow debugger during development only
  57. 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
  58. // disable bogus rules
  59. 'vue/valid-template-root': 'off',
  60. 'vue/no-parsing-error': 'off',
  61. 'vue-pug/no-parsing-error': 'off',
  62. 'vue/valid-v-for': 'off',
  63. 'vue/html-quotes': ['warn', 'single'],
  64. 'vue/max-attributes-per-line': 'off'
  65. }
  66. }
  67. ]