Skip to content

Thin ESLint Guardrails #227

@arawrdn

Description

@arawrdn

Hi,

react-hooks/exhaustive-deps set to error is good, but the config is too thin for a Next/Web3 app.

Technical debt: no TypeScript-aware linting. This catches React hook deps, but misses unsafe async flows, bad promise handling, loose any, and Web3 footguns like unawaited tx calls or ignored RPC failures.

Impact:

  • Race condition risk in useEffect hooks that fire wallet/RPC calls.
  • Silent promise leaks from contract reads/writes.
  • More runtime bugs that TS/ESLint could catch pre-build.
  • No guardrails for import order, unused vars, or dead code.

Refactor:

{
  "extends": [
    "next/core-web-vitals",
    "next/typescript",
    "plugin:@typescript-eslint/recommended",
    "plugin:@typescript-eslint/recommended-requiring-type-checking",
    "prettier"
  ],
  "plugins": ["@typescript-eslint"],
  "rules": {
    "react-hooks/exhaustive-deps": "error",
    "@typescript-eslint/no-floating-promises": "error",
    "@typescript-eslint/no-misused-promises": "error",
    "@typescript-eslint/consistent-type-imports": "error",
    "@typescript-eslint/no-unused-vars": [
      "error",
      {
        "argsIgnorePattern": "^_",
        "varsIgnorePattern": "^_"
      }
    ]
  }
}

Also make sure parser services are enabled:

// eslint.config or .eslintrc
parserOptions: {
  project: "./tsconfig.json"
}

Main win: fail fast on async/Web3 bugs instead of finding them as flaky wallet state, duplicate tx submits, or broken RPC edge cases.

Best,

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions