Skip to content

Comments

refactor(linter): move oxlint application code into separate module#13745

Merged
graphite-app[bot] merged 1 commit intomainfrom
09-13-refactor_linter_move_oxlint_application_code_into_separate_module
Sep 13, 2025
Merged

refactor(linter): move oxlint application code into separate module#13745
graphite-app[bot] merged 1 commit intomainfrom
09-13-refactor_linter_move_oxlint_application_code_into_separate_module

Conversation

@overlookmotel
Copy link
Member

@overlookmotel overlookmotel commented Sep 13, 2025

Pure refactor. Move code for running the linter in oxlint into a separate run.rs module. This is preparation for making oxlint into a NAPI package (#13723).

@github-actions github-actions bot added A-cli Area - CLI C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior labels Sep 13, 2025
Copy link
Member Author

overlookmotel commented Sep 13, 2025


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@overlookmotel overlookmotel marked this pull request as ready for review September 13, 2025 14:33
Copilot AI review requested due to automatic review settings September 13, 2025 14:33
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors the oxlint application by extracting the main linter execution logic into a separate run.rs module. This is a preparatory change for making oxlint into a NAPI package.

  • Moved the lint function and helper functions from lib.rs to a new run.rs module
  • Updated lib.rs to re-export the lint function from the new module
  • Cleaned up imports in lib.rs by removing unused dependencies

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
apps/oxlint/src/run.rs New module containing the main lint function and initialization helpers moved from lib.rs
apps/oxlint/src/lib.rs Updated to add the new run module and re-export the lint function, with cleanup of moved code

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@overlookmotel
Copy link
Member Author

Thanks Cam!

@overlookmotel overlookmotel self-assigned this Sep 13, 2025
@overlookmotel overlookmotel added the 0-merge Merge with Graphite Merge Queue label Sep 13, 2025
Copy link
Member Author

overlookmotel commented Sep 13, 2025

Merge activity

…#13745)

Pure refactor. Move code for running the linter in `oxlint` into a separate `run.rs` module. This is preparation for making `oxlint` into a NAPI package (#13723).
@graphite-app graphite-app bot force-pushed the 09-13-refactor_linter_move_oxlint_application_code_into_separate_module branch from ca7bf56 to 7346099 Compare September 13, 2025 14:44
@graphite-app graphite-app bot merged commit 7346099 into main Sep 13, 2025
17 checks passed
@graphite-app graphite-app bot deleted the 09-13-refactor_linter_move_oxlint_application_code_into_separate_module branch September 13, 2025 14:49
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Sep 13, 2025
This was referenced Sep 16, 2025
camc314 added a commit that referenced this pull request Sep 16, 2025
## [1.16.0] - 2025-09-16

### 🚀 Features

- 97c8d06 linter: Add `preserve-caught-error` rule (#13748) (孔辉)
- 8c19b18 linter/exhaustive-deps: Implement fixer for dep in global
scope (#13783) (camc314)
- 06bce8f linter/exhaustive-deps: Implement fixer for missing dep
(#13782) (camc314)
- a8675f4 linter: Add eslint/class-methods-use-this rule (#12977) (Peter
Cardenas)
- db33196 parser: Adds typescript rule for empty argument list (#13730)
(Karan Kiri)
- 2751193 linter: Add `eslint/no-useless-computed-key` rule (#13428)
(yefan)
- 9a205d1 regex-parser: Parse simple `TemplateLiterals` (#13265) (Sysix)

### 🐛 Bug Fixes

- a2c91cd linter: Drop `rules` to allow mutable access to `ctx_host` in
`run_external_rules` (#13832) (camc314)
- 3af1e5d linter/no-unsafe-declaration-merging: Always mark first span
as primary (#13830) (camc314)
- 1c43c7c linter: Keep message when merging composite fixes (#13827)
(camc314)
- 26af302 linter/exhaustive-deps: Check stable value is on lhs of
assignment expr (#13815) (camc314)
- 4bc12d0 linter/exhaustive-deps: Remove impossible comparison with
parent kind (#13814) (camc314)
- 12baf5e linter/exhaustive-deps: Respect primary span when identifying
disable directive location (#13781) (camc314)
- fa7400a linter/no-undef: False positive with `arguments` in functions
(#13763) (camc314)
- 50e6e3c editor: Restrict servers paths for `oxc.path.server` (#13740)
(Sysix)
- b45077d editor: Strip leading slash for bin path on windows (#13738)
(Sysix)
- 8fa6227 editor: Don't allow `oxc.path.server` for untrusted workspaces
(#13734) (Sysix)
- 56da114 linter/react/jsx-handler-names: Do not detect the function
name within the inline-function's body block (#13456) (Takuji Shimokawa)
- b2bc5b4 linter/react-perf/jsx-no-new-object-as-prop: Skip as/satisfies
exprs (#13718) (camc314)
- ab51394 raw_transfer: Disable layout assertions on some 32-bit
platforms (#13716) (overlookmotel)
- 09428f6 linter/plugins: Remove outdated comment (#13691)
(overlookmotel)
- a294721 linter/plugins: Exit early if JS plugins enabled on
unsupported platforms (#13689) (overlookmotel)
- 68a2280 linter/plugins: More graceful exit for
`--experimental-js-plugins` CLI option (#13688) (overlookmotel)

### 🚜 Refactor

- 395d40d linter: Derive inmpls for `PartialEq`, `Eq` over manual ones
(#13828) (camc314)
- 8e4cd8f linter/func-names: Use `run_once` over looping over all nodes
(#13798) (camc314)
- 7f4e2fe eslint/func-names: Clean up implementation and improve
documentation (#13601) (Antoine Zanardi)
- 137896a language_server: Split options for linting and formatting
(#13627) (Sysix)
- 7346099 linter: Move `oxlint` application code into separate module
(#13745) (overlookmotel)
- 6dd4107 linter: Remove `#[cfg(test)]` attributes from `tester` module
(#13714) (overlookmotel)
- c40c6ef linter/plugins: Directory for JS plugins-related code (#13701)
(overlookmotel)
- a0022c1 linter/plugins: Improve error messages for JS plugins (#13699)
(overlookmotel)
- 1fd993f napi/oxlint: Rename `napi/oxlint2` to `napi/oxlint` (#13682)
(overlookmotel)

### ⚡ Performance

- 90c8286 linter: Detect node types from `let..else` statements (#13690)
(camchenry)
- 08c05df semantic: Make CFG construction a compile-time feature
(#13678) (Boshen)

### 🎨 Styling

- 99a7638 linter: Add comments + re-organise imports (#13715)
(overlookmotel)

### 🧪 Testing

- 18a1145 linter: Add debug assertions for skipping rules (#13724)
(camc314)
- cb080de linter/no-unused-vars: Add test for non ASCII chars in JSX
components (#13820) (camc314)
- b6eba27 linter/no-undef: Add more test cases for `arguments` (#13764)
(camc314)
- fb2d087 linter: Set CWD for tests (#13722) (overlookmotel)

Co-authored-by: camc314 <18101008+camc314@users.noreply.github.com>
graphite-app bot pushed a commit that referenced this pull request Sep 17, 2025
Convert `oxlint` to a NAPI package.

This PR:

1. Moves files from `napi/oxlint` into `apps/oxlint`.
2. Converts `oxlint` into a NAPI package.
3. Alters the [release workflow](https://github.com/oxc-project/oxc/pull/13723/files#diff-80cb497c859bbaf7756da6ced2bca3d31933affc96102983eee1ad7d4bcc60fd) and [script](https://github.com/oxc-project/oxc/pull/13723/files#diff-4c4b7045c68805aeeae7c0af94cf7cf7487cb0403496da974a6a23accdc457d0) for building `oxlint` packages.

Most of necessary code modifications and refactoring was done in previous PRs (#13701, #13712, #13722, #13745), so this PR only includes changes necessary for packaging as NAPI.

I've done my best to update release workflow, but am mostly "flying blind" without ability to test it, so very likely there are mistakes.

A few notes and oddities:

* I've kept the `oxlint` NPM package as CommonJS. We could probably switch to ESM, but I thought it better to minimize the changes in this PR.
* NAPI-RS creates `.node` files named with a `-msvc` postfix for Windows. The scripts here remove that postfix so that filename of `.node` files and NPM package names match for all platforms, for simplicity.
* `tasks/website` has a dependency on `oxlint` as a normal library. This resulted in linker errors, so have had to put all the NAPI stuff behind `napi` cargo feature. Tests for `tasks/website` are run separately in CI, to avoid feature unification turning on the `napi` feature for `website`.

I've made a few comments below for the parts which aren't fairly self-explanatory.
@overlookmotel overlookmotel added the A-linter Area - Linter label Sep 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-cli Area - CLI A-linter Area - Linter C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants