Skip to content

[No QA] Add ESLint rule banning runtime react-native-onyx/dist/OnyxUtils imports - #100534

Open
MelvinBot wants to merge 4 commits into
mainfrom
claude-eslintBanOnyxUtilsRuntimeImport
Open

[No QA] Add ESLint rule banning runtime react-native-onyx/dist/OnyxUtils imports#100534
MelvinBot wants to merge 4 commits into
mainfrom
claude-eslintBanOnyxUtilsRuntimeImport

Conversation

@MelvinBot

@MelvinBot MelvinBot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Explanation of Change

OnyxUtils is imported from the internal deep path react-native-onyx/dist/OnyxUtils, which is package internals rather than the public API. The only sanctioned ways to read Onyx data are useOnyx() (render path) and Onyx.connectWithoutView() (non-render logic). This PR adds the lint boundary so the deep import can't be reintroduced.

What changed:

  1. config/eslint/eslint.config.mjs — new flat-config block for **/*.ts / **/*.tsx that bans the react-native-onyx/dist/OnyxUtils module path.

    Two implementation details worth reviewing:

    • It uses @typescript-eslint/no-restricted-imports, not the base no-restricted-imports that the shared restrictedImportPaths array feeds. The issue's suggested snippet used allowTypeImports: true, but that option only exists on the typescript-eslint variant — the base rule's schema rejects it, so putting the entry in restrictedImportPaths would either fail config validation or break the legitimate type-only import in src/types/onyx/Request.ts. allowTypeImports is what keeps import type OnyxUtils from 'react-native-onyx/dist/OnyxUtils' passing.
    • Because it's a different rule name, it stacks with the existing last-wins no-restricted-imports blocks instead of overriding any of them. No existing restriction is dropped.
  2. config/eslint/eslint.seatbelt.tsv — the 14 existing runtime imports are grandfathered into the seatbelt baseline (one entry per file, count 1), following the "I'm enabling a new rule repo-wide" workflow in LINTING.md. The rule lands now and blocks any new usage, while the existing call sites stay visible in the baseline so they can be paid down under this issue:

    An earlier revision of this PR used 14 eslint-disable-next-line comments instead. That was the wrong tool: per LINTING.md, eslint-disable is for permanent exceptions, and it hides violations from the baseline entirely. These suppressions are temporary — they exist only until the call sites are removed — so the seatbelt baseline is the correct escape hatch. Switched at linhvovan29546's request.

Aside from the baseline rows, no source or test file differs from main.

Fixed Issues

$ #98610
PROPOSAL:

Tests

// TODO: The human co-author must fill out the tests you ran before marking this PR as "ready for review"
// Please describe what tests you performed that validates your changed worked.

This is a lint-config-only change; there is no runtime behavior change to exercise in the app.

  • Verify that no errors appear in the JS console

Offline tests

N/A — lint configuration change only, no runtime behavior change.

QA Steps

// TODO: These must be filled out, or the issue title must include "[No QA]."

No QA — this change only affects lint rules and the seatbelt baseline. No shipped code paths change.

  • Verify that no errors appear in the JS console

AI Tests

Run locally by MelvinBot on the current head:

  • npm run lint on all 15 changed files — 0 errors. Confirms the rule fires and that every baseline row matches its real count.
  • Per-file count check — linting one file with the baseline row absent produced exactly 1 error, matching the recorded count of 1.
  • npm run lint-changed — clean.
  • npm run spell-changed — 1 file checked, 0 issues.
  • Repo-wide grep for react-native-onyx/dist/OnyxUtils — 14 runtime imports (all baselined), 1 type-only import (allowed by allowTypeImports), and the config entry itself. Nothing else in the repo can trip the new rule.
  • Full-repo ESLint check in CI — passed (6m16s) on the merge commit. This is the authoritative check for the baseline.
  • ⏭️ npm run typecheck, npm test, npm run react-compiler-compliance-check — skipped. No .ts/.tsx file differs from main; the only diff is the ESLint config block and the TSV baseline rows.

