.eslintrc.js 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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: [
  15. 'plugin:vue/vue3-recommended',
  16. 'airbnb-base',
  17. 'plugin:prettier/recommended',
  18. ],
  19. // required to lint *.vue files
  20. plugins: ['vue'],
  21. // check if imports actually resolve
  22. settings: {
  23. 'import/resolver': {
  24. webpack: {
  25. config: './webpack.config.js',
  26. },
  27. },
  28. },
  29. // add your custom rules here
  30. rules: {
  31. 'no-undef': 'off',
  32. 'no-console': ['warn', { allow: ['warn', 'error'] }],
  33. 'no-underscore-dangle': 'off',
  34. 'func-names': 'off',
  35. 'import/extensions': [
  36. 'error',
  37. 'always',
  38. {
  39. js: 'never',
  40. },
  41. ],
  42. // disallow reassignment of function parameters
  43. // disallow parameter object manipulation except for specific exclusions
  44. 'no-param-reassign': 'off',
  45. 'import/no-extraneous-dependencies': 'off',
  46. // disallow default export over named export
  47. 'import/prefer-default-export': 'off',
  48. // allow debugger during development
  49. 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
  50. },
  51. };