Skip to content

[NoQA] Oxlint with eslint-config-expensify - #889

Draft
LukasMod wants to merge 44 commits into
Expensify:mainfrom
callstack-internal:LukasMod/experiment-oxlint-parity-no-seatbelt
Draft

LukasMod wants to merge 44 commits into
Expensify:mainfrom
callstack-internal:LukasMod/experiment-oxlint-parity-no-seatbelt

Conversation

@LukasMod

@LukasMod LukasMod commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Details

Moves Onyx's linting from ESLint to Oxlint, using the rules from eslint-config-expensify.

  • oxlint.config.mts calls buildOxlintConfig() from eslint-config-expensify (Expensify/eslint-config-expensify#214) with the presets Onyx uses, and adds only Onyx's own ignores, settings and overrides. New or changed rules come from bumping eslint-config-expensify; no rules are copied here. Expensify/App#106218 does the same for App.
  • Until Update Onyx.clear to accept passed in keys to preserve, and use multiSet to clear storage #214 is released, eslint-config-expensify is installed from that PR's commit on GitHub. Before merging, it gets swapped for the released version.
  • import/named and import/export run as Oxlint's own rules. Onyx has no findings from either.
  • Rules Oxlint doesn't have run with ESLint's own code inside Oxlint. If a preset brings a rule that can't run, or oxlint.config.mts names a rule as ESLint spells it although it runs as core/ or hosted/, the config fails to load with a message saying what to change. Other wrong names fail with Oxlint's own error.
  • eslint.config.mjs is removed and npm run lint runs Oxlint 1.92 with type-aware rules. The ESLint packages stay installed because the presets and those rules need them.
  • Existing violations (681, mostly typescript-eslint type-safety rules, three quarters of them in tests) are listed in a seatbelt baseline, config/oxlint/oxlint.seatbelt.tsv, the same setup as in E/App. New errors fail CI, and fixing errors lowers the allowed count. After a merge, the lint job on main commits the lowered baseline as os-botify.
  • Overrides that add to a preset's options (the tests naming-convention list, the TypeScript no-unused-vars options) start from getPresetRuleEntry() from the package instead of copying the preset's settings.
  • Onyx skips the expensify preset, as before. A few rules the old ESLint config set are restored in oxlint.config.mts: import/no-unresolved on TypeScript files, and no-unused-vars again accepts parameters named with a leading _. Three seatbelt rows for such parameters went away.
  • oxlint.config.mts and the scripts in config/oxlint/ are linted too, with Node globals and the browser-compatibility es/* rules turned off.
  • tsconfig.json uses moduleResolution: bundler because tsgolint (type-aware Oxlint) rejects node. tsconfig.build.json and .github/actions/javascript/tsconfig.json keep CommonJS, so the library build and the GitHub Action bundles come out as before.
  • No runtime changes: lib/ only has comment updates and drops an unused react-native-nitro-sqlite/mock type declaration. dist/ built from this branch differs from main only in comment lines.

19 of the 681 are in tests added on main after the parity measurement below. main's ESLint config does not enable no-unsafe-assignment, no-unsafe-call, no-unsafe-member-access, no-unsafe-type-assertion or no-unnecessary-type-assertion, so ESLint never flagged them, while the oxlint config does.

Parity with ESLint, measured before ESLint was removed: all 665 Oxlint findings match ESLint's. ESLint reported 48 more: 47 rulesdir/prefer-at (Oxlint uses unicorn/prefer-at, which catches fewer cases, as in E/App) and 1 no-unnecessary-type-assertion. Moving to buildOxlintConfig and Oxlint 1.92 kept the findings the same, apart from the 3 _ parameters above: SEATBELT_FROZEN=1 npm run lint passes, also with the latest package commit.

Related Issues

N/A, lint tooling change discussed with Rory in Slack.

Linked E/App PR

N/A, lint tooling only. No runtime code changes, so there is nothing to verify in E/App.

Automated Tests

  • config/oxlint/seatbelt.test.mjs: 19 tests for the seatbelt ratchet (npm run test:lint, added to the test workflow).
  • Existing Jest suite (771 tests), typecheck and test:types pass unchanged.

Manual Tests

[No QA]: lint tooling only, no runtime changes. Local checks:

  1. npm ci, then npm run lint: prints 0 errors.
  2. Add console.log('test'); to lib/utils.ts and run npm run lint: fails with no-console. Revert.
  3. In config/oxlint/oxlint.seatbelt.tsv, raise one row's count by 1 and run CI=true npm run lint: passes and rewrites the row back to the real count (what the main job commits). Revert.
  4. npm run test:lint: 19 tests pass.

Author Checklist

  • I linked the correct issue in the ### Related Issues section above
  • I linked the corresponding Expensify/App PR in the ### Linked E/App PR section above, and verified this change against it (E/App CI passed and manual testing completed)
  • I wrote clear testing steps that cover the changes made in this PR
    • I added steps for local testing in the Tests section
    • 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 / Chrome
    • iOS / native
    • iOS / 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 any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick)
    • I verified that the left part of a conditional rendering a React component is a boolean and NOT a string, e.g. myBool && <MyComponent />.
    • 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 proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
    • I verified the JSDocs style guidelines (in STYLE.md) were followed
  • 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)
  • I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
  • I verified any variables that can be defined as constants (ie. in CONST.js or at the top of the file that uses the constant) are defined as such
  • I verified that if a function's arguments changed that all usages have also been updated correctly
  • If a new component is created I verified that:
    • A similar component doesn't exist in the codebase
    • All props are defined accurately and each prop has a /** comment above it */
    • The file is named correctly
    • 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
    • If we are not using the full Onyx data that we loaded, I've added the proper selector in order to ensure the component only re-renders when the data it is using changes
    • For Class Components, any internal methods passed to components event handlers are bound to this properly so there are no scoping issues (i.e. for onClick={this.submit} the method this.submit should be bound to this in the constructor)
    • Any internal methods bound to this are necessary to be bound (i.e. avoid this.submit = this.submit.bind(this); if this.submit is never passed to a component event handler like onClick)
    • All JSX used for rendering exists in the render method
    • 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 any new file was added I verified that:
    • The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
  • 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 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 author checklist, including those that don't apply to this PR.

Screenshots/Videos

N/A, no UI or runtime changes.

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

@LukasMod

LukasMod commented Nov 6, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-09T16:13:16.419540Z 6679091 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@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: eee5353330

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread tsconfig.json Resolved
@LukasMod

LukasMod commented Nov 7, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@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: 9de42e92b5

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .github/workflows/lint.yml Resolved
@LukasMod LukasMod changed the title Oxlint with eslint-config-expensify to 4.0.19 [NoQA] Oxlint with eslint-config-expensify to 4.0.19 Nov 9, 2026
@LukasMod LukasMod changed the title [NoQA] Oxlint with eslint-config-expensify to 4.0.19 [NoQA] Oxlint with eslint-config-expensify Nov 9, 2026
@LukasMod

LukasMod commented Nov 9, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@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: 6679091351

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread package.json Resolved
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.

1 participant