PR Author Checklist

  • I linked the correct issue in the ### Fixed Issues section above
  • I wrote clear testing steps that cover the changes made in this PR
    • I added steps for local testing in the Tests section
    • I added steps for the expected offline behavior in the Offline steps section
    • I added steps for Staging and/or Production testing in the QA steps section
    • I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
    • I tested this PR with a High Traffic account against the staging or production API to ensure there are no regressions (e.g. long loading states that impact usability).
  • I included screenshots or videos for tests on all platforms
  • I ran the tests on all platforms & verified they passed on:
    • Android: Native
    • Android: mWeb Chrome
    • iOS: Native
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
  • I verified there are no console errors (if there's a console error not related to the PR, report it or open an issue for it to be fixed)
  • I followed proper code patterns (see Reviewing the code)
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I followed the guidelines as stated in the Review Guidelines
  • I tested other components that can be impacted by my changes (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar are working as expected)
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))
  • If new assets were added or existing ones were modified, I verified that:
    • The assets are optimized and compressed (for SVG files, run npm run compress-svg)
    • The assets load correctly across all supported platforms.
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • I added unit tests for any new feature or bug fix in this PR to help automatically prevent regressions in this user flow.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.

Screenshots/Videos

Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari

Co-authored-by: Linh Vo <linhvovan29546@users.noreply.github.com>
@MelvinBot

MelvinBot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor Author

🤖 Android test steps verification results: ✅ pass

Standalone Android NewDot loads to Home/Inbox and renders normally; no JS errors, red-box screens, or crashes were observed in app logs; basic chat navigation (open report, back to Inbox) works as expected. This is consistent with this PR being an ESLint-config-only change with no runtime impact — the PR's Tests section documents no runtime behavior to exercise beyond "Verify that no errors appear in the JS console," so this run covers that check plus a load-and-navigate smoke pass.

Back navigation returned to Inbox list

