.eslintrc.json 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. {
  2. "env": {
  3. "browser": true,
  4. "es2021": true
  5. },
  6. "extends": ["eslint:recommended", "plugin:react/recommended", "plugin:@typescript-eslint/recommended", "plugin:prettier/recommended"],
  7. "parser": "@typescript-eslint/parser",
  8. "parserOptions": {
  9. "ecmaFeatures": {
  10. "jsx": true
  11. },
  12. "ecmaVersion": "latest",
  13. "sourceType": "module"
  14. },
  15. "plugins": ["react", "@typescript-eslint", "prettier"],
  16. "ignorePatterns": ["node_modules", "dist", "public"],
  17. "rules": {
  18. "prettier/prettier": [
  19. "error",
  20. {
  21. "endOfLine": "auto"
  22. }
  23. ],
  24. "no-unused-vars": "off",
  25. "@typescript-eslint/no-unused-vars": "error",
  26. "@typescript-eslint/no-explicit-any": ["off"],
  27. "react/react-in-jsx-scope": "off",
  28. "react/jsx-no-target-blank": "off",
  29. "no-restricted-syntax": [
  30. "error",
  31. {
  32. "selector": "VariableDeclarator[init.callee.name='useTranslation'] > ObjectPattern > Property[key.name='t']:not([parent.declarations.0.init.callee.object.name='i18n'])",
  33. "message": "Destructuring 't' from useTranslation is not allowed. Please use the 'useTranslate' hook from '@/utils/i18n'."
  34. }
  35. ]
  36. },
  37. "settings": {
  38. "react": {
  39. "version": "detect"
  40. }
  41. },
  42. "overrides": [
  43. {
  44. "files": ["src/utils/i18n.ts"],
  45. "rules": {
  46. "no-restricted-syntax": "off"
  47. }
  48. }
  49. ]
  50. }