Skip to content

ENG-2147 Upgrade eslint and typescript-eslint - #1293

Merged
trangdoan982 merged 1 commit into
mainfrom
eng-2118-investigate-whether-to-upgrade-repo-eslint-from-version-8-to
Aug 19, 2026
Merged

ENG-2147 Upgrade eslint and typescript-eslint#1293
trangdoan982 merged 1 commit into
mainfrom
eng-2118-investigate-whether-to-upgrade-repo-eslint-from-version-8-to

Conversation

@trangdoan982

@trangdoan982 trangdoan982 commented Aug 13, 2026

Copy link
Copy Markdown
Member

Scope check

  • Ran $scope-check against the ENG ticket and final diff.
  • Scope beyond Done When: None. The diff is the upgrade and the minimum config changes needed to make it lint.

Carries out the upgrade recommended by the ENG-2118 investigation. That ticket scoped the upgrade itself out; this is the follow-up that lands it.

This PR previously carried the ENG-2118 investigation writeup. It has been rebased on latest main, re-verified, and rewritten as the actual upgrade under ENG-2147.

Why

ENG-1832 needs eslint-plugin-obsidianmd@0.4.1, whose peer ranges main could not satisfy:

Peer Required Before After
eslint >=9.19.0 8.57.1 ❌ 9.39.5 ✅
typescript-eslint ^8.35.1 7.18.0 ❌ 8.67.0 ✅
@eslint/js ^9.30.1 9.34.0 ✅ 9.34.0 ✅

Testing

git fetch origin && git checkout eng-2118-investigate-whether-to-upgrade-repo-eslint-from-version-8-to
pnpm install

Confirm the upgrade actually resolved:

pnpm --dir packages/eslint-config exec eslint --version
image

Lint everything. Use --continue so one workspace failing does not mask the rest:

npx turbo lint --continue
image

These are same errors that are appearing on main branch. Lint errors not caused by this upgrade

npx turbo check-types
image

CI is unaffected either way: the lint-changed-files job runs eslint directly against changed files and never invokes turbo lint.

What changed

Dependencies (pnpm-workspace.yaml catalog + packages/eslint-config/package.json)

  • eslint 8.57.1 → ^9.39.5
  • typescript-eslint ^7.18.0^8.67.0
  • @types/eslint 8.56.12 → ^9.6.1
  • Dropped @vercel/style-guide and eslint-config-turbo. Both were declared but never imported by any config, and @vercel/style-guide was the last hard pin holding eslint below 9.
  • Dropped the now-unneeded eslint: ^8.57 entry from allowedDeprecatedVersions.

Config — three v8/v9 breaking changes had to be handled for the repo to lint at all:

  1. tsconfigRootDir must be absolute. typescript-eslint v8 rejects ".", and every file fails to parse. Now uses import.meta.dirname, which is safe because the repo already requires Node >=22.
  2. Type-aware linting must be scoped to TS files. With project: true applied to every file, v8 errors on .mjs files that belong to no tsconfig, where v7 silently skipped them. The files glob must include .mts/.cts or ESLint crashes outright on packages/database/scripts.
  3. Plain JS needs disableTypeChecked for the same reason — added as a dedicated block in packages/eslint-config/base.js.

