fix(lint): repair broken apps/web lint script and resolve all 1,108 pre-existing ESLint errors #152

Merged
ellamizuki merged 5 commits from fix/broken-web-lint-script into main 2026-09-06 03:37:39 +00:00
ellamizuki commented 2026-09-05 23:02:11 +00:00 (Migrated from github.com)

⚠️ Do not merge until the follow-up cleanup lands

This PR fixes a real, previously-undetected bug in the lint tooling itself. Merging it as-is will make CI's lint step fail on this PR and on main, because it stops silently skipping ~1200 real findings. Opening it now so the finding is documented and reviewable, not to be merged standalone — pairs with a follow-up cleanup effort.

The bug

apps/web/package.json's lint script was:

"lint": "pnpm -w exec eslint . --max-warnings 0"

-w exec runs eslint from the pnpm workspace root, and the . then resolves against that root context instead of apps/web. In practice this meant the command only ever linted 13 root-level config files (commitlint.config.ts, knip.config.ts, prettier.config.js, files under scripts/, etc.) — never the actual apps/web/src code.

Confirmed this affects the exact command CI runs (pnpm turbo lint, .github/workflows/ci.yml), not just a local quirk — reproduced with --force to rule out caching.

Every other package in the monorepo (apps/docs, packages/*) already uses the plain form:

"lint": "eslint . --max-warnings 0"

apps/web was the only outlier.

The fix

-    "lint": "pnpm -w exec eslint . --max-warnings 0",
-    "lint:fix": "pnpm -w exec eslint --fix .",
+    "lint": "eslint . --max-warnings 0",
+    "lint:fix": "eslint --fix .",

Matches apps/docs's already-working pattern exactly.

Impact once merged

With the script fixed, pnpm turbo lint --filter=@isyuricunha/web correctly finds 1169 errors + 30 warnings across apps/web/src. None of these are introduced by this change — they were always there, just never checked. Top offending rules by count:

Rule Count
unicorn/max-nested-calls 780
unicorn/no-for-each 38
unicorn/no-unnecessary-global-this 36
unicorn/prefer-minimal-ternary 30
@typescript-eslint/no-unnecessary-type-assertion 27
unicorn/no-non-function-verb-prefix 26
unicorn/no-break-in-nested-loop 19
unicorn/prefer-await 16
unicorn/prefer-array-from-map 16
unicorn/prefer-early-return 14
@typescript-eslint/no-empty-function 14

unicorn/max-nested-calls alone accounts for two-thirds of the total — mostly deeply-nested tRPC/db-query call chains, not necessarily bugs, but real lint debt that's been silently accumulating.

How this was found

Discovered while working on #151 (IP hashing) — my own local lint-staged pre-commit hook (which correctly runs bare eslint, not through this broken script) flagged 93 pre-existing errors in a file I only changed 2 lines of. That discrepancy between "the hook catches it" and "pnpm turbo lint doesn't" led to this investigation.

Suggested path forward

Do not merge until a follow-up plan exists for the 1169 findings — likely several scoped cleanup PRs grouped by rule or by area, given the size. Happy to scope and execute that as separate, reviewable work.

## ⚠️ Do not merge until the follow-up cleanup lands This PR fixes a real, previously-undetected bug in the lint tooling itself. Merging it as-is will make CI's lint step **fail** on this PR and on `main`, because it stops silently skipping ~1200 real findings. Opening it now so the finding is documented and reviewable, not to be merged standalone — pairs with a follow-up cleanup effort. ## The bug `apps/web/package.json`'s `lint` script was: ``` "lint": "pnpm -w exec eslint . --max-warnings 0" ``` `-w exec` runs eslint from the pnpm **workspace root**, and the `.` then resolves against that root context instead of `apps/web`. In practice this meant the command only ever linted **13 root-level config files** (`commitlint.config.ts`, `knip.config.ts`, `prettier.config.js`, files under `scripts/`, etc.) — never the actual `apps/web/src` code. Confirmed this affects the exact command CI runs (`pnpm turbo lint`, `.github/workflows/ci.yml`), not just a local quirk — reproduced with `--force` to rule out caching. Every other package in the monorepo (`apps/docs`, `packages/*`) already uses the plain form: ``` "lint": "eslint . --max-warnings 0" ``` `apps/web` was the only outlier. ## The fix ```diff - "lint": "pnpm -w exec eslint . --max-warnings 0", - "lint:fix": "pnpm -w exec eslint --fix .", + "lint": "eslint . --max-warnings 0", + "lint:fix": "eslint --fix .", ``` Matches `apps/docs`'s already-working pattern exactly. ## Impact once merged With the script fixed, `pnpm turbo lint --filter=@isyuricunha/web` correctly finds **1169 errors + 30 warnings** across `apps/web/src`. None of these are introduced by this change — they were always there, just never checked. Top offending rules by count: | Rule | Count | |---|---| | `unicorn/max-nested-calls` | 780 | | `unicorn/no-for-each` | 38 | | `unicorn/no-unnecessary-global-this` | 36 | | `unicorn/prefer-minimal-ternary` | 30 | | `@typescript-eslint/no-unnecessary-type-assertion` | 27 | | `unicorn/no-non-function-verb-prefix` | 26 | | `unicorn/no-break-in-nested-loop` | 19 | | `unicorn/prefer-await` | 16 | | `unicorn/prefer-array-from-map` | 16 | | `unicorn/prefer-early-return` | 14 | | `@typescript-eslint/no-empty-function` | 14 | `unicorn/max-nested-calls` alone accounts for two-thirds of the total — mostly deeply-nested tRPC/db-query call chains, not necessarily bugs, but real lint debt that's been silently accumulating. ## How this was found Discovered while working on #151 (IP hashing) — my own local `lint-staged` pre-commit hook (which correctly runs bare `eslint`, not through this broken script) flagged 93 pre-existing errors in a file I only changed 2 lines of. That discrepancy between "the hook catches it" and "`pnpm turbo lint` doesn't" led to this investigation. ## Suggested path forward Do not merge until a follow-up plan exists for the 1169 findings — likely several scoped cleanup PRs grouped by rule or by area, given the size. Happy to scope and execute that as separate, reviewable work.
isyuricunha (Migrated from github.com) reviewed 2026-09-05 23:02:11 +00:00
vercel[bot] commented 2026-09-05 23:02:17 +00:00 (Migrated from github.com)

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
website-web Ready Ready Preview Sep 6, 2026 3:34am UTC
1 Skipped Deployment
Project Deployment Actions Updated
website-docs Ignored Ignored Preview Sep 6, 2026 3:34am UTC
[vc]: #OqvLbrmvwYzHXGVX32JxEoQQzuwPMCDS9rjOEXhSP7g=:eyJpc01vbm9yZXBvIjp0cnVlLCJ0eXBlIjoiZ2l0aHViIiwicHJvamVjdHMiOlt7Im5hbWUiOiJ3ZWJzaXRlLXdlYiIsInByb2plY3RJZCI6InByal9iNnJGaEFBUEhJWFI3M2Nlb2RFMHl2bEJ3MzgyIiwicm9vdERpcmVjdG9yeSI6ImFwcHMvd2ViIiwiaW5zcGVjdG9yVXJsIjoiaHR0cHM6Ly92ZXJjZWwuY29tL3l1cmktY3VuaGFzLXByb2plY3RzL3dlYnNpdGUtd2ViLzdUQTRBOVdra01CZE5vS20xQU55V3A0Yzg3WlAiLCJwcmV2aWV3VXJsIjoid2Vic2l0ZS13ZWItZ2l0LWZpeC1icm9rZW4td2ViLWxpbnQtc2NyaXB0LXl1cmktY3VuaGFzLXByb2plY3RzLnZlcmNlbC5hcHAiLCJuZXh0Q29tbWl0U3RhdHVzIjoiREVQTE9ZRUQiLCJsaXZlRmVlZGJhY2siOnsicmVzb2x2ZWQiOjAsInVucmVzb2x2ZWQiOjAsInRvdGFsIjowLCJsaW5rIjoid2Vic2l0ZS13ZWItZ2l0LWZpeC1icm9rZW4td2ViLWxpbnQtc2NyaXB0LXl1cmktY3VuaGFzLXByb2plY3RzLnZlcmNlbC5hcHAifX0seyJuYW1lIjoid2Vic2l0ZS1kb2NzIiwicHJvamVjdElkIjoicHJqXzJlVTJzVE0waWRZNzByVGJzY0NDdEV0Nk1GT3ciLCJyb290RGlyZWN0b3J5IjoiYXBwcy9kb2NzIiwibGl2ZUZlZWRiYWNrIjp7InJlc29sdmVkIjowLCJ1bnJlc29sdmVkIjowLCJ0b3RhbCI6MCwibGluayI6IiJ9LCJpbnNwZWN0b3JVcmwiOiJodHRwczovL3ZlcmNlbC5jb20veXVyaS1jdW5oYXMtcHJvamVjdHMvd2Vic2l0ZS1kb2NzL3Zaa0x6QnVCRVh4MnlCQjJDakplWUJiWlZnR1EiLCJuZXh0Q29tbWl0U3RhdHVzIjoiSUdOT1JFRCIsInByZXZpZXdVcmwiOiJ3ZWJzaXRlLWRvY3MtZ2l0LWZpeC1icm9rZW4td2ViLWxpbi0wMzg3YWMteXVyaS1jdW5oYXMtcHJvamVjdHMudmVyY2VsLmFwcCJ9XX0= The latest updates on your projects. Learn more about [Vercel for GitHub](https://vercel.link/github-learn-more). | Project | Deployment | Actions | Updated | | :--- | :----- | :------ | :------ | | <a href="https://vercel.com/yuri-cunhas-projects/website-web"><sup><img src="https://vercel.com/api/www/avatar?projectId=prj_b6rFhAAPHIXR73ceodE0yvlBw382&teamId=team_g087rqPZJa9s4DWPeZtQhxa9&s=32" width="16" height="16" align="middle" alt="" /></sup></a> [website-web](https://vercel.com/yuri-cunhas-projects/website-web) | ![Ready](https://vercel.com/static/status/ready.svg) [Ready](https://vercel.com/yuri-cunhas-projects/website-web/7TA4A9WkkMBdNoKm1ANyWp4c87ZP) | [Preview](https://website-web-git-fix-broken-web-lint-script-yuri-cunhas-projects.vercel.app) | <relative-time datetime="2026-09-06T03:34:33.939Z">Sep 6, 2026 3:34am UTC</relative-time> | <details><summary>1 Skipped Deployment</summary> | Project | Deployment | Actions | Updated | | :--- | :----- | :------ | :------ | | <a href="https://vercel.com/yuri-cunhas-projects/website-docs"><sup><img src="https://vercel.com/api/www/avatar?projectId=prj_2eU2sTM0idY70rTbscCCtEt6MFOw&teamId=team_g087rqPZJa9s4DWPeZtQhxa9&s=32" width="16" height="16" align="middle" alt="" /></sup></a> [website-docs](https://vercel.com/yuri-cunhas-projects/website-docs) | ![Ignored](https://vercel.com/static/status/canceled.svg) [Ignored](https://vercel.com/yuri-cunhas-projects/website-docs/vZkLzBuBEXx2yBB2CjJeYBbZVgGQ) | [Preview](https://website-docs-git-fix-broken-web-lin-0387ac-yuri-cunhas-projects.vercel.app) | <relative-time datetime="2026-09-06T03:34:33.938Z">Sep 6, 2026 3:34am UTC</relative-time> | </details>
Sign in to join this conversation.
No description provided.