Skip to content

[No QA] Fix latent lint errors that only surface on an uncached lint - #98943

Merged
roryabraham merged 1 commit into
mainfrom
fix/latent-eslint-errors
Aug 19, 2026
Merged

[No QA] Fix latent lint errors that only surface on an uncached lint#98943
roryabraham merged 1 commit into
mainfrom
fix/latent-eslint-errors

Conversation

@roryabraham

Copy link
Copy Markdown
Contributor

Explanation of Change

Five ESLint errors that already exist on main but that most PRs never see.

The ESLint cache key hashes config/eslint/**, so a PR that touches that directory gets a cold, whole-repo re-lint instead of only its changed files — and then fails on errors it did not introduce. #97199 hit exactly this while adding an evals project to the ESLint config. Splitting the fix out so it can land on its own.

They aren't caught by eslint-seatbelt because the baseline lists these files under @typescript-eslint/no-unsafe-type-assertion, while the errors are no-unnecessary-type-assertion and no-deprecated — different rules, so nothing grandfathers them.

Four redundant type assertions. f2d5991a487 gave getCardFeedWithDomainID overloads that already return CompanyCardFeedWithDomainID, so as CompanyCardFeedWithDomainID became a no-op at three call sites, plus a fourth that carried the same value through to an Onyx write. TypeScript reports these as assertions that don't change the type, so removing them changes nothing at runtime or in the type system. One type import became unused and is dropped with them.

One deprecated navigation call. CommonActions.navigate's object form is deprecated in favour of navigate(name, params, options). The call in linkTo passes only name and params — no key, no merge — so the positional form dispatches an identical action. It is the only CommonActions.navigate( call in src/.

Fixed Issues

$
PROPOSAL:

Tests

  1. npm run lint completes without these five errors. To see them on main, a cached run won't do it — bun scripts/lint.ts --no-cache src/libs/Navigation/helpers/linkTo/index.ts src/libs/actions/CompanyCards.ts src/pages/workspace/companyCards/WorkspaceCompanyCardFeedSelectorPage.tsx src/pages/workspace/companyCards/addNew/CardInstructionsStep.tsx reports all five before this change and none after.
  2. npm run typecheck passes. This is the meaningful check on the cast removals: if any assertion had been doing real work, dropping it would fail here.
  3. npx jest tests/navigation tests/unit/Navigation passes (1007 tests, 65 suites), covering the linkTo change.
  • Verify that no errors appear in the JS console

Offline tests

None — no runtime behaviour changes.

QA Steps

None. No user-facing change: four removed no-op type assertions and one deprecated API call swapped for its non-deprecated equivalent.

  • Verify that no errors appear in the JS console

Screenshots/Videos

n/a

These are on main today, but the ESLint cache means most PRs never
re-lint the files that carry them. Any PR touching config/eslint/ does,
because the cache key hashes that directory, and then fails on errors it
did not introduce.

Three of the redundant casts date from f2d5991, which gave
getCardFeedWithDomainID overloads that already return
CompanyCardFeedWithDomainID. TypeScript now considers the assertions
no-ops, so removing them changes nothing at runtime, and the fourth
followed the same value through to an Onyx write.

CommonActions.navigate's object form is deprecated. This call passes
only name and params, with no key or merge, so the positional form
dispatches the same action.
@roryabraham
roryabraham requested review from a team as code owners August 19, 2026 04:07
@melvin-bot
melvin-bot Bot requested review from flaviadefaria and stitesExpensify and removed request for a team August 19, 2026 04:07
@melvin-bot

melvin-bot Bot commented Aug 19, 2026

Copy link
Copy Markdown

@stitesExpensify Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button]

@melvin-bot
melvin-bot Bot removed the request for review from a team August 19, 2026 04:08
@codecov

codecov Bot commented Aug 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ Changes either increased or maintained existing code coverage, great job!

Files with missing lines Coverage Δ
src/libs/Navigation/helpers/linkTo/index.ts 95.04% <100.00%> (+1.54%) ⬆️
...space/companyCards/addNew/CardInstructionsStep.tsx 0.00% <ø> (ø)
src/libs/actions/CompanyCards.ts 33.73% <0.00%> (ø)
...panyCards/WorkspaceCompanyCardFeedSelectorPage.tsx 0.00% <0.00%> (ø)
... and 11 files with indirect coverage changes

@roryabraham
roryabraham merged commit 3b45d93 into main Aug 19, 2026
45 of 46 checks passed
@roryabraham
roryabraham deleted the fix/latent-eslint-errors branch August 19, 2026 04:54
@github-actions

Copy link
Copy Markdown
Contributor

🚧 roryabraham has triggered a test Expensify/App build. You can view the workflow run here.

@OSBotify

Copy link
Copy Markdown
Contributor

✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

roryabraham added a commit that referenced this pull request Aug 19, 2026
These recorded five violations that #98943 has since fixed at the
source, so the entries describe casts and a deprecated call that no
longer exist.
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