eslint.config.js 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. import js from '@eslint/js'
  2. import globals from 'globals'
  3. import pluginVue from 'eslint-plugin-vue'
  4. import pluginQuasar from '@quasar/app-vite/eslint'
  5. import prettierSkipFormatting from '@vue/eslint-config-prettier/skip-formatting'
  6. export default [
  7. {
  8. /**
  9. * Ignore the following files.
  10. * Please note that pluginQuasar.configs.recommended() already ignores
  11. * the "node_modules" folder for you (and all other Quasar project
  12. * relevant folders and files).
  13. *
  14. * ESLint requires "ignores" key to be the only one in this object
  15. */
  16. // ignores: []
  17. },
  18. ...pluginQuasar.configs.recommended(),
  19. js.configs.recommended,
  20. /**
  21. * https://eslint.vuejs.org
  22. *
  23. * pluginVue.configs.base
  24. * -> Settings and rules to enable correct ESLint parsing.
  25. * pluginVue.configs[ 'flat/essential']
  26. * -> base, plus rules to prevent errors or unintended behavior.
  27. * pluginVue.configs["flat/strongly-recommended"]
  28. * -> Above, plus rules to considerably improve code readability and/or dev experience.
  29. * pluginVue.configs["flat/recommended"]
  30. * -> Above, plus rules to enforce subjective community defaults to ensure consistency.
  31. */
  32. ...pluginVue.configs['flat/essential'],
  33. {
  34. languageOptions: {
  35. ecmaVersion: 'latest',
  36. sourceType: 'module',
  37. globals: {
  38. ...globals.browser,
  39. ...globals.node, // SSR, Electron, config files
  40. process: 'readonly', // process.env.*
  41. ga: 'readonly', // Google Analytics
  42. cordova: 'readonly',
  43. Capacitor: 'readonly',
  44. chrome: 'readonly', // BEX related
  45. browser: 'readonly', // BEX related
  46. },
  47. },
  48. // add your custom rules here
  49. rules: {
  50. 'prefer-promise-reject-errors': 'off',
  51. // allow debugger during development only
  52. 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
  53. },
  54. },
  55. {
  56. files: ['src-pwa/custom-service-worker.js'],
  57. languageOptions: {
  58. globals: {
  59. ...globals.serviceworker,
  60. },
  61. },
  62. },
  63. prettierSkipFormatting,
  64. ]