.eslintrc.cjs 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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 an higher level ESLint config file (it usually happens into a monorepos)
  5. root: true,
  6. // https://eslint.vuejs.org/user-guide/#how-to-use-a-custom-parser
  7. // Must use parserOptions instead of "parser" to allow vue-eslint-parser to keep working
  8. // `parser: 'vue-eslint-parser'` is already included with any 'plugin:vue/**' config and should be omitted
  9. parserOptions: {
  10. parser: require.resolve('@typescript-eslint/parser'),
  11. extraFileExtensions: ['.vue']
  12. },
  13. env: {
  14. browser: true,
  15. es2021: true,
  16. node: true,
  17. 'vue/setup-compiler-macros': true
  18. },
  19. // Rules order is important, please avoid shuffling them
  20. extends: [
  21. // Base ESLint recommended rules
  22. // 'eslint:recommended',
  23. // https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/eslint-plugin#usage
  24. // ESLint typescript rules
  25. 'plugin:@typescript-eslint/recommended',
  26. // Uncomment any of the lines below to choose desired strictness,
  27. // but leave only one uncommented!
  28. // See https://eslint.vuejs.org/rules/#available-rules
  29. // 'plugin:vue/vue3-essential', // Priority A: Essential (Error Prevention)
  30. // 'plugin:vue/vue3-strongly-recommended', // Priority B: Strongly Recommended (Improving Readability)
  31. 'plugin:vue/vue3-recommended', // Priority C: Recommended (Minimizing Arbitrary Choices and Cognitive Overhead)
  32. // https://github.com/prettier/eslint-config-prettier#installation
  33. // usage with Prettier, provided by 'eslint-config-prettier'.
  34. 'prettier'
  35. ],
  36. plugins: [
  37. // required to apply rules which need type information
  38. '@typescript-eslint',
  39. // https://eslint.vuejs.org/user-guide/#why-doesn-t-it-work-on-vue-files
  40. // required to lint *.vue files
  41. 'vue'
  42. // https://github.com/typescript-eslint/typescript-eslint/issues/389#issuecomment-509292674
  43. // Prettier has not been included as plugin to avoid performance impact
  44. // add it as an extension for your IDE
  45. ],
  46. globals: {
  47. ga: 'readonly', // Google Analytics
  48. cordova: 'readonly',
  49. __statics: 'readonly',
  50. __QUASAR_SSR__: 'readonly',
  51. __QUASAR_SSR_SERVER__: 'readonly',
  52. __QUASAR_SSR_CLIENT__: 'readonly',
  53. __QUASAR_SSR_PWA__: 'readonly',
  54. process: 'readonly',
  55. Capacitor: 'readonly',
  56. chrome: 'readonly'
  57. },
  58. // add your custom rules here
  59. rules: {
  60. 'prefer-promise-reject-errors': 'off',
  61. quotes: ['warn', 'single', { avoidEscape: true }],
  62. // this rule, if on, would require explicit return type on the `render` function
  63. '@typescript-eslint/explicit-function-return-type': 'off',
  64. // in plain CommonJS modules, you can't use `import foo = require('foo')` to pass this rule, so it has to be disabled
  65. '@typescript-eslint/no-var-requires': 'off',
  66. // The core 'no-unused-vars' rules (in the eslint:recommended ruleset)
  67. // does not work with type definitions
  68. 'no-unused-vars': 'off',
  69. // allow debugger during development only
  70. 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off'
  71. }
  72. }