.eslintrc.js 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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. globals: {
  31. BROWSER_TYPE: true,
  32. },
  33. rules: {
  34. camelcase: 'off',
  35. 'no-await-in-loop': 'off',
  36. 'import/no-import-module-exports': 'off',
  37. 'no-console': ['warn', { allow: ['warn', 'error'] }],
  38. 'no-underscore-dangle': 'off',
  39. 'func-names': 'off',
  40. 'vue/v-on-event-hyphenation': 'off',
  41. 'import/no-named-default': 'off',
  42. 'no-restricted-syntax': 'off',
  43. 'vue/multi-word-component-names': 'off',
  44. 'import/extensions': [
  45. 'error',
  46. 'always',
  47. {
  48. js: 'never',
  49. },
  50. ],
  51. // disallow reassignment of function parameters
  52. // disallow parameter object manipulation except for specific exclusions
  53. 'no-param-reassign': 'off',
  54. 'import/no-extraneous-dependencies': 'off',
  55. // disallow default export over named export
  56. 'import/prefer-default-export': 'off',
  57. // allow debugger during development
  58. 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
  59. },
  60. };