.eslintrc.js 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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. plugins: ["vue", "prettier"],
  22. // add your custom rules here
  23. rules: {
  24. semi: [2, "never"],
  25. "import/named": "off", // because, named import issue with typescript see: https://github.com/typescript-eslint/typescript-eslint/issues/154
  26. "no-console": process.env.NODE_ENV === "production" ? "error" : "off",
  27. "no-debugger": process.env.NODE_ENV === "production" ? "error" : "off",
  28. "vue/max-attributes-per-line": "off",
  29. "vue/component-name-in-template-casing": ["error", "PascalCase"],
  30. "vue/html-self-closing": [
  31. "error",
  32. {
  33. html: {
  34. normal: "never",
  35. void: "always",
  36. },
  37. },
  38. ],
  39. "vue/singleline-html-element-content-newline": "off",
  40. "vue/multiline-html-element-content-newline": "off",
  41. "vue/require-default-prop": "warn",
  42. "vue/require-prop-types": "warn",
  43. "prettier/prettier": ["warn", { semi: false }],
  44. "import/no-named-as-default": "off",
  45. "no-undef": "off",
  46. // localStorage block
  47. "no-restricted-globals": [
  48. "error",
  49. {
  50. name: "localStorage",
  51. message:
  52. "Do not use 'localStorage' directly. Please use localpersistence.ts functions or stores",
  53. },
  54. ],
  55. // window.localStorage block
  56. "no-restricted-syntax": [
  57. "error",
  58. {
  59. selector: "CallExpression[callee.object.property.name='localStorage']",
  60. message:
  61. "Do not use 'localStorage' directly. Please use localpersistence.ts functions or stores",
  62. },
  63. ],
  64. },
  65. globals: {
  66. $nuxt: true,
  67. },
  68. }