.eslintrc.cjs 1.9 KB

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