[No QA] Prune stale eslint-seatbelt entries for deleted files on merge to main - #98665
Conversation
eslint-seatbelt never revisits a file's baseline row once the file is deleted or renamed, so stale rows accumulate forever (upstream bug: justjake/eslint-seatbelt#15). Add a script that drops rows for files that no longer exist and run it in the push-to-main lint job, so the existing OSBotify baseline auto-commit picks up the pruning too.
…mal lint flow Combines the standalone prune step from the previous commit into the lint script itself, and runs the Onyx.connect() bypass check in-process (via import) instead of shelling out to a second bun process. Also fixes a type declaration gap in the eslint-seatbelt readOnly patch (needed so lint.ts's own readOnly handling typechecks) and adds the new env vars lint.ts reads to src/types/env.d.ts, following the repo's existing ProcessEnv convention.
|
npm has a |
Bun's $ shell needs @types/bun, which conflicts with the app's own global types if loaded into the root tsconfig project (same tradeoff already made for tests/tooling/CIGitLogic.test.ts). Repurposes the pre-existing, unused scripts/tsconfig.json (a leftover from the removed ts-node setup) to isolate lint.ts into its own @types/bun project, and points ESLint's type-aware parserOptions at it for that one file. Also drops the NODE_OPTIONS/SEATBELT_* entries added to src/types/env.d.ts in the previous commit, since lint.ts's new isolated project doesn't inherit that file and no longer needs them.
…ectory Investigated widening the Bun-types carve-out from lint.ts to all of scripts/, but generateTranslations.ts and eslint-report.ts import from @src/*, which transitively pulls in enough of the app that it needs ambient declarations this project's narrower `types` doesn't have (asset modules, Onyx's generic augmentations) -- real typecheck regressions, not just noise. Documents the tradeoff and the per-file opt-in path instead.
lint.ts already runs under its isolated @types/bun project, so it can lean on Bun's own APIs for the two things it used node:fs/node:path for: existence checks and locating the repo root relative to the script's own file.
The exists() check for each baseline row was awaited one at a time in a for loop; since each check is independent, run them all concurrently instead and keep only the synchronous removeFile mutation in the loop.
|
@cretadn22 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] |
|
🚧 blimpich 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! 🧪🧪
|
Explanation of Change
eslint-seatbelt doesn't prune entries for deleted files. This is a known, unfixed upstream bug: justjake/eslint-seatbelt#15.)
This PR fixes that by:
scripts/lint.shin bunFixed Issues
$ #98676
Tests
Covered by CI.
Offline tests
n/a
QA Steps
n/a
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
N/A — no UI changes.