.eslintrc.js 1.6 KB

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