.eslintrc.js 1.9 KB

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