Commit Graph

25 Commits

Author SHA1 Message Date
Boshen 1193c9dbaf chore(oxfmt): dogfood operator position at line start (#25937)
dogfood
2026-08-20 14:36:47 +00:00
renovate[bot] 6f47f6f4ed chore(deps): update dependency oxlint to v1.79.0 (#25873)
This PR contains the following updates:

| Package | Change |
[Age](https://docs.renovatebot.com/merge-confidence/) |
[Adoption](https://docs.renovatebot.com/merge-confidence/) |
[Passing](https://docs.renovatebot.com/merge-confidence/) |
[Confidence](https://docs.renovatebot.com/merge-confidence/) |
|---|---|---|---|---|---|
| [oxlint](https://oxc.rs/docs/guide/usage/linter)
([source](https://redirect.github.com/oxc-project/oxc/tree/HEAD/npm/oxlint))
| [`1.78.0` →
`1.79.0`](https://renovatebot.com/diffs/npm/oxlint/1.78.0/1.79.0) |
![age](https://developer.mend.io/api/mc/badges/age/npm/oxlint/1.79.0?slim=true)
|
![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/oxlint/1.79.0?slim=true)
|
![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/oxlint/1.78.0/1.79.0?slim=true)
|
![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/oxlint/1.78.0/1.79.0?slim=true)
|

---

### Release Notes

<details>
<summary>oxc-project/oxc (oxlint)</summary>

###
[`v1.79.0`](https://redirect.github.com/oxc-project/oxc/blob/HEAD/npm/oxlint/CHANGELOG.md#1790---2026-08-18)

##### 💥 BREAKING CHANGES

-
[`8c4552d`](https://redirect.github.com/oxc-project/oxc/commit/8c4552d)
linter: \[**BREAKING**] Split react/react-compiler into per-category
rules
([#&#8203;25500](https://redirect.github.com/oxc-project/oxc/issues/25500))
(Boshen)

##### 🐛 Bug Fixes

-
[`228e8e0`](https://redirect.github.com/oxc-project/oxc/commit/228e8e0)
linter: Resolve inactive React compiler rules
([#&#8203;25830](https://redirect.github.com/oxc-project/oxc/issues/25830))
(Boshen)
-
[`aa49d86`](https://redirect.github.com/oxc-project/oxc/commit/aa49d86)
linter: Allow spread rule options in config types
([#&#8203;25675](https://redirect.github.com/oxc-project/oxc/issues/25675))
(ch3rry)
-
[`36f8451`](https://redirect.github.com/oxc-project/oxc/commit/36f8451)
linter/eslint/no-eval: Align indirect default with ESLint
([#&#8203;25656](https://redirect.github.com/oxc-project/oxc/issues/25656))
(camc314)
-
[`beb724d`](https://redirect.github.com/oxc-project/oxc/commit/beb724d)
linter/eslint/no-unused-vars: Report bare underscore parameters
([#&#8203;25663](https://redirect.github.com/oxc-project/oxc/issues/25663))
(camc314)
-
[`4004c10`](https://redirect.github.com/oxc-project/oxc/commit/4004c10)
linter/eslint/no-irregular-whitespace: Check comments by default
([#&#8203;25660](https://redirect.github.com/oxc-project/oxc/issues/25660))
(camc314)
-
[`285820e`](https://redirect.github.com/oxc-project/oxc/commit/285820e)
linter/no-large-snapshots: Precompile and document allowed snapshot
matchers
([#&#8203;25611](https://redirect.github.com/oxc-project/oxc/issues/25611))
(Mikhail Baev)
-
[`4df5835`](https://redirect.github.com/oxc-project/oxc/commit/4df5835)
linter: Allow capitalized built-in calls
([#&#8203;25516](https://redirect.github.com/oxc-project/oxc/issues/25516))
(Boshen)

</details>

---

### Configuration

📅 **Schedule**: (in timezone Asia/Shanghai)

- Branch creation
  - At any time (no schedule defined)
- Automerge
  - At any time (no schedule defined)

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/oxc-project/oxc).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC4zMi42IiwidXBkYXRlZEluVmVyIjoiNDQuMzIuNiIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Cameron <cameron.clark@hey.com>
2026-08-18 16:07:58 +00:00
overlookmotel cef20b5794 docs(napi/parser): remove erroneous comment (#24730)
Remove a comment which said something that isn't true! ASM analysis shows that the mask does not remove the bounds check on accessing the array.
2026-07-20 18:22:58 +00:00
overlookmotel c2c8f806f9 refactor(napi/parser): raw transfer store source text at end of buffer (#22392)
Oxlint's raw transfer implementation stores the source text at end of the buffer. Prior to this PR `napi/parser` stored source text at the start of the buffer.

Bring `napi/parser` into line with Oxlint, by also storing source text at end of the buffer.

Making all versions of raw transfer that we use align with each other removes complication (all versions now have the same implementation of `deserializeStr`) and also removes some fragile code where it'd be easy to accidentally trigger UB (see the updated comments in `arena/fixed_size/windows.rs` and `arena/alloc_impl.rs`).

Unfortunately, storing source at end of buffer is slightly less efficient than storing it at the start. We'll switch all implementations to storing source at start of buffer when we move to storing all strings (source text and all other strings) together in a single contiguous block. But in meantime, this slight inefficiency is outweighed by the gain in safety.
2026-05-14 22:26:41 +00:00
overlookmotel 99eef72e2d refactor(allocator, linter/plugins, napi/parser): store raw transfer metadata within Arena chunk (#21869)
Large change to how raw transfer stores metadata about the allocations it uses.

Previously the two metadata structures `RawTransferMetadata` and `FixedSizeAllocator` after the chunk's `ChunkFooter`.

This had a few problems:

1. It was confusing and unwieldy - a recipe for bugs.
2. `ChunkFooter`'s memory was exposed on JS side - a bit unsafe as altering bytes in this region could easily trigger UB.
3. It entwined `Arena` (which is just the thing that allocates) with the details of exactly _what_ raw transfer allocates.
4. Imposed annoying alignment requirements, because `ChunkFooter` must be aligned on 16, and so anything after it must ensure it doesn't break that invariant.

Old layout:

```
                                                        WHOLE BLOCK - aligned on 4 GiB
<-----------------------------------------------------> Allocated block (`BLOCK_SIZE` bytes)

                                                        ALLOCATOR
<----------------------------------------->             `Allocator` chunk (`CHUNK_SIZE` bytes)
                                     <---->             `ChunkFooter` (aligned on 16)
<----------------------------------->                   `Allocator` chunk data storage (for AST)
                                                        (`ACTIVE_SIZE` bytes)

                                                        METADATA
                                           <---->       `RawTransferMetadata`
                                                 <----> `FixedSizeAllocatorMetadata`

                                                        BUFFER SENT TO JS
<----------------------------------------------->       Buffer sent to JS (`BUFFER_SIZE` bytes)
```

This PR moves `RawTransferMetadata` and `FixedSizeAllocatorMetadata` into the chunk itself. New layout:

```
                                                        WHOLE BLOCK - size 2 GiB - 16, aligned on 4 GiB
<-----------------------------------------------------> Allocated block (`BLOCK_SIZE` bytes)

                                                        ARENA
<-----------------------------------------------------> Chunk (fills whole block)
<-------------------------------------->                Allocatable region for AST (`ACTIVE_SIZE` bytes)
                                        <--->           `RawTransferMetadata`
                                             <--->      `FixedSizeAllocatorMetadata`
                                                  <---> `ChunkFooter` (aligned on 16, last in block)

                                                        BUFFER SENT TO JS
<------------------------------------------->           Buffer sent to JS (`BUFFER_SIZE` bytes)
```

`FixedSizeAllocatorMetadata` and `ChunkFooter` are no longer in the region which is shared with JS side. As far as `Arena` is concerned, they're now just some data (like any other data) which is allocated in the arena.

Also:

- Introduce more consistency to the naming of constants which specify the size and position of these various data structures in the arena.
- Add more const assertions to ensure everything is laid out and aligned as it should be.
2026-04-30 01:27:30 +00:00
overlookmotel eb400b8bb2 perf(napi/parser, linter/plugins): remove uint32 buffer view (#21140)
Continuation of #21132. All uses of the `Uint32Array` view of the buffer in raw transfer code have been removed in preceding PRs. So we can now remove it entirely.
2026-04-07 23:14:37 +00:00
overlookmotel 26750857d5 perf(napi/parser): lazy deserialization use only Int32Array (#21139)
Continuation of #21132. Use `Int32Array` view of the buffer for all code in lazy deserialization. Lazy deserialization is not currently in use, but keeping it in line with the main raw transfer deserializer allows removing the `Unint32Array` view of the buffer entirely in #21140 without breaking the lazy deserializer tests.
2026-04-07 23:14:36 +00:00
overlookmotel 5b35a53a0b perf(napi/parser): deserializing tokens use only int32 array (#21138)
Small perf optimization. When deserializing tokens in `oxc-parser`, use only the `Int32Array` view of the buffer, instead of both `Int32Array` and `Uint8Array`. Less values to keep in registers, and `int32` doesn't need to be obtained with a property lookup on each call.
2026-04-07 23:14:36 +00:00
overlookmotel f163d10859 perf(parser): tokens raw deserialization use Int32Array (#21137)
Continuation of #21132. Use `Int32Array` view of the buffer for tokens deserialization in `oxc-parser`.
2026-04-07 23:14:36 +00:00
overlookmotel c70a8e9853 refactor(napi/parser, linter/plugins): add int32 buffer view (#21131)
Add an `Int32Array` view of the buffer for raw transfer. It will be used in PRs later in this stack.
2026-04-07 17:25:41 +00:00
overlookmotel 1f9c115632 test(estree/tokens): add tests for tokens via raw transfer (#19885)
Implement the beginnings of support for tokens in `napi/parser`.

This PR only adds support for tokens via raw transfer, and behind an undocumented `experimentalTokens` option.

Add tests checking that tokens received on JS side via raw transfer match snapshots for all Test262, AcornJSX, and TypeScript test cases. They do!

The tests are the main purpose of this PR, making sure it works before we switch over to tokens via raw transfer in Oxlint.

We can add full tokens support to `napi/parser` (including via JSON transfer) later on.
2026-03-01 20:02:49 +00:00
camc314 5d211a8c69 refactor(napi/parser): move generated JS into src-js (#16957)
moves the generated code into src-js to keep the same pattern as oxlint
2025-12-17 11:43:42 +00:00
overlookmotel 790beebd17 perf(napi/parser): do not remove extraneous options on JS side (#16447)
Similar to #16442.

There's no need to remove the `experimental*` properties from `options` object on JS side. They'll be ignored by NAPI-RS on Rust side anyway, so creating a new object on JS side is pointless overhead.
2025-12-03 14:47:24 +00:00
renovate e44b288902 chore(deps): update dependency oxlint-tsgolint to v0.8.3 (#16187)
This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [oxlint-tsgolint](https://redirect.github.com/oxc-project/tsgolint) | [`0.8.2` -> `0.8.3`](https://renovatebot.com/diffs/npm/oxlint-tsgolint/0.8.2/0.8.3) | [![age](https://developer.mend.io/api/mc/badges/age/npm/oxlint-tsgolint/0.8.3?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/oxlint-tsgolint/0.8.3?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/oxlint-tsgolint/0.8.2/0.8.3?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/oxlint-tsgolint/0.8.2/0.8.3?slim=true)](https://docs.renovatebot.com/merge-confidence/) |

---

### Release Notes

<details>
<summary>oxc-project/tsgolint (oxlint-tsgolint)</summary>

### [`v0.8.3`](https://redirect.github.com/oxc-project/tsgolint/releases/tag/v0.8.3)

[Compare Source](https://redirect.github.com/oxc-project/tsgolint/compare/v0.8.2...v0.8.3)

##### What's Changed

- chore(deps): update typescript-go digest to [`e34615c`](https://redirect.github.com/oxc-project/tsgolint/commit/e34615c) by [@&#8203;renovate](https://redirect.github.com/renovate)\[bot] in [#&#8203;465](https://redirect.github.com/oxc-project/tsgolint/pull/465)
- chore(deps): update typescript-go digest to [`bd7c18d`](https://redirect.github.com/oxc-project/tsgolint/commit/bd7c18d) by [@&#8203;renovate](https://redirect.github.com/renovate)\[bot] in [#&#8203;466](https://redirect.github.com/oxc-project/tsgolint/pull/466)
- chore(deps): update typescript-go digest to [`417387a`](https://redirect.github.com/oxc-project/tsgolint/commit/417387a) by [@&#8203;renovate](https://redirect.github.com/renovate)\[bot] in [#&#8203;467](https://redirect.github.com/oxc-project/tsgolint/pull/467)
- chore(deps): update dependency vitest>vite to v7.2.8 by [@&#8203;renovate](https://redirect.github.com/renovate)\[bot] in [#&#8203;469](https://redirect.github.com/oxc-project/tsgolint/pull/469)
- chore(deps): update typescript-go digest to [`d1be94b`](https://redirect.github.com/oxc-project/tsgolint/commit/d1be94b) by [@&#8203;renovate](https://redirect.github.com/renovate)\[bot] in [#&#8203;470](https://redirect.github.com/oxc-project/tsgolint/pull/470)
- chore(deps): update crate-ci/typos action to v1.40.0 by [@&#8203;renovate](https://redirect.github.com/renovate)\[bot] in [#&#8203;471](https://redirect.github.com/oxc-project/tsgolint/pull/471)

**Full Changelog**: <https://github.com/oxc-project/tsgolint/compare/v0.8.2...v0.8.3>

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/oxc-project/oxc).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0Mi4xOS45IiwidXBkYXRlZEluVmVyIjoiNDIuMTkuOSIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->
2025-11-27 08:31:05 +00:00
Boshen 523a30a016 style(all): apply oxfmt default options (#16091)
Embrace the defaults!

---------

Co-authored-by: Yuji Sugiura <y.sugiura.0316@gmail.com>
2025-11-25 15:56:24 +09:00
Boshen ea51b0b5c8 feat(napi)!: standardize function naming with sync suffixes (#15661)
closes #15576

## Summary

Standardizes function naming across all NAPI packages (parser, transform, minify) with a consistent pattern:
- Async functions: `verb` (no suffix)
- Sync functions: `verbSync` (with Sync suffix)

## Changes

### Breaking Changes

**napi/parser:**
- `parseAsync` → `parse` (async)
- `parseSync` remains unchanged (sync)

**napi/transform:**
- `transformAsync` → `transform` (async)
- `transform` → `transformSync` (sync)
- `isolatedDeclaration` → `isolatedDeclarationSync` (sync)
- Added new `isolatedDeclaration` function (async)
- `moduleRunnerTransform` → `moduleRunnerTransformSync` (sync)
- Added new `moduleRunnerTransform` function (async)

**napi/minify:**
- `minify` → `minifySync` (sync)
- Added new `minify` function (async)

🤖 Generated with [Claude Code](https://claude.com/claude-code)
2025-11-13 12:28:23 +00:00
leaysgur a8e5181ab7 chore(infra): dogfooding oxfmt (#14979)
Fixes #14803

- Added `oxfmt` and `oxfmtrc.jsonc`
- Remove `dprint` plugin and useless ignore paths
- Apply `dprint` again
- Apply `oxfmt`
2025-10-28 01:16:46 +00:00
camc314 1cc7ee92b0 chore(parser): enable oxlint (#14571) 2025-10-14 13:25:29 +00:00
overlookmotel 52f35c6dcd refactor(napi/parser, linter/plugins): rename types.js to type_ids.js (#14384)
Pure refactor. Just rename generated `types.js` files to `type_ids.js`. This name better describes what the files contain, and it avoids naming clash with `types.d.ts` in `apps/oxlint/src-js/generated`.
2025-10-06 18:55:15 +00:00
overlookmotel 7e4d04fadf feat(napi/parser): add option to add parent prop to AST nodes with raw transfer (#14344)
Add an option to `oxc-parser` to add `parent` to all AST nodes. This option is only available with raw transfer (not really feasible with JSON transfer, as JSON doesn't support circular references).

This is really for the purposes of JS plugins in Oxlint, so have not included the new deserializers which add `parent` in the `oxc-parser` NPM package, to avoid bloating download size. But it's ideal home is in `napi/parser` so can add it to the conformance tests.

`parent` is correct for all nodes in all Test262 and TypeScript test cases.
2025-10-05 00:32:09 +00:00
overlookmotel e75d42d509 perf(napi/parser, linter/plugins): remove runtime preserveParens option from raw transfer deserializers (#14338)
We had a runtime `preserveParens` option in deserializers to cater for linter, but it was not used in parser. Convert it to a compile-time option instead.
2025-10-04 17:03:33 +00:00
overlookmotel 6374065095 feat(napi/parser): raw transfer support range field (#14319)
Raw transfer support `range` option, adding `range` field to every AST node.
2025-10-04 15:47:47 +00:00
overlookmotel c65e782092 fix(napi/parser): fix JSDoc comments (#14318)
Small fix to JSDoc comments for raw transfer deserialization.

`options` must be an object at this point because raw transfer code can only be entered if `options` contains `experimentalRawTransfer: true`.
2025-10-04 15:47:47 +00:00
overlookmotel bb040bc2d5 refactor(parser, linter): replace .mjs files with .js (#14045)
Now that `apps/oxlint` and `napi/parser` are both ESM packages (#13723 and #14042), we can use `.js` file extensions for all ESM files, rather than the mix of `.js` and `.mjs` file we had previously.

It's less confusing having to remember what's `.js` and what's `.mjs`, and avoids ugly workarounds like #14038 (`.d.mts`??).
2025-09-23 14:47:40 +00:00
overlookmotel ac3e9e966a refactor(napi/parser): move JS code into src-js directory (#13899)
Pure refactor. Root of `napi/parser` was getting really crowded with tons of files, and I'm about to add a load more for the ESTree walker.

Move JS source files into a `src-js` directory, like in `apps/oxlint`, so that the root of the package is just config files and scripts.
2025-09-19 08:46:42 +00:00