[No QA] Fix latent lint errors that only surface on an uncached lint - #98943
Conversation
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.
|
@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] |
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
🚧 roryabraham has triggered a test Expensify/App build. You can view the workflow run here. |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
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.
|
🚀 Deployed to staging by https://github.com/roryabraham in version: 9.4.57-0 🚀
|
|
🤖 No help site changes required. This PR is an internal lint/type cleanup with no user-facing behavior change, so nothing under WhyThe diff only:
The PR itself confirms this: QA Steps → "None. No user-facing change" and Offline tests → "None — no runtime behaviour changes." None of the changed files ( Since no docs changes are needed, there's no help site PR to review — |
|
🚀 Deployed to production by https://github.com/Beamanator in version: 9.4.57-3 🚀
Bundle Size Analysis (Sentry): |
Explanation of Change
Five ESLint errors that already exist on
mainbut 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 anevalsproject to the ESLint config. Splitting the fix out so it can land on its own.They aren't caught by
eslint-seatbeltbecause the baseline lists these files under@typescript-eslint/no-unsafe-type-assertion, while the errors areno-unnecessary-type-assertionandno-deprecated— different rules, so nothing grandfathers them.Four redundant type assertions.
f2d5991a487gavegetCardFeedWithDomainIDoverloads that already returnCompanyCardFeedWithDomainID, soas CompanyCardFeedWithDomainIDbecame 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 ofnavigate(name, params, options). The call inlinkTopasses onlynameandparams— nokey, nomerge— so the positional form dispatches an identical action. It is the onlyCommonActions.navigate(call insrc/.Fixed Issues
$
PROPOSAL:
Tests
npm run lintcompletes without these five errors. To see them onmain, 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.tsxreports all five before this change and none after.npm run typecheckpasses. This is the meaningful check on the cast removals: if any assertion had been doing real work, dropping it would fail here.npx jest tests/navigation tests/unit/Navigationpasses (1007 tests, 65 suites), covering thelinkTochange.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.
Screenshots/Videos
n/a