.eslintrc.js 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. // https://eslint.org/docs/user-guide/configuring
  2. // File taken from https://github.com/vuejs-templates/webpack/blob/1.3.1/template/.eslintrc.js, thanks.
  3. module.exports = {
  4. root: true,
  5. parserOptions: {
  6. parser: '@babel/eslint-parser'
  7. },
  8. env: {
  9. browser: true,
  10. webextensions: true,
  11. },
  12. // https://github.com/vuejs/eslint-plugin-vue#priority-a-essential-error-prevention
  13. // consider switching to `plugin:vue/strongly-recommended` or `plugin:vue/recommended` for stricter rules.
  14. extends: ['plugin:vue/essential', 'airbnb-base', 'plugin:prettier/recommended'],
  15. // required to lint *.vue files
  16. plugins: [
  17. 'vue'
  18. ],
  19. // check if imports actually resolve
  20. settings: {
  21. 'import/resolver': {
  22. webpack: {
  23. config: './webpack.config.js'
  24. }
  25. }
  26. },
  27. // add your custom rules here
  28. rules: {
  29. // don't require .vue extension when importing
  30. 'import/extensions': ['error', 'always', {
  31. js: 'never',
  32. vue: 'never'
  33. }],
  34. // disallow reassignment of function parameters
  35. // disallow parameter object manipulation except for specific exclusions
  36. 'no-param-reassign': ['error', {
  37. props: true,
  38. ignorePropertyModificationsFor: [
  39. 'state', // for vuex state
  40. 'acc', // for reduce accumulators
  41. 'e' // for e.returnvalue
  42. ]
  43. }],
  44. // disallow default export over named export
  45. 'import/prefer-default-export': 'off',
  46. // allow debugger during development
  47. 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off'
  48. }
  49. }