Commit Graph

16 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
camc314 2ab679af2b chore(napi/parser): enable noImplicitAny (#23830)
follow on from my other changes to this code earlier today
2026-06-26 16:23: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
overlookmotel 8b89309f57 test(napi/parser): fix tests for range, parent, and lazy on TS fixtures (#19884)
`napi/parser`'s tests for raw transfer ranges, parents, and lazy deserialization were incorrect. They were testing parsing the entire TS fixture file, which can contain multiple parts, instead of testing each part individually. Fix that.
2026-03-01 17:40:05 +00:00
overlookmotel 09a4057f14 refactor(linter/plugins, napi/parser): remove pattern of destructuring globals at top level (#18455)
Pure refactor.

Remove a few remaining instances of the pattern where we destructure global objects at top level e.g. `const { isArray } = Array;`.

In Oxlint, TSDown plugin already performs this optimization. In `napi/parser`, we intend to build the package with TSDown, and we'll apply the same optimization in build process then too.
2026-01-23 14:28:18 +00:00
overlookmotel d1ce274d39 test(estree): update estree-conformance submodule (#17066)
Bump `estree-conformance` and `test262` submodules.

`estree-conformance` submodule now contains snapshots for tokens conformance testing: https://github.com/oxc-project/estree-conformance/pull/131 & https://github.com/oxc-project/estree-conformance/pull/134
2025-12-18 16:03:24 +00:00
camc314 2acd66ed42 style(all): enable eslint/curly lint rule (#16753)
built on https://github.com/oxc-project/oxc/pull/16749, we can use the linter to be consistent here
2025-12-11 14:49:48 +00:00
Boshen 3f6387dd3b ci(workflows): add workflow_call support to update_submodules.yml (#16431)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
2025-12-03 19:47:57 +08:00
overlookmotel 083fea9fa6 feat(napi/parser)!: represent empty optional fields on JS side as null (#16411)
Follow-on after #16383 and #16403.

While working on those I discovered an option NAPI-RS has to represent `Option::None` as `null`, instead of omitting the field entirely.

Use that option on the structs used for transferring errors and module record over to JS.

I think this is likely more performant because:

1. NAPI-RS can create all properties of the objects using only the faster `node_api_create_object_with_properties` API.
2. It produces consistent object shapes, so JS engine can better optimize code using these objects.

It also brings the shape of the data perfectly into line between standard transfer and raw transfer, and is consistent with how empty fields in the AST are represented as `null`.

I would have used this option before if I'd known it existed.

### Breaking change

I've marked this as a breaking change because code consuming these objects would now need to check for empty fields with `value === null` instead of `value === undefined`.

However in practice, most people probably use `!value` or `value ?? ...`, so it's unlikely to affect many users. This only affects module record and errors anyway, not the AST itself, as we transfer that as JSON, not via NAPI.
2025-12-02 23:30:56 +00:00
renovate[bot] 7731160241 chore(deps): update napi (#16383)
This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence | Type |
Update |
|---|---|---|---|---|---|---|---|
| [@napi-rs/cli](https://redirect.github.com/napi-rs/napi-rs) | [`3.4.1`
->
`3.5.0`](https://renovatebot.com/diffs/npm/@napi-rs%2fcli/3.4.1/3.5.0) |
[![age](https://developer.mend.io/api/mc/badges/age/npm/@napi-rs%2fcli/3.5.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@napi-rs%2fcli/3.5.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@napi-rs%2fcli/3.4.1/3.5.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@napi-rs%2fcli/3.4.1/3.5.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
| pnpm.catalog.default | minor |
| [napi](https://redirect.github.com/napi-rs/napi-rs) | `3.5.2` ->
`3.6.1` |
[![age](https://developer.mend.io/api/mc/badges/age/crate/napi/3.6.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/crate/napi/3.6.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/crate/napi/3.5.2/3.6.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/crate/napi/3.5.2/3.6.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
| workspace.dependencies | minor |
| [napi-derive](https://redirect.github.com/napi-rs/napi-rs) | `3.3.3`
-> `3.4.0` |
[![age](https://developer.mend.io/api/mc/badges/age/crate/napi-derive/3.4.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/crate/napi-derive/3.4.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/crate/napi-derive/3.3.3/3.4.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/crate/napi-derive/3.3.3/3.4.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
| workspace.dependencies | minor |

---

### Release Notes

<details>
<summary>napi-rs/napi-rs (@&#8203;napi-rs/cli)</summary>

###
[`v3.5.0`](https://redirect.github.com/napi-rs/napi-rs/releases/tag/napi-v3.5.0)

[Compare
Source](https://redirect.github.com/napi-rs/napi-rs/compare/@napi-rs/cli@3.4.1...@napi-rs/cli@3.5.0)

##### Added

- *(sys)* use libloading to load napi symbols at runtime on all platform
([#&#8203;2996](https://redirect.github.com/napi-rs/napi-rs/pull/2996))

##### Fixed

- *(napi)* memory leak in PromiseRaw cleanup callback
([#&#8203;2995](https://redirect.github.com/napi-rs/napi-rs/pull/2995))

##### Other

- *(napi)* mark tsfn data as pub and split SendableResolver to indent
file
([#&#8203;2992](https://redirect.github.com/napi-rs/napi-rs/pull/2992))
- *(napi)* mark SendableResolver and PromiseRaw as pub
([#&#8203;2981](https://redirect.github.com/napi-rs/napi-rs/pull/2981))
- add sponsors

</details>

---

### Configuration

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

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

👻 **Immortal**: This PR will be recreated if closed unmerged. Get
[config
help](https://redirect.github.com/renovatebot/renovate/discussions) if
that's undesired.

---

- [ ] <!-- 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==-->

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: overlookmotel <theoverlookmotel@gmail.com>
2025-12-02 18:27:23 +00:00
overlookmotel e7e6d2507c test(napi/parser): patch types for hidden parser options (#16387)
`napi/parser` tests utilize hidden `experimentalRawTransfer` and `experimentalParent` options. Patch the types of `parse` and `parseSync` in the tests so using these options is not a type error. This replaces a bunch of `// @ts-ignore` and `// @ts-expect-error` comments.
2025-12-02 12:37:16 +00:00
overlookmotel 3068658c30 style(napi/parser): prefer const to let (#16386)
Use `const` where variables are not reassigned instead of `let`. Preparation for enabling ESLint's `prefer-const` rule (running as an Oxlint JS plugin) in our linting setup.
2025-12-02 10:27:27 +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
camc314 bab4bc8f61 feat(napi/parser): add type annotations to parse-raw-worker test (#15998) 2025-11-24 22:18:13 +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 b3c5132692 feat(parser): use typescript for raw transfer tests (#14390) 2025-10-06 23:27:45 +00:00