Skip to content

chore: upgrade eslint and fix the current ruleset (#999) - #1013

Merged
johdanike merged 4 commits into
SwiftChainn:mainfrom
kazeemamudalat3-collab:upgrade/upgrade-eslint-and-fix-the-current
Oct 28, 2026
Merged

johdanike merged 4 commits into
SwiftChainn:mainfrom
kazeemamudalat3-collab:upgrade/upgrade-eslint-and-fix-the-current

Conversation

@kazeemamudalat3-collab

@kazeemamudalat3-collab kazeemamudalat3-collab commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Closes #999

What changed

  • eslint: ^9.0.0 -> ^9.39.5 in package.json, with pnpm-lock.yaml regenerated by pnpm 9 so CI's pnpm install --frozen-lockfile keeps working.
  • eslint.config.mjs
    • Turn the base no-unused-vars off for **/*.{ts,tsx,mts,cts} and move the ^_ options onto the TS-aware @typescript-eslint/no-unused-vars (which eslint-config-next already enables). The base rule misreports on TypeScript-only syntax and both rules fired on the same binding.
    • no-console now allows console.warn / console.error, so diagnostics no longer need eslint-disable noise.
    • Dropped ignores ESLint already covers (node_modules/**, .next/** - eslint-config-next ignores .next, out, build, next-env.d.ts itself) and generalised tsconfig.tsbuildinfo to **/*.tsbuildinfo, adding coverage/**.
  • services/deliverySocketService.ts + services/driverTrackingService.ts: deleted the 8 // eslint-disable-next-line no-console directives that the allow-list made redundant (ESLint began flagging them as unused). The 3 directives that still guard a real console.log were kept.
  • __tests__/eslintConfig.test.ts (new): drives the real eslint CLI over synthetic sources and asserts console filtering, exactly-one unused-var report for TS, _ placeholders in args/catch/destructuring, and that generated output is skipped while lib/*.ts is not.

Why not ESLint 10

I installed and ran 10.13.0 on this repo. It cannot work with eslint-config-next yet - not at 16.1.6 and not at the current 16.4.2:

  1. eslint-config-next's parser is next/dist/compiled/babel/eslint-parser, whose vendored ScopeManager has no addGlobals(). ESLint 10 calls it in SourceCode#finalize, so every lintable file fails: TypeError: scopeManager.addGlobals is not a function.
  2. eslint-plugin-react@7.37.5 (latest) still calls the removed context.getFilename(), so loading react/display-name dies with contextOrFilename.getFilename is not a function unless settings.react.version is pinned by hand.

Both need releases from Next.js / eslint-plugin-react first. 9.39.5 is the highest version that actually lints this repo.

Measured effect (pnpm run lint, same eslint build both sides)

problems errors warnings
before 463 12 451
after 192 12 180

271 warnings gone: duplicate/false no-unused-vars (384 -> 157), no-console (56 -> 12) and the 8 disable directives that the new allow-list made redundant. The 12 errors are the identical set of pre-existing react-hooks v7 findings (hooks/useAnalyticsCharts.ts, hooks/useDriverLocationSocket.ts, ...) plus the parse error below - this PR changes none of them, and I left those app-code fixes out because they are behaviour-sensitive and belong in their own PRs.

Heads-up: main is already red

CI on c3efa23 fails, and locally on a clean checkout of main: pnpm run type-check errors only in components/escrow/__tests__/HighValueCargoMultiSigModal.test.tsx (TS1003/TS1005 - the file is two test suites spliced together and was committed in that state by 403887d), pnpm test fails 216 of 2627 tests, and pnpm run build fails on app/layout.tsx (Property 'children' is missing in type '{ isDarkMode: false }'). So the "type-check passes strictly" criterion is unreachable from a lint-config change alone; say the word and I will fold the two-file repair into this PR.

Verification

  • pnpm install + pnpm install --frozen-lockfile resolve the regenerated lockfile
  • pnpm exec jest __tests__/eslintConfig.test.ts -> 4 passed
  • pnpm exec eslint eslint.config.mjs __tests__/eslintConfig.test.ts -> exit 0
  • pnpm exec tsc --noEmit -> no new errors (only the pre-existing corrupted test file)
  • full pnpm test -> 2411 passed / 216 failed, same as main; the 6 failures in services/driverTrackingService.test.ts reproduce unchanged with the pre-PR version of that file, so the directive removal did not affect them

Raises eslint to ^9.39.5 (the line eslint-config-next 16 is tested against; 10.x is blocked upstream by next's vendored parser), stops the base no-unused-vars from double-reporting on TypeScript, allows console.warn/error and prunes ignores eslint already applies. Closes SwiftChainn#999
@drips-wave

drips-wave Bot commented Oct 22, 2026

Copy link
Copy Markdown

@kazeemamudalat3-collab Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@johdanike

Copy link
Copy Markdown
Contributor

Kindly resolve conflicts

@johdanike
johdanike merged commit 5606607 into SwiftChainn:main Oct 28, 2026
0 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Upgrade] Upgrade ESLint and fix the current ruleset to reduce noisy or stale configuration issues

2 participants