Step Status
App loads to the Home / Inbox screen and renders normallyHome tab shows greeting ("Good afternoon, Melvin."), Getting Started checklist, Concierge prompt box, and bottom nav (Home/Inbox/Spend/Workspaces/Account); Inbox tab shows the chat list (Concierge, Melvin Bot's expenses, Melvin Bot (you)) rendering correctly.
Home screen with greeting and getting-started checklist
Inbox screen showing chat list
No JS console errors / red-box errors / crashes appear while the app is runningReviewed the run's logcat output: no FATAL EXCEPTION / AndroidRuntime crash, no RedBox/ExceptionsManager entries, and no ReactNativeJS error/warn console entries during navigation. The only E-level lines are benign pre-existing emulator noise unrelated to app JS (Airship URL-allowlist notice, CameraX lens-facing warnings on the virtual camera, DRM passthrough factory lookup, and a group_ib fraud-detection SDK content-provider IllegalArgumentException) — all during initial launch, before any test interaction. The app stayed responsive throughout.
App running normally with no error banners
Basic navigation works — open a chat/report from Inbox, then navigate back to InboxTapped "Melvin Bot (you)" from the Inbox list; the report screen opened correctly showing the report header, avatar, "Your space" description, and composer. Device Back returned cleanly to the Inbox list with the same three chats intact.
Opened 'Melvin Bot (you)' report/chat screen
Back navigation returned to Inbox list

One caveat worth stating plainly: this ran against the standalone Android NewDot build, not a build of this branch. That is acceptable here because the diff only touches ESLint config and comments, so it cannot change runtime behavior. The authoritative check for this PR is full-repo lint in CI, not device testing.


view run · view recording

@MelvinBot

MelvinBot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor Author

🤖 Web test steps verification results: ⚠️ partial

App loads to Home/Inbox and basic chat navigation works cleanly on dev NewDot web. The one documented check — "Verify that no errors appear in the JS console" — could not be directly proven, because the web tooling exposes no verb for reading the browser console; no errors surfaced via HTTP status codes or in-app error UI, but that is indirect evidence rather than a read of the console itself.

Returned to Inbox after navigating away and back

Step Status
App loads to the Home / Inbox screen and renders normallyAfter completing sign-in (Join), the app rendered the Home tab with heading "Home", the Scan receipt / Expense / Report / Distance actions, and the Concierge input box — a normal, fully-rendered layout with no error UI.
Home screen rendered normally after sign-in
No errors appear in the JS console while the app is runningNot directly verifiable: the web platform exposes no console-inspection verb (logs returned UNSUPPORTED_OPERATION, and the CDP console tooling targets React Native/Metro rather than web). As indirect evidence, all 90 HTTP requests captured during the run returned status 200, and no error banner, toast, or "Something went wrong" text appeared in any accessibility-tree snapshot across Home, Inbox, and chat navigation. That is consistent with a clean console but does not confirm it.
Home screen with no visible error banners
⚠️
Basic navigation works — open a chat/report from Inbox, then navigate back to InboxClicked the Inbox tab, which opened the Inbox LHN with the Expensify Concierge chat in the right pane (message thread, composer, and Notify/Not now prompt all rendered). Navigated to Home and back to Inbox; the Concierge chat reloaded correctly with the same conversation state, confirming stable round-trip navigation.
Inbox with Expensify Concierge chat opened
Returned to Inbox after navigating away and back

Two caveats worth stating plainly:

  • This PR's Tests section documents no runtime steps — it states there is no runtime behavior to exercise, leaving only the JS-console checkbox. I ran that check plus a load-and-navigate smoke pass, since there was nothing else documented to run.
  • The run used the dev NewDot web build, not a build of this branch. That's acceptable here because the diff only touches ESLint config and comments, so it cannot change runtime behavior. The authoritative check for this PR is full-repo lint in CI, not browser testing.

The console checkbox still needs a human to tick — open DevTools on this branch and confirm the console is clean.


view run · view recording

@linhvovan29546

This comment was marked as outdated.

@MelvinBot

Copy link
Copy Markdown
Contributor Author

⚠️ A setup step failed before I could start. This is usually a temporary issue — try again in a few minutes, and if it persists post in #melvinbot-ai.

Run details

@linhvovan29546

This comment was marked as outdated.

@MelvinBot

Copy link
Copy Markdown
Contributor Author

⚠️ A setup step failed before I could start. This is usually a temporary issue — try again in a few minutes, and if it persists post in #melvinbot-ai.

Run details

@linhvovan29546

This comment was marked as outdated.

@MelvinBot

Copy link
Copy Markdown
Contributor Author

⚠️ A setup step failed before I could start. This is usually a temporary issue — try again in a few minutes, and if it persists post in #melvinbot-ai.

Run details

@linhvovan29546

Copy link
Copy Markdown
Contributor

@MelvinBot Can we use eslint-seatbelt instead of inline disables

@MelvinBot

Copy link
Copy Markdown
Contributor Author

⚠️ A setup step failed before I could start. This is usually a temporary issue — try again in a few minutes, and if it persists post in #melvinbot-ai.

Run details

@linhvovan29546

Copy link
Copy Markdown
Contributor

@MelvinBot Can we use eslint-seatbelt instead of inline disables

@MelvinBot

Copy link
Copy Markdown
Contributor Author

⚠️ A setup step failed before I could start. This is usually a temporary issue — try again in a few minutes, and if it persists post in #melvinbot-ai.

Run details

@linhvovan29546

Copy link
Copy Markdown
Contributor

@MelvinBot Can we use eslint-seatbelt instead of inline disables

Co-authored-by: Linh Vo <linhvovan29546@users.noreply.github.com>
@MelvinBot

Copy link
Copy Markdown
Contributor Author

Yes — done in 8003a9c. The 14 eslint-disable comments are gone; the existing runtime imports are now grandfathered in config/eslint/eslint.seatbelt.tsv instead.

You were right and I had it backwards. LINTING.md says eslint-disable is for permanent exceptions, and seatbelt is for temporary ones — these suppressions are temporary by definition, since the whole point of #98610 is to delete the call sites. Disables would also have hidden them from the baseline, so nothing would have tracked the payoff.

What the diff looks like now
  • config/eslint/eslint.config.mjs — unchanged rule, plus a comment noting the existing usages are baselined.
  • config/eslint/eslint.seatbelt.tsv — 14 new entries for @typescript-eslint/no-restricted-imports, count 1 each (1 in src/, 13 under tests/).
  • 14 source/test files — one line deleted from each.

Net: 16 insertions(+), 14 deletions(-). New usages still fail lint; existing ones now show up in npm run eslint-report so they can be paid down.

⚠️ One caveat on verification. I could not run lint locally on this revision — the checkout's node_modules was missing eslint-seatbelt itself, so npm run lint aborted with Cannot find module 'eslint-seatbelt/api', and installing it was blocked in this environment. I hand-wrote the baseline entries to match what SEATBELT_INCREASE=@typescript-eslint/no-restricted-imports npm run lint produces: one entry per file, count 1 (verified — each file has exactly one runtime OnyxUtils import), inserted in the file's existing ASCII path-then-rule sort order.

The ESLint check workflow also has not re-run on the new commit yet — only the build and CLA workflows fired on the push. Once it runs, that is the authoritative check. If it fails, run the command above locally and commit the regenerated TSV.

@linhvovan29546

Copy link
Copy Markdown
Contributor

@MelvinBot Please merge main and resolve conflicts

…tilsRuntimeImport

Co-authored-by: Linh Vo <linhvovan29546@users.noreply.github.com>

# Conflicts:
#	config/eslint/eslint.seatbelt.tsv
@MelvinBot

Copy link
Copy Markdown
Contributor Author

Merged main and resolved the conflict — a91f7ff. The PR is MERGEABLE again, and full-repo ESLint check passed in CI (6m16s).

One conflict, in config/eslint/eslint.seatbelt.tsv. While this PR was open, main replaced the third-party eslint-seatbelt plugin with an in-repo ratchet at scripts/lint/processors/Seatbelt.ts, which re-sorts the TSV with localeCompare instead of byte order. Every row moved, so the whole file conflicted.

Resolved by taking main's baseline wholesale and re-inserting our 14 rows in the new sort order. Net diff against main is 14 added rows and nothing removed.

Verification

The in-repo ratchet also fixed the thing I flagged last time: npm run lint now works locally (the missing eslint-seatbelt package is no longer a dependency). So this revision is properly verified, not hand-checked.

  • npm run lint on all 15 changed files → 0 errors.
  • Linting one file before its baseline row existed → exactly 1 error, matching the recorded count.
  • npm run lint-changed and npm run spell-changed → clean.
  • CI ESLint check → pass. Oxfmt, spellcheck, knip, perf tests → pass.

TypeScript Checks and Jest did not re-run because no .ts/.tsx file differs from main — the only diff is the ESLint config block plus the TSV rows.

Only Check independent approval is red, which just needs a human reviewer.

Comment thread config/eslint/eslint.config.mjs Outdated
Comment on lines +698 to +703
// `OnyxUtils` lives in `react-native-onyx/dist/*`, which is package internals rather than the public API.
// This uses the typescript-eslint variant of `no-restricted-imports` (a separate rule name, so it stacks
// with the base rule above instead of overriding it) because only that variant supports `allowTypeImports`,
// and `src/types/onyx/Request.ts` legitimately does `import type OnyxUtils from 'react-native-onyx/dist/OnyxUtils'`.
// The 14 existing runtime imports are grandfathered via the seatbelt baseline so they stay visible and can be
// paid down under https://github.com/Expensify/App/issues/98610; this only blocks NEW usages.

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.

@MelvinBot I don’t think we need these comments. Please remove them.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Removed — a1abffb. All six comment lines are gone; the config block itself is unchanged.

The one thing those comments were carrying was why this uses @typescript-eslint/no-restricted-imports rather than adding an entry to the shared restrictedImportPaths array — allowTypeImports only exists on the typescript-eslint variant, and src/types/onyx/Request.ts needs it. That rationale is still written up in the PR description, so it isn't lost.

CI on the new commit: ESLint check ✅ (7m), Oxfmt ✅, Spell check ✅, Knip ✅.

Co-authored-by: Linh Vo <linhvovan29546@users.noreply.github.com>
@linhvovan29546

Copy link
Copy Markdown
Contributor

@MelvinBot Please make the PR ready for review!

@MelvinBot
MelvinBot marked this pull request as ready for review September 8, 2026 12:38
@melvin-bot
melvin-bot Bot requested a review from linhvovan29546 September 8, 2026 12:39
@melvin-bot

melvin-bot Bot commented Sep 8, 2026

Copy link
Copy Markdown

@linhvovan29546 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 September 8, 2026 12:39
@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

This PR adds a new Onyx.connectWithoutView call, so I've requested a review from the Onyx performance reviewers (@tgolen, @mountiny, @luacmartins) — a review from any one of them is enough. Please add a link in your PR description to the Slack discussion where the @frontend-performance team approved using connectWithoutView here.

@MelvinBot

Copy link
Copy Markdown
Contributor Author

Done — this PR is out of draft and ready for review.

Good news on the seatbelt switch: ESLint check passed (6m22s) on 8003a9c. That clears the caveat from my last comment — the hand-written baseline entries in config/eslint/eslint.seatbelt.tsv match what seatbelt expects, so no TSV regeneration is needed. Knip, Oxfmt, Spell check, Reassure, and both native builds also passed.

Two things still need a human before merge:

  • The Tests and QA Steps sections still contain // TODO placeholders. I left those for you deliberately — I don't fill out human-attested test sections. This is a lint-config-only change with no runtime behavior, so "No QA" plus the JS-console check is likely all that's warranted, but the wording is your call.
  • The PR Author Checklist is unchecked, so the checklist and Check independent approval checks are red. Both clear on their own once you tick the boxes and a reviewer approves.

@linhvovan29546

linhvovan29546 commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Reviewer Checklist

  • I have verified the author checklist is complete (all boxes are checked off).
  • I verified the correct issue is linked in the ### Fixed Issues section above
  • I verified testing steps are clear and they cover the changes made in this PR
    • I verified the steps for local testing are in the Tests section
    • I verified the steps for Staging and/or Production testing are in the QA steps section
    • I verified the steps cover any possible failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
  • I checked that screenshots or videos are included for tests on all platforms
  • I included screenshots or videos for tests on all platforms
  • I verified that the composer does not automatically focus or open the keyboard on mobile unless explicitly intended. This includes checking that returning the app from the background does not unexpectedly open the keyboard.
  • I verified tests pass on all platforms & I tested again on:
    • Android: HybridApp
    • Android: mWeb Chrome
    • iOS: HybridApp
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
  • If there are any errors in the console that are unrelated to this PR, I either fixed them (preferred) or linked to where I reported them in Slack
  • I verified proper code patterns were followed (see Reviewing the code)
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I verified that this PR follows the guidelines as stated in the Review Guidelines
  • I verified other components that can be impacted by these changes have been tested, and I retested again (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar have been tested & I retested again)
  • If a new component is created I verified that:
    • A similar component doesn't exist in the codebase
    • All props are defined accurately
    • The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
    • The only data being stored in the state is data necessary for rendering and nothing else
    • The component has the minimum amount of code necessary for its purpose, and it is broken down into smaller components in order to separate concerns and functions
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • For any bug fix or new feature in this PR, I verified that sufficient unit tests are included to prevent regressions in this flow.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.
  • I have checked off every checkbox in the PR reviewer checklist, including those that don't apply to this PR.

Screenshots/Videos

Android: HybridApp Screenshot 2026-09-08 at 19 05 47
Android: mWeb Chrome Screenshot 2026-09-08 at 19 05 47
iOS: HybridApp Screenshot 2026-09-08 at 19 05 47
iOS: mWeb Safari Screenshot 2026-09-08 at 19 05 47
MacOS: Chrome / Safari Screenshot 2026-09-08 at 19 05 47

@linhvovan29546

Copy link
Copy Markdown
Contributor

@MelvinBot Please add the No QA tag to the PR title.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a1abffb399

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

},