No source files are touched. The diff is ESLint config, the dependency catalog, and pnpm-lock.yaml (which shrinks by ~1,100 lines as the two dropped packages' trees go away).

Appendix: Results

Measured on this branch rebased onto main @ da2861f3.

Check Result
turbo lint (7 workspaces) 0 errors, 754 warnings
turbo check-types 8 / 8 pass

Per workspace:

Workspace Errors Warnings
apps/roam 0 538
apps/obsidian 0 111
apps/website 0 86
packages/database 0 15
packages/ui 0 4
packages/content-model 0 0
packages/utils 0 0

Warnings: 573 → 754

The repo runs eslint-plugin-only-warn, so nothing here can fail a build — but the count moves and reviewers should know why. 62 of the +181 are ESLint 9 reporting unused suppression directives, which ESLint 8 ignored by default:

New warning Count
Unused eslint-disable directive 43
Unused eslint-enable directive 19

The remainder comes from typescript-eslint v8 broadening its type-aware rules. Top contributors in the current run:

Rule Count
@typescript-eslint/no-floating-promises 94
@typescript-eslint/no-unnecessary-type-assertion 79
@typescript-eslint/no-unused-vars 61
@typescript-eslint/no-unsafe-assignment 58
@typescript-eslint/no-unsafe-member-access 55
react/prop-types 48
react-hooks/exhaustive-deps 31
@typescript-eslint/no-misused-promises 30
@typescript-eslint/naming-convention 30
@typescript-eslint/no-explicit-any 30

⚠️ Do not run eslint --fix over this branch. 103 of the warnings in apps/roam alone are reported as auto-fixable, but the fixers here are not safe to apply blind: no-unnecessary-type-assertion and the unused-directive fixers delete code that exists for a reason in places, and a sweeping autofix would bury this dependency upgrade under hundreds of unrelated source changes. Cleaning up warnings belongs in its own ticket.

🤖 Generated with Claude Code

@linear-code

linear-code Bot commented Aug 13, 2026

Copy link
Copy Markdown

ENG-2118

ENG-2147

@vercel

vercel Bot commented Aug 13, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
discourse-graph Ready Ready Preview Aug 17, 2026 5:55pm

Request Review

@supabase

supabase Bot commented Aug 13, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project zytfjzqyijgagqxrzbmz because there are no changes detected in packages/database/supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@maparent

Copy link
Copy Markdown
Collaborator

Really great work!
Two questions: Is it easy to fix the typescript-eslint@7.18.0 constraint? Latest version is 8.67.0, maybe it forces us to upgrade typescript?

Re lint --fix.
My reflex would be to run it with the old ESLint (no negative impact) before migrating.

Copy link
Copy Markdown
Member Author

thanks for the review MAP. no need to upgrade typescript. upgrading typescript-eslint already widens support for typescript.

re lint --fix. I think the reason we don't run it already is that there are simply too many warnings already. So whether to run before or after the upgrade we'll face the same issue: too many changes with no way to track if it breaks certain functionalities or not. I'd say we we upgrade and fix per file as the PR CI touches changed files

Copy link
Copy Markdown
Collaborator

fair enough.

Carries out the upgrade recommended by the ENG-2118 investigation. Needed to
unblock ENG-1832: eslint-plugin-obsidianmd@0.4.1 peers on eslint >=9.19.0 and
typescript-eslint ^8.35.1, neither of which eslint 8.57.1 / typescript-eslint 7
could satisfy.

- eslint 8.57.1 -> ^9.39.5, @types/eslint 8.56.12 -> ^9.6.1 (catalog)
- typescript-eslint ^7.18.0 -> ^8.67.0
- drop @vercel/style-guide and eslint-config-turbo: both were declared but never
  imported, and @vercel/style-guide was the only remaining hard pin on eslint <9
- drop the now-unneeded eslint ^8.57 allowedDeprecatedVersions entry

Three breaking changes had to be handled for the repo to lint at all:

- tsconfigRootDir must be an absolute path under typescript-eslint v8; "." is
  rejected and every file fails to parse. Uses import.meta.dirname (safe: the
  repo already requires Node >=22).
- Type-aware linting must be scoped to TS files. With project: true applied to
  every file, v8 errors on .mjs files absent from any tsconfig where v7 skipped
  them. The glob must include .mts/.cts or ESLint crashes outright on
  packages/database/scripts.
- Plain JS needs disableTypeChecked for the same reason.

No source files change; only ESLint config, the dependency catalog, and the
lockfile. Warnings rise 573 -> 754, of which 62 are eslint 9 reporting unused
eslint-disable/eslint-enable directives that eslint 8 ignored. All remain
warnings, not errors -- see the PR body for the rule-level breakdown and why
`eslint --fix` must not be run over this.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@trangdoan982
trangdoan982 force-pushed the eng-2118-investigate-whether-to-upgrade-repo-eslint-from-version-8-to branch from bc6ffa5 to 52c5802 Compare August 17, 2026 17:53
@trangdoan982 trangdoan982 changed the title ENG-2118 Investigate whether to upgrade repo ESLint from version 8 to 9 ENG-2147 Upgrade eslint and typescript-eslint Aug 17, 2026
@trangdoan982
trangdoan982 marked this pull request as ready for review August 17, 2026 22:30
@graphite-app

graphite-app Bot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

PR size/scope check

This PR is over our review-size guideline.

  • Recommended: ~200 lines changed
  • Acceptable limit: up to 400 lines when well-scoped/self-contained
  • Preferred file count: fewer than 5 files

Please split this into smaller PRs unless there is a clear reason the changes need to land together.

If keeping it as one PR, please add a brief justification covering:

  • What single problem this PR solves
  • Why the files/changes are coupled

@trangdoan982

Copy link
Copy Markdown
Member Author

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

@trangdoan982
trangdoan982 merged commit f92a576 into main Aug 19, 2026
21 of 23 checks passed
@trangdoan982
trangdoan982 deleted the eng-2118-investigate-whether-to-upgrade-repo-eslint-from-version-8-to branch August 19, 2026 16:44
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.

3 participants