.eslintrc.js 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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. parserOptions: {
  7. parser: '@babel/eslint-parser',
  8. ecmaVersion: 2018, // Allows for the parsing of modern ECMAScript features
  9. sourceType: 'module' // Allows for the use of imports
  10. },
  11. env: {
  12. browser: true,
  13. 'vue/setup-compiler-macros': true
  14. },
  15. // Rules order is important, please avoid shuffling them
  16. extends: [
  17. // Base ESLint recommended rules
  18. // 'eslint:recommended',
  19. // Uncomment any of the lines below to choose desired strictness,
  20. // but leave only one uncommented!
  21. // See https://eslint.vuejs.org/rules/#available-rules (look for Vuejs 2 ones)
  22. 'plugin:vue/essential', // Priority A: Essential (Error Prevention)
  23. // 'plugin:vue/strongly-recommended', // Priority B: Strongly Recommended (Improving Readability)
  24. // 'plugin:vue/recommended', // Priority C: Recommended (Minimizing Arbitrary Choices and Cognitive Overhead)
  25. 'standard'
  26. ],
  27. plugins: [
  28. // https://eslint.vuejs.org/user-guide/#why-doesn-t-it-work-on-vue-file
  29. // required to lint *.vue files
  30. 'vue',
  31. ],
  32. globals: {
  33. ga: 'readonly', // Google Analytics
  34. cordova: 'readonly',
  35. __statics: 'readonly',
  36. process: 'readonly',
  37. Capacitor: 'readonly',
  38. chrome: 'readonly'
  39. },
  40. // add your custom rules here
  41. rules: {
  42. // allow async-await
  43. 'generator-star-spacing': 'off',
  44. // allow paren-less arrow functions
  45. 'arrow-parens': 'off',
  46. 'one-var': 'off',
  47. 'no-void': 'off',
  48. 'multiline-ternary': 'off',
  49. 'import/first': 'off',
  50. 'import/named': 'error',
  51. 'import/namespace': 'error',
  52. 'import/default': 'error',
  53. 'import/export': 'error',
  54. 'import/extensions': 'off',
  55. 'import/no-unresolved': 'off',
  56. 'import/no-extraneous-dependencies': 'off',
  57. 'prefer-promise-reject-errors': 'off',
  58. 'vue/multi-word-component-names': 'off',
  59. // allow debugger during development only
  60. 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off'
  61. }
  62. }