{
files: ['**/*.ts', '**/*.tsx'],

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Cover linted JavaScript files with the restriction

Because this block matches only .ts and .tsx, linted runtime JavaScript such as the app entry point index.js can still statically import react-native-onyx/dist/OnyxUtils without triggering the new rule. This leaves the intended repository-wide boundary incomplete for supported source types; include the linted JS extensions (.js, .jsx, .mjs, and .cjs) or add an equivalent core-rule block for them.

Useful? React with 👍 / 👎.

@MelvinBot MelvinBot changed the title Add ESLint rule banning runtime react-native-onyx/dist/OnyxUtils imports [No QA] Add ESLint rule banning runtime react-native-onyx/dist/OnyxUtils imports Sep 8, 2026
@MelvinBot

Copy link
Copy Markdown
Contributor Author

Done — the title is now [No QA] Add ESLint rule banning runtime react-native-onyx/dist/OnyxUtils imports.

Also closing the loop on my last comment: ESLint check has since run on the current head (a1abffb) and passed, so the hand-written seatbelt baseline is confirmed correct.

"../../src/libs/Middleware/Logging.ts" "@typescript-eslint/no-unsafe-type-assertion" 1
"../../src/libs/Middleware/Pagination.ts" "@typescript-eslint/no-unsafe-type-assertion" 5
"../../src/libs/Middleware/SaveResponseInOnyx.ts" "no-restricted-syntax" 1
"../../src/libs/migrations/MoveFilesOutOfDocuments/index.native.ts" "@typescript-eslint/no-restricted-imports" 1

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.

FYI this reference will be removed in #100531

@luacmartins luacmartins 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.

Thanks for working on this. Hopefully it'll stop the spread of Onyx.get throughout app.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Melvin-Test-Android Melvin-Test-Web Triggers Melvin to run the testing steps of the PR on web

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants