eslint.config.mjs 2.0 KB

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