eslint.config.js 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. // https://docs.expo.dev/guides/using-eslint/
  2. const { defineConfig } = require("eslint/config")
  3. const tsGuard = require("@typescript-eslint/eslint-plugin")
  4. const expoConfig = require("eslint-config-expo/flat")
  5. const reactHooksNext = require("eslint-plugin-react-hooks")
  6. module.exports = defineConfig([
  7. expoConfig,
  8. {
  9. ignores: ["dist/*"],
  10. },
  11. {
  12. files: ["**/*.{ts,tsx}"],
  13. languageOptions: {
  14. parserOptions: {
  15. projectService: true,
  16. tsconfigRootDir: __dirname,
  17. },
  18. },
  19. plugins: {
  20. "react-hooks-next": reactHooksNext,
  21. "ts-guard": tsGuard,
  22. },
  23. rules: {
  24. "ts-guard/no-explicit-any": "warn",
  25. "ts-guard/no-floating-promises": "warn",
  26. complexity: ["warn", 20],
  27. "max-lines": [
  28. "warn",
  29. {
  30. max: 1200,
  31. skipBlankLines: true,
  32. skipComments: true,
  33. },
  34. ],
  35. "max-lines-per-function": [
  36. "warn",
  37. {
  38. max: 250,
  39. skipBlankLines: true,
  40. skipComments: true,
  41. },
  42. ],
  43. "no-console": ["warn", { allow: ["warn", "error"] }],
  44. "no-nested-ternary": "warn",
  45. "react-hooks/exhaustive-deps": "error",
  46. "react-hooks-next/refs": "warn",
  47. "react-hooks-next/set-state-in-effect": "warn",
  48. "react-hooks-next/static-components": "warn",
  49. },
  50. },
  51. ])