Commit Graph

130 Commits

Author SHA1 Message Date
overlookmotel c966acaac5 fix(parser): do not omit < token opening type argument list (#26328)
Fix tokens produced when `<<` opens a type argument list. e.g.:

```typescript
type Bar = ReturnType<<T>(x: T) => number>;
```

Previously only 1 `<` token was produced between `ReturnType` and `T`. This PR corrects that so 2 `<` tokens are produced.

TS-ESLint get this wrong too - hence why this wasn't noticed before, as our conformance tests compare to TS-ESLint.

PR submitted to fix TS-ESLint: https://github.com/typescript-eslint/typescript-eslint/pull/12821

In meantime, this PR skips the erroneously failing ESTree tokens conformance tests. We can can re-enable those tests once the fix lands in TS-ESLint.
2026-09-04 12:08:49 +00:00
Boshen 1193c9dbaf chore(oxfmt): dogfood operator position at line start (#25937)
dogfood
2026-08-20 14:36:47 +00:00
camc314 46d237c9a7 chore(codegen,parser,tasks): pin benchmark fixtures by sha (#25557)
Pin the Codegen benchmark fixture to an immutable `benchmark-files` commit. This makes benchmark inputs reproducible and prevents `main` updates from silently changing results.
2026-08-12 15:56:52 +00:00
overlookmotel e224f5f385 test(napi/parser): fix TypeScript test case splitting (#25492)
#25488 copied the code from `napi/parser` for splitting TypeScript test fixtures.

AI reviewer correctly pointed out that it was clearly broken: https://github.com/oxc-project/oxc/pull/25488#discussion_r3754102027

Turns out all this code was pointless. It looks up the error codes TypeScript provides for its fixtures, but that's not needed here. And in any case (according to Claude at least) the logic wasn't correctly ported from the Rust version, so it wouldn't work anyway.

So this PR just deletes it all.

If #25488 is merged, this will keep the 2 copies in sync with each other.
2026-08-11 14:29:15 +00:00
overlookmotel fed2b900eb refactor(napi/parser): fix TS errors under strict type checking (#25491)
Nit: Make this code compile under structer TS settings. #25488 copies this code, and this PR just keeps the 2 versions in sync.
2026-08-11 00:06:54 +00:00
Boshen 030857b509 refactor(diagnostics): update oxc-miette to v4 (#25395)
Remove the miette `Report` wrapper and update oxc-miette to v4's narrowed diagnostic and source protocol.

AI-assisted by OpenAI Codex.
2026-08-10 07:48:02 +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
camc314 14509acf61 chore(napi/parser): run matches parseSync test on all bench files (#23823)
**Stack**
 - https://github.com/oxc-project/oxc/pull/23823  👈 this PR
 - https://github.com/oxc-project/oxc/pull/23822
2026-06-26 15:51:58 +00:00
camc314 90e902eea2 chore(napi/parser): re-enable antd.js test cases (#23822)
the timeout should be fixed by https://github.com/oxc-project/oxc/pull/23820 so we can now re-enable the test

**Stack**
 - https://github.com/oxc-project/oxc/pull/23823
 - https://github.com/oxc-project/oxc/pull/23822  👈 this PR
2026-06-26 15:10:44 +00:00
camc314 4b121ab396 test(napi/parser): run async tests sequentially (#23820)
A little breakdown of what was going on:

 - the failing test case was testing that raw transfer vs non raw transfer was the same. This was parsing checker.ts (a 3.2mb file)
 - this test was running concurrently (via vitest's describe.concurrently) with a memory exhaustion test that was running parse with raw transfer 10,000x concurrently
 - as a result of these concurrent tests, it resulted in a large number of JS objects being created (and hence needing to be GC-ed)
 - since CI is not deterministic, it caused a flakiness roughly 2% of the time
 - this can clearly be seen from the attached flamegraph - the  readFile  call (reading checker.ts from the disk) was sometimes taking up to 3 seconds to read the file from the disk

This seems to be fixed by no longer using describe.concurrent, as it reduces the amount of concurrent work and reduces the chance of the timeout.

<img width="4096" height="1724" alt="image" src="https://github.com/user-attachments/assets/0fd5bc59-8d28-4453-adda-bf33834aafa8" />
2026-06-26 13:49:48 +00:00
camc314 c9517f75aa refactor(napi/parser): add some missing TS type annotations (#23817) 2026-06-26 10:08:36 +00:00
Dunqing 188b9e6b43 chore(bench): swap cal.com.tsx for excalidraw App.tsx everywhere (#22895)
## Summary

Follow-up to #22590. That PR replaced the synthetic `cal.com.tsx` fixture — a concatenation of Next.js pages that declares top-level names 70–113× and emits thousands of redeclaration diagnostics, inflating semantic `sys_allocs` — with excalidraw's real, single-file `App.tsx`. But it only touched `TestFiles::complicated()` (used by `track_memory_allocations`).

This applies the same swap to every remaining benchmark that still used `cal.com.tsx`, and unifies **all** excalidraw `App.tsx` references on one pin (`f6d85bc8`):

| File | Change |
| --- | --- |
| `tasks/common/src/test_file.rs` | `minimal()` (feeds every `tasks/benchmark` criterion bench): `cal.com.tsx` → `App.tsx@f6d85bc8`. `formatter()` re-pinned `@v0.18.0` → `@f6d85bc8` |
| `napi/parser/bench.bench.js` | parser benchmark fixture → `App.tsx@f6d85bc8` |
| `napi/parser/test/parse-raw.test.ts` | bench-fixture list + size comment → `App.tsx@f6d85bc8` |
| `tasks/benchmark/benches/semantic.rs` | rewrote the now-false "`cal.com.tsx` has many errors" comment |
| `crates/oxc_ast/src/serialize/mod.rs` | removed the stale `cal.com.tsx` row from the capacity-ratio doc table |

## Why a single pin

`get_source_text` caches downloads by the last URL segment only (`App.tsx`). With two different pins live, a single `cargo bench` run would download both into the same `target/App.tsx` and silently bench whichever landed first. Re-pinning `formatter()` to `f6d85bc8` removes that collision — and the pre-existing latent one between `cargo bench` (`@v0.18.0`) and `cargo allocs` (`@f6d85bc8`).

## Notes

No committed snapshots change: these fixtures feed only timing benches and a `programRaw.toEqual(programStandard)` self-consistency test; the snapshotted `complicated()` / `minifier()` sets are untouched.

---

This PR was prepared with AI assistance; I reviewed, tested, and verified the changes.
2026-06-01 16:21:32 +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
camc314 08b0218dd6 chore(submodules): update submodule SHAs to latest commits (#19518) 2026-02-18 14:56:36 +00:00
Boshen 16fbd43f12 chore(submodules): update submodule SHAs to latest commits (#18877) 2026-02-03 16:46:48 +08: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 6e8fa809f5 feat(napi/parser, napi/transform): accept sourceType: "commonjs" (#18197)
#18089 added support in parser for `commonjs` source type.

Extend this support to the NAPI packages - accept `sourceType: 'commonjs'` in options for `oxc-parser` and `oxc-transform`.
2026-01-19 04:39:04 +00:00
overlookmotel 2fbc39e501 test(napi/parser): correct nesting of tests (#18193)
Refactor tests. The tests for `ImportDeclaration` and `ImportExpression` had somehow got nested within the tests for `TemplateExpression`. Move them to a better place.
2026-01-18 21:14:16 +00:00
Boshen 66b8c022ab feat(parser): implement unambiguous module parsing for JS/TS files (#18124)
## Summary

- Implements speculative/unambiguous parsing for `.js`, `.jsx`, `.ts`, and `.tsx` files
- Instead of assuming module or script upfront, parses with `ModuleKind::Unambiguous` and upgrades to module mode when ESM syntax is detected
- ESM indicators: `import`, `export`, `import.meta` (NOT top-level await alone)
- Defers top-level await errors until module type is resolved
- Vue loader upgrades unambiguous scripts to module mode
- Updates linter tests to use explicit ESM extensions (`.mjs`/`.mts`) where needed

## Test plan

- [x] All parser tests pass
- [x] All linter tests pass
- [x] All semantic tests pass
- [x] Coverage conformance tests updated

🤖 Generated with [Claude Code](https://claude.com/claude-code)
2026-01-17 13:40:28 +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 af0f2af93f chore(lint): enable ban-ts-comment rule and fix ts-ignore usages (#16799)
follow on from https://github.com/oxc-project/oxc/pull/16796
2025-12-13 16:19:48 +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
overlookmotel 3459f8a548 ci(lint): enable prefer-destructuring lint rule (#16449)
Enable `prefer-destructuring` rule in our linting setup.

Not related to JS plugins, I just like this rule, and it's useful not to make nitty comments on PRs, when linter can do it for me...
2025-12-03 22:10:54 +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 699406af5e fix(napi/parser): move ExportEntry::module_request field to first (#16412)
Revert the change made in #16403. It's no longer necessary after #16411, because NAPI-RS no longer re-orders the fields.
2025-12-02 23:30:56 +00: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 12bd7940bf fix(napi/parser): move ExportEntry::module_request field to last (#16403)
NAPI-RS 3.6.0 makes a change to the ordering of objects. It now puts optional fields last.

This made tests in `napi/parser` for module record fail when we tried to update (#16383) because the `module_request` field of `ExportEntry` moves to last which breaks the snapshots.

The change in NAPI-RS is unlikely to be reverted, because it's a sizeable perf optimization: https://github.com/napi-rs/napi-rs/pull/2990

To work around this problem:

1. Move the field in the `ExportEntry` intermediate struct in `napi/parser` to last, so NAPI's output matches what you'd expect from the struct definition.
2. Alter the `#[estree]` attr on `ExportEntry` struct in `oxc_syntax` crate to match.

Note: The `ExportEntry` struct in `napi/parser` is just an intermediate structure used for serialization. So I think it's fine to fiddle with its field order. The actual `ExportEntry` struct used in the module record is in `oxc_syntax` crate, and it remains unaltered.
2025-12-02 17:42:53 +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
overlookmotel b42610cf16 refactor(napi/parser): remove unused oxlint-disable comment (#16058)
This comment was previously needed, due to a bug in Oxlint, but that bug is now fixed.
2025-11-24 13:32:10 +00:00
overlookmotel 2bd3cb66f7 fix(apps, editors, napi): fix oxlint-disable comments (#16014)
Fix a few `oxlint-disable` comments. 2 were unnecessary, the other was malformed.
2025-11-23 23:19:34 +00:00
renovate a4615e596c chore(deps): update dependency oxlint to v1.29.0 (#15780)
This PR contains the following updates:

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

---

### Release Notes

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

### [`v1.29.0`](https://redirect.github.com/oxc-project/oxc/blob/HEAD/npm/oxlint/CHANGELOG.md#1290---2025-11-17)

[Compare Source](https://redirect.github.com/oxc-project/oxc/compare/oxlint_v1.28.0...oxlint_v1.29.0)

##### 🚀 Features

- [`84de1ca`](https://redirect.github.com/oxc-project/oxc/commit/84de1ca) oxlint,oxfmt: Allow comments and also commas for vscode-json-ls ([#&#8203;15612](https://redirect.github.com/oxc-project/oxc/issues/15612)) (leaysgur)

</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:eyJjcmVhdGVkSW5WZXIiOiI0MS4xNzMuMSIsInVwZGF0ZWRJblZlciI6IjQxLjE3My4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->
2025-11-17 14:13:52 +00:00
overlookmotel 5df7999791 test(napi/parser): use oxlint-disable comment over eslint-disable (#15671)
Tiny style change. Use `// oxlint-disable-next-line` comment instead of `// eslint-disable-next-line`. Either works, but obviously Oxlint is superior. :)
2025-11-13 12:46:44 +00: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
sapphi-red 682dca2ea7 feat(parser): add more helps to parser errors (#15186)
Added more helps to parser errors to make it easier to understand how the error can be resolved.
2025-10-31 07:10:45 +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 f293e3e320 test(napi/parser): disable raw transfer tests on antd.js fixture (#14446)
The raw transfer test on `antd.js` fixture is timing out sometimes on CI. We already disabled the "range & parent" test on this fixture. Disable the other test on it too. But only skip these tests in CI.

(alternative to #14438)
2025-10-08 17:43:27 +00:00
overlookmotel 994c099182 test(napi/parser): skip slow test (#14424)
The raw transfer range + parent test on `antd.js` fixture is still hitting 5 second timeout on CI. For some reason the `timeout` option isn't increasing the timeout. Just skip this test.
2025-10-07 18:55:02 +00:00
camc314 b3c5132692 feat(parser): use typescript for raw transfer tests (#14390) 2025-10-06 23:27:45 +00:00
overlookmotel 56274a54f1 test(napi/parser): increase timeout on slow test (#14391)
1 raw transfer test sometimes takes longer than 5 secs on CI. Increase the timeout.
2025-10-06 22:32:32 +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 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 8c09592d2c test(napi/parser): align fixture version with other tasks (#14146)
#13465 aligned the version of `antd.js` used in different Rust tasks to v4.16.1. But it missed a couple of places in `napi/parser` tests/benchmarks. Align these to same version too.

Misalignment was problematic as the tasks using these fixtures all download the file to same location (`target` dir) and don't re-download if the file is already present. This lead to unpredictable results depending on which task you ran first, and so which version was downloaded.
2025-09-26 09:41:48 +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 55cd2f3058 test(parser): remove unused import (#14043) 2025-09-23 13:15:33 +00:00