.eslintrc.js 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /* eslint-env node */
  2. require("@rushstack/eslint-patch/modern-module-resolution")
  3. module.exports = {
  4. root: true,
  5. env: {
  6. browser: true,
  7. node: true,
  8. jest: true,
  9. },
  10. parserOptions: {
  11. sourceType: "module",
  12. requireConfigFile: false,
  13. },
  14. extends: [
  15. "@vue/typescript/recommended",
  16. "plugin:vue/vue3-recommended",
  17. "plugin:prettier/recommended",
  18. ],
  19. ignorePatterns: [
  20. "static/**/*",
  21. "./helpers/backend/graphql.ts",
  22. "**/*.d.ts",
  23. "types/**/*",
  24. ],
  25. plugins: ["vue", "prettier"],
  26. // add your custom rules here
  27. rules: {
  28. semi: [2, "never"],
  29. "import/named": "off", // because, named import issue with typescript see: https://github.com/typescript-eslint/typescript-eslint/issues/154
  30. "no-console": "off",
  31. "no-debugger": process.env.HOPP_LINT_FOR_PROD === "true" ? "error" : "warn",
  32. "prettier/prettier":
  33. process.env.HOPP_LINT_FOR_PROD === "true" ? "error" : "warn",
  34. "vue/multi-word-component-names": "off",
  35. "vue/no-side-effects-in-computed-properties": "off",
  36. "import/no-named-as-default": "off",
  37. "import/no-named-as-default-member": "off",
  38. "@typescript-eslint/no-non-null-assertion": "off",
  39. "@typescript-eslint/no-explicit-any": "off",
  40. "import/default": "off",
  41. "no-undef": "off",
  42. // localStorage block
  43. "no-restricted-globals": [
  44. "error",
  45. {
  46. name: "localStorage",
  47. message:
  48. "Do not use 'localStorage' directly. Please use localpersistence.ts functions or stores",
  49. },
  50. ],
  51. // window.localStorage block
  52. "no-restricted-syntax": [
  53. "error",
  54. {
  55. selector: "CallExpression[callee.object.property.name='localStorage']",
  56. message:
  57. "Do not use 'localStorage' directly. Please use localpersistence.ts functions or stores",
  58. },
  59. ],
  60. },
  61. }