Skip to content

Conversation

@overlookmotel
Copy link
Member

@overlookmotel overlookmotel commented Jul 17, 2025

First working prototype of JS linter plugins.

Rust now passes the AST to JS via buffer, and lint rule runner uses the JS rule's provided visitor to traverse the AST using lazy deserialization.

Only a single rule is supported at present.

Before anyone gets too excited, this is very much unfinished! It's incomplete, the AST is not compliant with ESTree, and it's not well tested. Really this is a proof of concept more than a usable feature at present. But we'll get there...

Copy link
Member Author

overlookmotel commented Jul 17, 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.

@graphite-app graphite-app bot force-pushed the 07-16-refactor_linter_pass_allocator_into_linter_run_ branch from 85db259 to 822eb6c Compare July 17, 2025 09:22
@graphite-app graphite-app bot force-pushed the 07-17-feat_napi_oxlint_pass_ast_in_buffer_to_js branch from 57c093f to 6a8df5d Compare July 17, 2025 09:23
@graphite-app graphite-app bot force-pushed the 07-16-refactor_linter_pass_allocator_into_linter_run_ branch from 822eb6c to c6941c8 Compare July 17, 2025 15:00
@overlookmotel overlookmotel changed the base branch from 07-16-refactor_linter_pass_allocator_into_linter_run_ to graphite-base/12350 July 18, 2025 02:47
@overlookmotel overlookmotel force-pushed the 07-17-feat_napi_oxlint_pass_ast_in_buffer_to_js branch from 6a8df5d to 4cecb6b Compare July 18, 2025 02:47
@overlookmotel overlookmotel changed the base branch from graphite-base/12350 to 07-17-refactor_linter_napi_parser_add_source_len_field_to_rawtransfermetadata_ July 18, 2025 02:47
@codspeed-hq
Copy link

codspeed-hq bot commented Jul 18, 2025

CodSpeed Instrumentation Performance Report

Merging #12350 will not alter performance

Comparing 07-17-feat_napi_oxlint_pass_ast_in_buffer_to_js (6d2b549) with main (c5dff1e)

Summary

✅ 34 untouched benchmarks

@overlookmotel overlookmotel marked this pull request as ready for review July 18, 2025 02:56
@overlookmotel overlookmotel requested a review from camc314 as a code owner July 18, 2025 02:56
@overlookmotel overlookmotel force-pushed the 07-17-feat_napi_oxlint_pass_ast_in_buffer_to_js branch from 4cecb6b to 1192531 Compare July 18, 2025 02:58
@graphite-app graphite-app bot changed the base branch from 07-17-refactor_linter_napi_parser_add_source_len_field_to_rawtransfermetadata_ to graphite-base/12350 July 18, 2025 09:02
@graphite-app graphite-app bot force-pushed the graphite-base/12350 branch from 77b2953 to c5dff1e Compare July 18, 2025 09:16
@graphite-app graphite-app bot force-pushed the 07-17-feat_napi_oxlint_pass_ast_in_buffer_to_js branch from 1192531 to e5603c1 Compare July 18, 2025 09:16
@graphite-app graphite-app bot changed the base branch from graphite-base/12350 to main July 18, 2025 09:17
@graphite-app graphite-app bot force-pushed the 07-17-feat_napi_oxlint_pass_ast_in_buffer_to_js branch from e5603c1 to 8b4d616 Compare July 18, 2025 09:17
@camc314 camc314 added the 0-merge Merge with Graphite Merge Queue label Jul 18, 2025
Copy link
Contributor

camc314 commented Jul 18, 2025

Merge activity

First working prototype of JS linter plugins.

Rust now passes the AST to JS via buffer, and lint rule runner uses the JS rule's provided visitor to traverse the AST using lazy deserialization.

Only a single rule is supported at present.

Before anyone gets too excited, this is very much unfinished! It's incomplete, the AST is not compliant with ESTree, and it's not well tested. Really this is a proof of concept more than a usable feature at present. But we'll get there...
@graphite-app graphite-app bot force-pushed the 07-17-feat_napi_oxlint_pass_ast_in_buffer_to_js branch from 8b4d616 to 6d2b549 Compare July 18, 2025 09:32
@graphite-app graphite-app bot merged commit 6d2b549 into main Jul 18, 2025
26 checks passed
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Jul 18, 2025
@graphite-app graphite-app bot deleted the 07-17-feat_napi_oxlint_pass_ast_in_buffer_to_js branch July 18, 2025 09:40
This was referenced Jul 20, 2025
camc314 added a commit that referenced this pull request Jul 22, 2025
## [1.8.0] - 2025-07-22

### 🚀 Features

- 6d2b549 napi/oxlint: Pass AST in buffer to JS (#12350) (overlookmotel)
- 14f0159 linter/exhaustive-deps: Add auto-fixer (#12354) (Don Isaac)

### 🐛 Bug Fixes

- 99e105f linter: Correct autofix in `unicorn/prefer-number-properties`
for Infinity (#12445) (yefan)
- 0b539e3 linter: `unicorn/catch-error-name` wasn't using the ignore
property (#12446) (Parbez)
- 05fba9b linter: Don't panic on `TSNonNullExpression` in
`unicorn/prefer-array-find` (#12400) (Sysix)
- 46e33d5 linter: Improve error handling in config file lookup (#12391)
(camc314)
- 4621872 linter: Parse second script block for `svelte` files (#12390)
(Sysix)
- fbe7eb4 linter/filename-case: Fix default config when no config is
provided (#12389) (camc314)
- fea9df4 linter: Report errors with the correct severity for custom
plugins (#12362) (camc314)
- 652c038 linter: Mark correctly enabled default rules for `--rules`
(#12163) (Sysix)
- eadc359 linter: Correct source text for vue files having script
attributes containig ">" char inside (#12375) (Sysix)
- 54d143a linter/exhaustive-deps: More descriptive messages for
always-rerender violations (#12336) (Don Isaac)
- dac4db9 linter/exhaustive-deps: Better diagnostics for missing
dependencies (#12337) (Don Isaac)
- 119d23a linter/prefer-array-flat-map: Error for `.flat(1.0)` (#12360)
(overlookmotel)

### 🚜 Refactor

- 2d9291c linter/prefer-number-properties: Simplify fixer logic (#12451)
(camc314)
- c5dff1e linter, napi/parser: Add `source_len` field to
`RawTransferMetadata` (#12383) (overlookmotel)
- 5e3b415 linter: Duplicate `RawTransferMetadata` in `oxc_linter` crate
(#12382) (overlookmotel)
- 773fd88 linter: Pass `&Allocator` into `Linter::run_external_rules`
(#12374) (overlookmotel)
- b10ed11 linter: Make unwrap unconditional (#12371) (overlookmotel)
- a0631d4 linter: Move running external rules into feature-gated
function (#12370) (overlookmotel)
- 4fc4e7c linter: Make feature gates for `oxlint2` feature consistent
(#12369) (overlookmotel)
- 50b1786 linter: Clarify usage of `Allocator` and `AllocatorGuard`
(#12332) (overlookmotel)
- 26d3a39 linter: Remove `ModuleContentOwner` abstraction (#12331)
(overlookmotel)

### 📚 Documentation

- 3c21d94 linter: Correct comment on `RawTransferMetadata2` type
(#12428) (overlookmotel)

Co-authored-by: camc314 <18101008+camc314@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-ast-tools Area - AST tools A-linter Area - Linter C-enhancement Category - New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants