Skip to content

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

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

LukasMod wants to merge 6 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 4.0.21.

  • oxlint.config.mts builds the config from the package presets with buildOxlintConfig() (Expensify/eslint-config-expensify#214) and adds only Onyx's own ignores, settings and overrides. No rules are copied here.
  • 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 (678, mostly type-safety rules in tests) are 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.
  • CI: lint.yml runs on pull requests and is called by publish.yml on push to main, so a failing lint blocks publishing. If the merge fixed baselined errors, that run commits the lowered baseline as os-botify before the version bump. This only runs on a real push to main, so it is untested until the first merge.
  • tsconfig.json uses moduleResolution: bundler because type-aware Oxlint rejects node. tsconfig.build.json and .github/actions/javascript/tsconfig.json keep CommonJS, so the build output is unchanged.
  • No runtime changes: lib/ only has comment updates and drops an unused react-native-nitro-sqlite/mock type declaration.

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) and 1 no-unnecessary-type-assertion.

Related Issues

Expensify/App#105688

Linked E/App PR

Expensify/App#107001

Automated Tests

  • config/oxlint/seatbelt.test.mjs: 9 tests for the seatbelt ratchet (npm run test:lint, added to the test workflow).
  • Existing Jest suite (788 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: 9 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-16T14:12:23.689771Z 6249880 Draft marked ready
ℹ️ 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
@LukasMod
LukasMod force-pushed the LukasMod/experiment-oxlint-parity-no-seatbelt branch from 8b34945 to 9d08b6d Compare November 16, 2026 09:19
@LukasMod

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: 9d08b6def9

ℹ️ 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

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@LukasMod

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@LukasMod
LukasMod marked this pull request as ready for review November 16, 2026 14:06

@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: 62498806e4

ℹ️ 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".

continue-on-error: true
run: |
file=config/oxlint/oxlint.seatbelt.tsv
[ "$(git ls-remote origin main | cut -f1)" = "$GITHUB_SHA" ] || { echo "::notice::main moved, skipping"; exit 0; }

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 Make the main-head check atomic with the baseline PUT

If another push advances main after this check but before the PUT, the request still writes to branch=main; its sha is HEAD:$file, and gh api --help defines --field as “Add a typed parameter in key=value format,” not a precondition on the branch ref. The stale run can therefore lower the baseline beneath diagnostics added by the concurrent push; its bot push is skipped, while that push's run can already have checked out its event SHA and skip saving after seeing the bot commit, leaving subsequent main lint failing. Use an atomic ref compare-and-swap or re-lint the latest main before writing. Fresh evidence: this change adds only a separate preflight ls-remote, so the interval before the PUT remains racy.

Useful? React with 👍 / 👎.

@LukasMod LukasMod Nov 16, 2026 •

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.

Yes, there is a small window between the check and the PUT. The gap is about few seconds probably, and the closest merges to main in the recent run history were about two minutes apart, so closing it probably isn’t worth the extra code. If it ever happens, main goes red and the fix is to raise the baseline. EApp avoids it with git push, which needs secrets Onyx doesn’t have yet, so I would skip this case

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

Otherwise all LGTM 👍🏼

concurrency: ${{ github.workflow }}

jobs:
lint:

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.

Not sure we need to lint in publish if we weren't before?

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