Commit Graph

20306 Commits

Author SHA1 Message Date
Dunqing 32bdc5b1d1 feat(allocator): construct ArenaHashSet with any Default hasher (#26372)
This PR is inspired by #26333, addresses the repeated `with_hasher_in(IdentBuildHasher, allocator)` call, and removes the extra `'ident` lifetime.

`ArenaHashMap::new_in` works with any `Default` hasher, so `ArenaIdentHashMap::new_in(allocator)` picks `IdentBuildHasher` automatically. `ArenaHashSet` only has `new_in`, `with_capacity_in` and `from_iter_in` for `FxBuildHasher`, so an `Ident`-keyed arena set has to call `with_hasher_in(IdentBuildHasher, allocator)` every time (see #26333).

Mirror the map's `S: Default` impl on the set and add an `ArenaIdentHashSet<'alloc>` alias next to `ArenaIdentHashMap`. Nothing calls the `FxBuildHasher`-only constructors today, so no other code changes.

The alias takes a single lifetime, same as `ArenaIdentHashMap`. A separate lifetime for the `Ident` keys is not needed, and dropping it is sound: both `ArenaHashSet` and `Ident` are covariant, so when the idents are borrowed from somewhere other than the arena (for example `Scoping` in the mangler), the borrow checker shrinks `'alloc` to the shorter of the two borrows. The set can never outlive the strings its idents point to.
2026-09-07 05:09:38 +00:00
leaysgur f7acdc0bd9 fix(formatter): treat a JSDoc cast target as opaque in chain layouts (#26375)
Fixes #20181
2026-09-07 04:56:37 +00:00
leaysgur 104061b98a fix(formatter): keep JSDoc cast parens with a comment inside them (#26374)
Fixes #26274, #26275.
2026-09-07 04:56:37 +00:00
leaysgur b3613b176a test(oxfmt): use svelte repo for jsdoc conformance fixture (#26371)
Add `svelte` repo for JSDoc conformance.
2026-09-07 04:56:36 +00:00
Armano 0d31f58659 refactor(minifier): inline sequence handling to minimize_conditional from minimize_conditional_after_if (#26029)
`SequenceExpression` inlining from `minimize_conditional_after_if` is a
more optimal version of inlining when we are constructing conditional
expr, with this change we will do this always instead of falling to
`minimize_conditional_expression`

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-09-07 10:45:22 +08:00
Armano 98a8fe3390 test(minifier): add test cases for not verified behavior (#26307)
add test cases for uncovered code and branches that should be tested:

verified with llvm-cov 
```sh
cargo +nightly llvm-cov clean --workspace && cargo +nightly llvm-cov --branch --html -p oxc_minifier --test mod
```

i found out that our coverage is not really ideal while working on
#26264
2026-09-07 09:55:22 +08:00
leaysgur 3d00a7635b fix(formatter_css): keep comment inside important and simple-vars colon (#26370)
Follow up on #26337

Also, normalize `important` token with/without comments.
2026-09-07 01:33:14 +00:00
leaysgur 68e12abe2c feat(formatter_css): follow the oxc-css-parser's acceptance line (#26337)
Fixes #26290, #26291.
Also, many changes to follow refined parser acceptance line.

---

CI will fail until parser version bumped, needs oxc-project/oxc-css-parser/pull/166
2026-09-07 01:33:14 +00:00
camc314 8b35abdfd9 fix(semantic): detect duplicate private class elements (#26361)
The duplicate class element check stored only the last element for each name. This allowed a public element to hide an earlier private declaration, and a setter to hide an earlier getter (or vice versa):

```js
class DuplicateField {
  #x;
  x;
  #x;
}

class DuplicateGetter {
  get #x() {}
  set #x(value) {}
  get #x() {}
}
```

Both classes were accepted despite declaring the same private field or getter twice. The same problem affected setter/getter/setter sequences.

Key a single map by both the element name and whether it is private, so public elements cannot replace private declarations. This keeps the namespaces separate while reserving map capacity only once. For each private name, retain separate slots for setters and other declarations. Look for a previous declaration in the matching slot first, then fall back to the other slot. This catches repeated getters and setters while still allowing one getter/setter pair when both have the same static status.

The existing diagnostic logic continues to reject private names shared by static and instance elements, including the TypeScript-specific diagnostic. Public elements continue through the existing public-element duplicate check.
2026-09-06 21:17:34 +00:00
renovate[bot] 2289d27099 chore(deps): update npm packages (#26366)
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/) |
|---|---|---|---|---|---|
|
[@typescript-eslint/parser](https://typescript-eslint.io/packages/parser)
([source](https://redirect.github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser))
| [`8.68.0` →
`8.69.0`](https://renovatebot.com/diffs/npm/@typescript-eslint%2fparser/8.68.0/8.69.0)
|
![age](https://developer.mend.io/api/mc/badges/age/npm/@typescript-eslint%2fparser/8.69.0?slim=true)
|
![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@typescript-eslint%2fparser/8.69.0?slim=true)
|
![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@typescript-eslint%2fparser/8.68.0/8.69.0?slim=true)
|
![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@typescript-eslint%2fparser/8.68.0/8.69.0?slim=true)
|
|
[@typescript-eslint/scope-manager](https://typescript-eslint.io/packages/scope-manager)
([source](https://redirect.github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/scope-manager))
| [`8.68.0` →
`8.69.0`](https://renovatebot.com/diffs/npm/@typescript-eslint%2fscope-manager/8.68.0/8.69.0)
|
![age](https://developer.mend.io/api/mc/badges/age/npm/@typescript-eslint%2fscope-manager/8.69.0?slim=true)
|
![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@typescript-eslint%2fscope-manager/8.69.0?slim=true)
|
![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@typescript-eslint%2fscope-manager/8.68.0/8.69.0?slim=true)
|
![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@typescript-eslint%2fscope-manager/8.68.0/8.69.0?slim=true)
|
| [@typescript-eslint/visitor-keys](https://typescript-eslint.io)
([source](https://redirect.github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/visitor-keys))
| [`8.68.0` →
`8.69.0`](https://renovatebot.com/diffs/npm/@typescript-eslint%2fvisitor-keys/8.68.0/8.69.0)
|
![age](https://developer.mend.io/api/mc/badges/age/npm/@typescript-eslint%2fvisitor-keys/8.69.0?slim=true)
|
![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@typescript-eslint%2fvisitor-keys/8.69.0?slim=true)
|
![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@typescript-eslint%2fvisitor-keys/8.68.0/8.69.0?slim=true)
|
![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@typescript-eslint%2fvisitor-keys/8.68.0/8.69.0?slim=true)
|
| [degit](https://redirect.github.com/Rich-Harris/degit) | [`3.8.0` →
`3.9.0`](https://renovatebot.com/diffs/npm/degit/3.8.0/3.9.0) |
![age](https://developer.mend.io/api/mc/badges/age/npm/degit/3.9.0?slim=true)
|
![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/degit/3.9.0?slim=true)
|
![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/degit/3.8.0/3.9.0?slim=true)
|
![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/degit/3.8.0/3.9.0?slim=true)
|
|
[serialize-javascript](https://redirect.github.com/yahoo/serialize-javascript)
| [`7.1.0` →
`7.1.1`](https://renovatebot.com/diffs/npm/serialize-javascript/7.1.0/7.1.1)
|
![age](https://developer.mend.io/api/mc/badges/age/npm/serialize-javascript/7.1.1?slim=true)
|
![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/serialize-javascript/7.1.1?slim=true)
|
![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/serialize-javascript/7.1.0/7.1.1?slim=true)
|
![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/serialize-javascript/7.1.0/7.1.1?slim=true)
|
| [tsx](https://tsx.hirok.io)
([source](https://redirect.github.com/privatenumber/tsx)) | [`4.23.12` →
`4.23.13`](https://renovatebot.com/diffs/npm/tsx/4.23.12/4.23.13) |
![age](https://developer.mend.io/api/mc/badges/age/npm/tsx/4.23.13?slim=true)
|
![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/tsx/4.23.13?slim=true)
|
![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/tsx/4.23.12/4.23.13?slim=true)
|
![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/tsx/4.23.12/4.23.13?slim=true)
|
| [type-fest](https://redirect.github.com/sindresorhus/type-fest) |
[`5.8.0` →
`5.9.0`](https://renovatebot.com/diffs/npm/type-fest/5.8.0/5.9.0) |
![age](https://developer.mend.io/api/mc/badges/age/npm/type-fest/5.9.0?slim=true)
|
![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/type-fest/5.9.0?slim=true)
|
![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/type-fest/5.8.0/5.9.0?slim=true)
|
![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/type-fest/5.8.0/5.9.0?slim=true)
|

---

### Release Notes

<details>
<summary>typescript-eslint/typescript-eslint
(@&#8203;typescript-eslint/parser)</summary>

###
[`v8.69.0`](https://redirect.github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/parser/CHANGELOG.md#8690-2026-08-31)

[Compare
Source](https://redirect.github.com/typescript-eslint/typescript-eslint/compare/v8.68.0...v8.69.0)

This was a version bump only for parser to align it with other projects,
there were no code changes.

See [GitHub
Releases](https://redirect.github.com/typescript-eslint/typescript-eslint/releases/tag/v8.69.0)
for more information.

You can read about our [versioning
strategy](https://typescript-eslint.io/users/versioning) and
[releases](https://typescript-eslint.io/users/releases) on our website.

</details>

<details>
<summary>typescript-eslint/typescript-eslint
(@&#8203;typescript-eslint/scope-manager)</summary>

###
[`v8.69.0`](https://redirect.github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/scope-manager/CHANGELOG.md#8690-2026-08-31)

[Compare
Source](https://redirect.github.com/typescript-eslint/typescript-eslint/compare/v8.68.0...v8.69.0)

This was a version bump only for scope-manager to align it with other
projects, there were no code changes.

See [GitHub
Releases](https://redirect.github.com/typescript-eslint/typescript-eslint/releases/tag/v8.69.0)
for more information.

You can read about our [versioning
strategy](https://typescript-eslint.io/users/versioning) and
[releases](https://typescript-eslint.io/users/releases) on our website.

</details>

<details>
<summary>typescript-eslint/typescript-eslint
(@&#8203;typescript-eslint/visitor-keys)</summary>

###
[`v8.69.0`](https://redirect.github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/visitor-keys/CHANGELOG.md#8690-2026-08-31)

[Compare
Source](https://redirect.github.com/typescript-eslint/typescript-eslint/compare/v8.68.0...v8.69.0)

This was a version bump only for visitor-keys to align it with other
projects, there were no code changes.

See [GitHub
Releases](https://redirect.github.com/typescript-eslint/typescript-eslint/releases/tag/v8.69.0)
for more information.

You can read about our [versioning
strategy](https://typescript-eslint.io/users/versioning) and
[releases](https://typescript-eslint.io/users/releases) on our website.

</details>

<details>
<summary>Rich-Harris/degit (degit)</summary>

###
[`v3.9.0`](https://redirect.github.com/Rich-Harris/degit/releases/tag/v3.9.0):
3.9.0

[Compare
Source](https://redirect.github.com/Rich-Harris/degit/compare/v3.8.0...v3.9.0)

- Add `Degit#doActions()` for programmatic `degit.json` actions and make
the constructor source-optional
([#&#8203;33](https://redirect.github.com/Rich-Harris/degit/issues/33)).

</details>

<details>
<summary>yahoo/serialize-javascript (serialize-javascript)</summary>

###
[`v7.1.1`](https://redirect.github.com/yahoo/serialize-javascript/releases/tag/v7.1.1)

[Compare
Source](https://redirect.github.com/yahoo/serialize-javascript/compare/v7.1.0...v7.1.1)

#### What's Changed

- fix: fix XSS bypass via split `</script` payload across function
bodies by [@&#8203;okuryu](https://redirect.github.com/okuryu) in
[#&#8203;226](https://redirect.github.com/yahoo/serialize-javascript/pull/226)
- release: v7.1.1 by
[@&#8203;okuryu](https://redirect.github.com/okuryu) in
[#&#8203;227](https://redirect.github.com/yahoo/serialize-javascript/pull/227)

**Full Changelog**:
<https://github.com/yahoo/serialize-javascript/compare/v7.1.0...v7.1.1>

</details>

<details>
<summary>privatenumber/tsx (tsx)</summary>

###
[`v4.23.13`](https://redirect.github.com/privatenumber/tsx/compare/v4.23.12...28e1f12d04cd2afe1db17f8555b14fe5fb567c6e)

[Compare
Source](https://redirect.github.com/privatenumber/tsx/compare/v4.23.12...v4.23.13)

</details>

<details>
<summary>sindresorhus/type-fest (type-fest)</summary>

###
[`v5.9.0`](https://redirect.github.com/sindresorhus/type-fest/releases/tag/v5.9.0)

[Compare
Source](https://redirect.github.com/sindresorhus/type-fest/compare/v5.8.0...v5.9.0)

##### New types

-
[`RenameKeys`](https://redirect.github.com/sindresorhus/type-fest/blob/main/source/rename-keys.d.ts)
([#&#8203;1435](https://redirect.github.com/sindresorhus/type-fest/issues/1435))
[`548e7df`](https://redirect.github.com/sindresorhus/type-fest/commit/548e7df)

##### Improvements

- `SharedUnionFieldsDeep`: Ensure it doesn't distribute processed union
over mapped type
([#&#8203;1509](https://redirect.github.com/sindresorhus/type-fest/issues/1509))
[`07a04de`](https://redirect.github.com/sindresorhus/type-fest/commit/07a04de)
- `TypedArray`: Add `Float16Array`
([#&#8203;1495](https://redirect.github.com/sindresorhus/type-fest/issues/1495))
[`ca27cce`](https://redirect.github.com/sindresorhus/type-fest/commit/ca27cce)

##### Fixes

- `Writable`: Fix behavior with index signatures
([#&#8203;1470](https://redirect.github.com/sindresorhus/type-fest/issues/1470))
[`48ddc4b`](https://redirect.github.com/sindresorhus/type-fest/commit/48ddc4b)
- `Jsonify`: Fix optional properties leaking `undefined` into the key
set
([#&#8203;1484](https://redirect.github.com/sindresorhus/type-fest/issues/1484))
[`5339fb3`](https://redirect.github.com/sindresorhus/type-fest/commit/5339fb3)
- `IsLiteral*`: Fix behavior with unions
([#&#8203;1482](https://redirect.github.com/sindresorhus/type-fest/issues/1482))
[`3425142`](https://redirect.github.com/sindresorhus/type-fest/commit/3425142)

***

</details>

---

### Configuration

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

- Branch creation
  - "before 10am on monday"
- Automerge
  - At any time (no schedule defined)

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR is behind base branch, 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:eyJjcmVhdGVkSW5WZXIiOiI0NC42MS4zIiwidXBkYXRlZEluVmVyIjoiNDQuNjEuMyIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Cameron Clark <cameron.clark@hey.com>
2026-09-06 21:05:25 +00:00
renovate[bot] 3d6ddcef32 chore(deps): update rust crates (#26365)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [indexmap](https://redirect.github.com/indexmap-rs/indexmap) |
workspace.dependencies | patch | `2.14.1` → `2.14.2` |
| [mimalloc-safe](https://redirect.github.com/napi-rs/mimalloc-safe) |
workspace.dependencies | patch | `0.1.65` → `0.1.66` |
| [smallvec](https://redirect.github.com/servo/rust-smallvec) |
workspace.dependencies | minor | `1.15.2` → `1.16.0` |
| [syn](https://redirect.github.com/dtolnay/syn) |
workspace.dependencies | patch | `3.0.4` → `3.0.5` |
| [toml](https://redirect.github.com/toml-rs/toml) |
workspace.dependencies | patch | `1.1.4+spec-1.1.0` → `1.1.5` |
| [ureq](https://redirect.github.com/algesten/ureq) |
workspace.dependencies | patch | `3.4.0` → `3.4.1` |

---

### Release Notes

<details>
<summary>indexmap-rs/indexmap (indexmap)</summary>

###
[`v2.14.2`](https://redirect.github.com/indexmap-rs/indexmap/blob/HEAD/RELEASES.md#2142-2026-09-04)

[Compare
Source](https://redirect.github.com/indexmap-rs/indexmap/compare/2.14.1...2.14.2)

- Fix item hygiene in map and set macros. Previously, an internal `const
CAP`
  could shadow the same name in the caller's namespace.
- Allow `const` initialization of empty `indexmap_with_default!` and
`indexset_with_default!`. The hasher may also be omitted if it's
inferrable.

</details>

<details>
<summary>napi-rs/mimalloc-safe (mimalloc-safe)</summary>

###
[`v0.1.66`](https://redirect.github.com/napi-rs/mimalloc-safe/blob/HEAD/CHANGELOG.md#0166---2026-09-04)

[Compare
Source](https://redirect.github.com/napi-rs/mimalloc-safe/compare/mimalloc-safe-v0.1.65...mimalloc-safe-v0.1.66)

##### Bug Fixes

- *(sys)* Mimalloc3 v3.5.1 + fix for the process-init thread's
thread-done hook
([#&#8203;97](https://redirect.github.com/napi-rs/mimalloc-safe/pull/97))

##### Chore

- *(deps)* Update dependency
[@&#8203;napi-rs/cli](https://redirect.github.com/napi-rs/cli) to v3.9.0
([#&#8203;94](https://redirect.github.com/napi-rs/mimalloc-safe/pull/94))
- *(deps)* Update dependency
[@&#8203;emnapi/core](https://redirect.github.com/emnapi/core) to
v2.0.0-alpha.5
([#&#8203;95](https://redirect.github.com/napi-rs/mimalloc-safe/pull/95))
- *(deps)* Update dependency
[@&#8203;emnapi/runtime](https://redirect.github.com/emnapi/runtime) to
v2.0.0-alpha.5
([#&#8203;96](https://redirect.github.com/napi-rs/mimalloc-safe/pull/96))
- *(deps)* Update mimalloc (v2) submodule to v2.5.1
([#&#8203;98](https://redirect.github.com/napi-rs/mimalloc-safe/pull/98))

</details>

<details>
<summary>servo/rust-smallvec (smallvec)</summary>

###
[`v1.16.0`](https://redirect.github.com/servo/rust-smallvec/releases/tag/v1.16.0)

[Compare
Source](https://redirect.github.com/servo/rust-smallvec/compare/v1.15.2...v1.16.0)

#### What's Changed

- Include debug\_metadata/\*.natvis in the published crate to fix
debugger\_visualizer/docs.rs build by
[@&#8203;teddytennant](https://redirect.github.com/teddytennant) in
[#&#8203;417](https://redirect.github.com/servo/rust-smallvec/pull/417)
- feat: removed debugger visualizer + tests by
[@&#8203;alejandro-vaz](https://redirect.github.com/alejandro-vaz) in
[#&#8203;420](https://redirect.github.com/servo/rust-smallvec/pull/420)
- feat: added style check to CI && rustfmt.toml by
[@&#8203;alejandro-vaz](https://redirect.github.com/alejandro-vaz) in
[#&#8203;436](https://redirect.github.com/servo/rust-smallvec/pull/436)

#### New Contributors

- [@&#8203;teddytennant](https://redirect.github.com/teddytennant) made
their first contribution in
[#&#8203;417](https://redirect.github.com/servo/rust-smallvec/pull/417)

**Full Changelog**:
<https://github.com/servo/rust-smallvec/compare/v1.15.2...v1.16.0>

</details>

<details>
<summary>dtolnay/syn (syn)</summary>

###
[`v3.0.5`](https://redirect.github.com/dtolnay/syn/releases/tag/3.0.5)

[Compare
Source](https://redirect.github.com/dtolnay/syn/compare/3.0.4...3.0.5)

- Report correct span for lex errors from `LitStr::parse_with`
([#&#8203;2080](https://redirect.github.com/dtolnay/syn/issues/2080),
thanks [@&#8203;sunshowers](https://redirect.github.com/sunshowers))

</details>

<details>
<summary>toml-rs/toml (toml)</summary>

###
[`v1.1.5`](https://redirect.github.com/toml-rs/toml/compare/toml-v1.1.4...toml-v1.1.5)

[Compare
Source](https://redirect.github.com/toml-rs/toml/compare/toml-v1.1.4...toml-v1.1.5)

</details>

<details>
<summary>algesten/ureq (ureq)</summary>

###
[`v3.4.1`](https://redirect.github.com/algesten/ureq/blob/HEAD/CHANGELOG.md#341)

[Compare
Source](https://redirect.github.com/algesten/ureq/compare/3.4.0...3.4.1)

- Bump ureq-proto to 0.6.2 (fixes to parsing and headers)
[#&#8203;1199](https://redirect.github.com/algesten/ureq/issues/1199)
- Do not pool connections with unconsumed buffered input
[#&#8203;1198](https://redirect.github.com/algesten/ureq/issues/1198)
- Fix timeout budgets restarting and applying to later phases
[#&#8203;1194](https://redirect.github.com/algesten/ureq/issues/1194)
- Complete TLS handshake during connect so timeout\_connect covers it
[#&#8203;1193](https://redirect.github.com/algesten/ureq/issues/1193)
- Speed up read\_json for responses with a known, small body size
[#&#8203;1191](https://redirect.github.com/algesten/ureq/issues/1191)

</details>

---

### Configuration

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

- Branch creation
  - "before 10am on monday"
- Automerge
  - At any time (no schedule defined)

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR is behind base branch, 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:eyJjcmVhdGVkSW5WZXIiOiI0NC42MS4zIiwidXBkYXRlZEluVmVyIjoiNDQuNjEuMyIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-09-06 17:31:21 +00:00
renovate[bot] 9688d38dfa chore(deps): update github actions (#26364)
This PR contains the following updates:

| Package | Type | Update | Change | Pending |
|---|---|---|---|---|
|
[benc-uk/workflow-dispatch](https://redirect.github.com/benc-uk/workflow-dispatch)
| action | patch | `v1.3.2` → `v1.3.3` | |
| [mlugg/setup-zig](https://redirect.github.com/mlugg/setup-zig) |
action | minor | `v2` → `v2.2.1` | |
|
[semgrep/semgrep](https://redirect.github.com/semgrep/semgrep-proprietary)
| container | minor | `1.175.0` → `1.176.0` | `1.176.1` |
|
[taiki-e/install-action](https://redirect.github.com/taiki-e/install-action)
| action | patch | `v2.87.0` → `v2.87.4` | `v2.87.6` (+1) |

---

### Release Notes

<details>
<summary>benc-uk/workflow-dispatch (benc-uk/workflow-dispatch)</summary>

###
[`v1.3.3`](https://redirect.github.com/benc-uk/workflow-dispatch/releases/tag/v1.3.3)

[Compare
Source](https://redirect.github.com/benc-uk/workflow-dispatch/compare/v1.3.2...v1.3.3)

##### What's changed since v1.3.2

##### Fixed

- Continue polling while a dispatched workflow run is in the `pending`
state, preventing premature completion warnings and a `null` conclusion
for workflows using concurrency groups or waiting for a runner.
([#&#8203;97](https://redirect.github.com/benc-uk/workflow-dispatch/issues/97),
fixes
[#&#8203;106](https://redirect.github.com/benc-uk/workflow-dispatch/issues/106))

##### Notes

- No breaking changes.
- The floating `v1` and `v1.3` tags have been moved to point at
`v1.3.3`.

**Full changelog**:
<https://github.com/benc-uk/workflow-dispatch/compare/v1.3.2...v1.3.3>

</details>

<details>
<summary>mlugg/setup-zig (mlugg/setup-zig)</summary>

###
[`v2.2.1`](https://redirect.github.com/mlugg/setup-zig/releases/tag/v2.2.1)

[Compare
Source](https://redirect.github.com/mlugg/setup-zig/compare/v2.2.0...v2.2.1)

- Print which version of Zig was installed
- Add a little more log output (helps debug cache issues)

> \[!NOTE]
> The setup-zig project is now hosted on
[Codeberg](https://codeberg.org/mlugg/setup-zig), and this GitHub
repository exists as a mirror solely to work around the vendor lock-in
mechanisms employed by GitHub Actions. While there are **no plans** to
discontinue GitHub Actions support, I would nonetheless encourage users
to consider upgrading to Forgejo Actions on a non-profit forge like
Codeberg to avoid being affected by GitHub's profit-driven behavior
(such as attempting to [charge users by the minute for using their own
hardware](https://resources.github.com/actions/2026-pricing-changes-for-github-actions/)).

###
[`v2.2.0`](https://redirect.github.com/mlugg/setup-zig/releases/tag/v2.2.0)

[Compare
Source](https://redirect.github.com/mlugg/setup-zig/compare/v2.1.0...v2.2.0)

- Update dependencies
- Replace libsodium dependency with node:crypto, improving target
support
- Use hardcoded mirror list when ziglang.org is inaccessible
- Fix incorrect tarball names when fetching certain versions

> \[!NOTE]
> The setup-zig project is now hosted on
[Codeberg](https://codeberg.org/mlugg/setup-zig), and this GitHub
repository exists as a mirror solely to work around the vendor lock-in
mechanisms employed by GitHub Actions. While there are **no plans** to
discontinue GitHub Actions support, I would nonetheless encourage users
to consider upgrading to Forgejo Actions on a non-profit forge like
Codeberg to avoid being affected by GitHub's profit-driven behavior
(such as attempting to [charge users by the minute for using their own
hardware](https://resources.github.com/actions/2026-pricing-changes-for-github-actions/)).

###
[`v2.1.0`](https://redirect.github.com/mlugg/setup-zig/releases/tag/v2.1.0)

[Compare
Source](https://redirect.github.com/mlugg/setup-zig/compare/v2.0.5...v2.1.0)

- Support Forgejo Actions
- Support recent Zig versions on ARM
- Progress towards better OS support
- Redirect Zig caches to working directory to avoid sharing the cache on
self-hosted runners

###
[`v2.0.5`](https://redirect.github.com/mlugg/setup-zig/releases/tag/v2.0.5)

[Compare
Source](https://redirect.github.com/mlugg/setup-zig/compare/v2.0.4...v2.0.5)

- Fix exception identifying Zig cache directory on recent Zig builds
([#&#8203;49](https://redirect.github.com/mlugg/setup-zig/issues/49))

###
[`v2.0.4`](https://redirect.github.com/mlugg/setup-zig/releases/tag/v2.0.4)

[Compare
Source](https://redirect.github.com/mlugg/setup-zig/compare/v2.0.3...v2.0.4)

- Fix canonical `ziglang.org` download URL
- Use more descriptive `?source` query parameter value

###
[`v2.0.3`](https://redirect.github.com/mlugg/setup-zig/releases/tag/v2.0.3)

[Compare
Source](https://redirect.github.com/mlugg/setup-zig/compare/v2.0.2...v2.0.3)

This release switches from a hardcoded `mirrors.json` list, to fetching
the list of mirrors [now
available](https://ziglang.org/download/community-mirrors/) from the Zig
website. There are no user-facing changes.

###
[`v2.0.2`](https://redirect.github.com/mlugg/setup-zig/releases/tag/v2.0.2)

[Compare
Source](https://redirect.github.com/mlugg/setup-zig/compare/v2.0.1...v2.0.2)

- Update dependencies
- Remove some mirrors experiencing issues
- Don't use tool cache on GitHub-hosted runners by default
([#&#8203;34](https://redirect.github.com/mlugg/setup-zig/issues/34))
- Improve logging, in particular to help debug potential issues

###
[`v2.0.1`](https://redirect.github.com/mlugg/setup-zig/releases/tag/v2.0.1)

[Compare
Source](https://redirect.github.com/mlugg/setup-zig/compare/v2...v2.0.1)

The recent Zig 0.14.1 release flipped the "arch" and "OS" fields in the
tarball name; for instance, `zig-x86_64-linux-0.14.1.tar.xz` instead of
`zig-linux-x86_64-0.14.1.tar.xz`. This brings the tarball names in line
with target triple syntax.

The change does *not* retroactively apply to old Zig tarballs.

So, this patch has only one fix:

- Add support for new Zig tarball name format as of Zig 0.14.1 /
0.15.0-dev.631+9a3540d61

> \[!NOTE]
>
> **I do not intend to update v1 to support the new tarball name
format.**
> `setup-zig` version 1 is considered deprecated. Please upgrade to
version 2.

</details>

<details>
<summary>taiki-e/install-action (taiki-e/install-action)</summary>

###
[`v2.87.4`](https://redirect.github.com/taiki-e/install-action/releases/tag/v2.87.4):
2.87.4

[Compare
Source](https://redirect.github.com/taiki-e/install-action/compare/v2.87.3...v2.87.4)

- Update `uv@latest` to 0.12.8.

- Update `protoc@latest` to 3.36.1.

- Update `coreutils@latest` to 0.11.0.

###
[`v2.87.3`](https://redirect.github.com/taiki-e/install-action/releases/tag/v2.87.3):
2.87.3

[Compare
Source](https://redirect.github.com/taiki-e/install-action/compare/v2.87.2...v2.87.3)

- Update `zizmor@latest` to 1.30.0.

- Update `ubi@latest` to 0.12.0.

- Update `protoc-gen-connect-openapi@latest` to 0.25.8.

- Update `mise@latest` to 2026.8.16.

- Update `kingfisher@latest` to 2.1.0.

- Update `dprint@latest` to 0.57.0.

###
[`v2.87.2`](https://redirect.github.com/taiki-e/install-action/releases/tag/v2.87.2):
2.87.2

[Compare
Source](https://redirect.github.com/taiki-e/install-action/compare/v2.87.1...v2.87.2)

- Update `typos@latest` to 1.50.0.

- Update `tombi@latest` to 1.5.0.

- Update `shfmt@latest` to 3.14.0.

###
[`v2.87.1`](https://redirect.github.com/taiki-e/install-action/releases/tag/v2.87.1):
2.87.1

[Compare
Source](https://redirect.github.com/taiki-e/install-action/compare/v2.87.0...v2.87.1)

- Update `uv@latest` to 0.12.7.

- Update `typos@latest` to 1.49.1.

- Update `syft@latest` to 1.51.1.

- Update `prek@latest` to 0.5.0.

- Update `d2@latest` to 0.8.2.

- Update `cargo-zigbuild@latest` to 0.23.3.

- Update `cargo-rdme@latest` to 2.2.2.

- Update `biome@latest` to 2.5.11.

</details>

---

### Configuration

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

- Branch creation
  - "before 10am on monday"
- Automerge
  - At any time (no schedule defined)

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR is behind base branch, 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:eyJjcmVhdGVkSW5WZXIiOiI0NC42MS4zIiwidXBkYXRlZEluVmVyIjoiNDQuNjEuMyIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-09-06 17:24:53 +00:00
Sysix 5a52c8d53d test(oxlint/lsp): avoid calling run_file (#26353)
`run_file` is an internal function, which does not get called by the language server.
Instead, it calls the parent function `run_diagnostic`. Refactor the code, so internal implication is kept secret in tests.
2026-09-06 15:08:44 +00:00
Mikhail Baev 562dd14e3d fix(jsx-a11y/anchor-has-content): allow anchors passed as custom component props (#26360) 2026-09-06 10:54:29 +00:00
camc314 457ed57ff2 fix(semantic): reject await and yield in rest parameter defaults (#26359)
The parameter check only recognized `FormalParameter`, allowing `await` and `yield` in destructuring defaults inside rest parameters:

```js
async function f(...[x = await 0]) {}
function* g(...[x = yield 0]) {}
```

Include `FormalParameterRest` so both cases report the existing parameter diagnostic. The check still stops at nested functions, where `await` and `yield` can be valid.
2026-09-06 08:36:56 +00:00
camc314 4b89c7bd55 fix(semantic): reject jumps across arrow functions (#26357)
Reject labeled and unlabeled `break` and `continue` statements that cross an arrow-function boundary.

For example:
```ts
while (true) {
  (() => {
    break;
  });
}
```

now reports an illegal break, while jumps targeting loops inside the arrow remain valid.
2026-09-06 07:44:47 +00:00
sapphi-red 5b3e335484 perf(minifier): use Ident instead of Str in KeepVar (#26332)
Use `Ident` instead of `Str` in `KeepVar`. This reduces the `Ident` -> `Str` -> `Ident` conversion.

I used AI to generate the code and then reviewed the code.
2026-09-06 07:32:33 +00:00
sapphi-red 51366fb9ff perf(minifier): use IdentHashSet in PrivateMemberUsageStack (#26331)
Use `IdentHashSet` in `PrivateMemberUsageStack`. This reduces the `Ident` -> `Str` conversion and also makes the `Set::contains` operation faster as the hashing doesn't happen.

I used AI to generate the code and then reviewed the code.
2026-09-06 07:27:08 +00:00
Armano d19c42ac87 perf(minifier): merge nested if stmt in place instead of creating dummies (#26351)
reduce allocations when converting `if (a) if (b) x;` to `if (a && b)
x;`
2026-09-05 22:51:23 +01:00
overlookmotel 356def6598 perf(parser): shrink annotation comment ranges (#26356)
`TriviaBuilder::pure_comments` and `no_side_effects_comments` are index ranges into `comments`.

Previously they were stored as `Option<(usize, usize)>` (24 bytes). Instead, store them as `Option<(u32, NonZeroU32)>` (8 bytes, due to `NonZeroU32`'s niche).

`end` is always at least `start + 1`, so it cannot be 0. Comment count cannot exceed `u32::MAX` because of the `MAX_LEN` check in `Source::new`.

`LexerCheckpoint` contains both ranges, so this change shrinks it by 32 bytes.
2026-09-05 19:15:11 +00:00
overlookmotel a5be474fcf perf(parser): shave instruction off parse_jsx_element_name (#26355)
Micro-optimization to `parse_jsx_element_name`.

`parse_jsx_element_name` inspects the first byte of the identifier name to determine if it should be treated as a reference (`<Foo>` vs `<div>`).

`parse_jsx_identifier` already ensured the identifier is valid, so that first byte can only be one of `[A-Za-z$_]` or the identifier starts with a non-ASCII character. Utilize this constraint to make the "is this a reference" check cheaper.

The new version compiles down to a single `cmp` instruction, shaving off one instruction from the previous version.

It's only 1 instruction, but why not?
2026-09-05 19:15:10 +00:00
overlookmotel 9780663c17 perf(parser): remove fatal error guard from parse_jsx_element_name (#26354)
Small perf optimization to parser.

Remove the `if self.fatal_error.is_some()` branch from `parse_jsx_element_name`.

The guard existed so that code below it doesn't try to read the first byte of the dummy identifier's empty name after `parse_jsx_identifier` fails. Instead, make the error path return `contains_dash = true`, which skips reading the name in `parse_jsx_element_name`.

In `parse_jsx_member_expression`, a dash is already treated as an error, and its `fatal_error` call is a no-op because a fatal error has already been recorded. The other callers ignore the flag.

This removes a check, but main motivation is preparation for larger changes to how fatal errors are handled in further PRs to follow.
2026-09-05 19:15:10 +00:00
Sysix a5a4ac8811 refactor(lsp): ToolTrait consume TextDocument & CodeActionParams (#26339)
Refactors the `oxc_language_server::Tool` trait and associated LSP plumbing to pass `TextDocument` and `CodeActionParams` by value, aligning tool APIs with “consume” semantics and simplifying call sites that previously had to keep borrowed values alive.
2026-09-05 18:33:58 +00:00
overlookmotel 2c9a947363 feat(parser)!: reduce MAX_LEN to 256 bytes below u32::MAX (#26352)
Technically a breaking change, but one that's extremely unlikely to affect any real-world applications.

On 64-bit systems, the maximum source text length was exactly `u32::MAX`.

Lower it by 256 bytes, for 2 reasons:

1. `oxc_lexer` will require source text to be followed by 64 bytes of padding. Reducing max source length ensures _padded_ length can always fit in a `u32`.
2. Counts of tokens, comments and errors are all bounded by source length plus a small constant. By reducing max source length, these can all be stored as `u32`s without any possibility of overflow.

`oxc_lexer` only needs 64 bytes of padding. Have gone with 256 to leave headroom in case later redesigns require more than 64. This avoids another breaking change later. We can always switch to 64 later on if we want, and this later relaxation would not be a breaking change.

All the changes to other crates in this PR are just updating comments which talk about max source length.
2026-09-05 15:33:52 +00:00
overlookmotel 766e12f420 perf(parser): remove token field from LexerCheckpoint (#26350)
Small perf optimization to parser.

`Lexer::token` is the token currently being built. Every method which produces a token ends in `finish_next_inner` or `finish_re_lex`, and both reset it to `Token::default()`. So between lexer calls it is always `Token::default()`, so there is no point in saving and restoring it - it's always a no-op.

Remove the `token` field from `LexerCheckpoint`, which reduces its size by 16 bytes.

Add a debug asserts in `checkpoint` and `checkpoint_with_error_recovery` checking this invariant.
2026-09-05 15:33:51 +00:00
overlookmotel b285987970 refactor(parser): remove unused Clone derives from checkpoint types (#26349)
Pure refactor.

`ParserCheckpoint`, `LexerCheckpoint` and `ErrorSnapshot` are never cloned, so remove `#[derive(Clone)]` from them.
2026-09-05 15:33:51 +00:00
overlookmotel 81bd50a675 refactor(parser): rename ParserCheckpoint::prev_span_end to prev_token_end (#26348)
Pure refactor.

Rename the field of `ParserCheckpoint` to match the `ParserImpl` field that it saves and restores.
2026-09-05 15:33:51 +00:00
Sysix ca7104f775 refactor(lsp): dont create temporary map in collect_diagnostics_with (#26341)
<summary>Pull request overview</summary>

This PR refactors the language server’s `WorkspaceWorker::collect_diagnostics_with` to avoid building an intermediate map when collecting tool diagnostics, returning the tool’s `DiagnosticResult` directly.

This was an old code path when `oxc_language_server` did used both tools (`oxlint` & `oxfmt`) at the same time
2026-09-04 21:36:42 +00:00
renovate[bot] 04b8957242 chore(deps): update crate-ci/typos action to v1.50.1 (#26340)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [crate-ci/typos](https://redirect.github.com/crate-ci/typos) | action
| patch | `v1.50.0` → `v1.50.1` |

---

### Release Notes

<details>
<summary>crate-ci/typos (crate-ci/typos)</summary>

###
[`v1.50.1`](https://redirect.github.com/crate-ci/typos/releases/tag/v1.50.1)

[Compare
Source](https://redirect.github.com/crate-ci/typos/compare/v1.50.0...v1.50.1)

#### \[1.50.1] - 2026-09-01

##### Fixes

- Don't correct `asend` in Python code

</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:eyJjcmVhdGVkSW5WZXIiOiI0NC42MS4zIiwidXBkYXRlZEluVmVyIjoiNDQuNjEuMyIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-09-04 18:00:40 +00:00
overlookmotel 696bf3db81 chore(codeowners): attribute ownership of allocation tracking snapshots to the relevant crate owners (#26330)
I am the codeowner of memory allocation tracking infra. However, this has meant that I get added as a reviewer on every PR which alters the snapshot files (notably a torrent of PRs on minifier, which I know nothing about). This makes it harder to track what PRs I _should_ actually be looking at.

Attribute ownership of the snapshot files to the codeowners of the relevant crates. This seems more logical.
2026-09-04 15:32:05 +00:00
renovate[bot] 8dd81f9bb8 chore(deps): update dependency @napi-rs/cli to v3.9.0 (#26256)
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/) |
|---|---|---|---|---|---|
| [@napi-rs/cli](https://napi.rs/)
([source](https://redirect.github.com/napi-rs/napi-rs)) | [`3.8.6` →
`3.9.0`](https://renovatebot.com/diffs/npm/@napi-rs%2fcli/3.8.6/3.9.0) |
![age](https://developer.mend.io/api/mc/badges/age/npm/@napi-rs%2fcli/3.9.0?slim=true)
|
![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@napi-rs%2fcli/3.9.0?slim=true)
|
![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@napi-rs%2fcli/3.8.6/3.9.0?slim=true)
|
![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@napi-rs%2fcli/3.8.6/3.9.0?slim=true)
|

---

> [!WARNING]
> Some dependencies could not be looked up. Check the warning logs for
more information.

---

### Release Notes

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

###
[`v3.9.0`](https://redirect.github.com/napi-rs/napi-rs/compare/@napi-rs/cli@3.8.6...@napi-rs/cli@3.9.0)

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

</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:eyJjcmVhdGVkSW5WZXIiOiI0NC41Ny4zIiwidXBkYXRlZEluVmVyIjoiNDQuNjEuMyIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Cameron <cameron.clark@hey.com>
2026-09-04 14:22:16 +00:00
Sysix 3b7e45399d refactor(oxlint/lsp): remove offset_to_position (#26336)
With https://github.com/oxc-project/oxc/pull/23329 the conversion from offset to line/column position is now done by a helper function in `oxc_language_server`.
There was a helper function inside `oxlint` to call the function. Instead, call it directly now.
Moved the tests to the correct place, and removed duplicated ones.
2026-09-04 14:00:48 +00:00
Sysix 2a68cc458b refactor(oxlint/lsp): remove Option for code actions map (#26335)
The `Option<>` wrap for `Vec<LinterCodeAction>` is not needed, after each lint-run we save an entry (even if empty) to the map.
There is no different code branch for `None` as a value.
2026-09-04 13:31:46 +00:00
overlookmotel 613bc92c2e chore(codeowners): add @overlookmotel as codeowner of oxc_lexer (#26329)
I'm not actually the primary owner of this code - @ShanonJackson is. But add me to codeowners file, so I get added as a reviewer on any PRs touching the crate, so I don't miss them.
2026-09-04 13:25:58 +00:00
renovate[bot] 007a9fdc64 chore(deps): update dependency tsdown to v0.23.0 (#26300)
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/) |
|---|---|---|---|---|---|
| [tsdown](http://tsdown.dev/)
([source](https://redirect.github.com/rolldown/tsdown)) | [`0.22.14` →
`0.23.0`](https://renovatebot.com/diffs/npm/tsdown/0.22.14/0.23.0) |
![age](https://developer.mend.io/api/mc/badges/age/npm/tsdown/0.23.0?slim=true)
|
![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/tsdown/0.23.0?slim=true)
|
![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/tsdown/0.22.14/0.23.0?slim=true)
|
![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/tsdown/0.22.14/0.23.0?slim=true)
|

---

### Release Notes

<details>
<summary>rolldown/tsdown (tsdown)</summary>

###
[`v0.23.0`](https://redirect.github.com/rolldown/tsdown/releases/tag/v0.23.0)

[Compare
Source](https://redirect.github.com/rolldown/tsdown/compare/v0.22.14...v0.23.0)

#####    🧭 Migration Guide

Most users can upgrade directly. Before upgrading, run one final build
with `tsdown@0.22.14` and resolve all deprecation warnings.

- **config**:
  - `bundle: false` → `unbundle: true`; `bundle: true` can be removed
  - `outExtension` → `outExtensions`
  - `publicDir` / `--public-dir` → `copy` / `--copy`
  - `removeNodeProtocol: true` → `nodeProtocol: 'strip'`
  - `injectStyle` → `css.inject`
- **deps**:
  - `inlineOnly` / `deps.onlyAllowBundle` → `deps.onlyBundle`
  - `skipNodeModulesBundle: true` → `deps.neverBundle: true`
- `resolveDepSubpath` now defaults to `false`; set it to `true` to
preserve the previous behavior
- **dts**:
- Select a generator with `dts.generator`, for example `{ generator:
'oxc' }`
- `dts.cjsReexport` was removed; dual-format builds now generate CJS
declarations in a separate pass
- **attw**:
- The default profile changed from `strict` to `esm-only`; set `profile:
'strict'` to preserve the previous checks
- **programmatic API**:
- `build()` now returns `{ bundles, watch }`; replace `const bundles =
await build()` with `const { bundles } = await build()`
- **requirements**:
- Node.js 25 is no longer supported; use `^22.18.0`, `^24.11.0`, or
`>=26.0.0`
- The packages no longer publish legacy `types` and `typesVersions`
fallbacks; use TypeScript’s `bundler`, `node16`, or `nodenext` module
resolution

#####    🚨 Breaking Changes

- Drop support for Node.js 25  -  by
[@&#8203;sxzz](https://redirect.github.com/sxzz)
[<samp>(26950)</samp>](https://redirect.github.com/rolldown/tsdown/commit/26950f1)
- Remove deprecated tsup compatibility options  -  by
[@&#8203;sxzz](https://redirect.github.com/sxzz)
[<samp>(50766)</samp>](https://redirect.github.com/rolldown/tsdown/commit/507661c)
- Drop `types` and `typesVersions`fields  -  by
[@&#8203;sxzz](https://redirect.github.com/sxzz)
[<samp>(be3ea)</samp>](https://redirect.github.com/rolldown/tsdown/commit/be3ea86)
- **attw**:
- Change default profile to `esm-only`  -  by
[@&#8203;sxzz](https://redirect.github.com/sxzz)
[<samp>(9b3cf)</samp>](https://redirect.github.com/rolldown/tsdown/commit/9b3cfca)
- **deps**:
- Remove deprecated `deps.onlyAllowBundle`  -  by
[@&#8203;sxzz](https://redirect.github.com/sxzz)
[<samp>(30c55)</samp>](https://redirect.github.com/rolldown/tsdown/commit/30c553d)
- Disable `resolveDepSubpath` by default  -  by
[@&#8203;sxzz](https://redirect.github.com/sxzz)
[<samp>(d300f)</samp>](https://redirect.github.com/rolldown/tsdown/commit/d300fcc)
- Remove deprecated `skipNodeModulesBundle`  -  by
[@&#8203;sxzz](https://redirect.github.com/sxzz)
[<samp>(f2a3d)</samp>](https://redirect.github.com/rolldown/tsdown/commit/f2a3d8e)
- **dts**:
- Remove dts.cjsReexport option  -  by
[@&#8203;sxzz](https://redirect.github.com/sxzz)
[<samp>(9c70f)</samp>](https://redirect.github.com/rolldown/tsdown/commit/9c70fa9)
- Make `dts.generator` the only way to select generator  -  by
[@&#8203;sxzz](https://redirect.github.com/sxzz)
[<samp>(eb75f)</samp>](https://redirect.github.com/rolldown/tsdown/commit/eb75f9d)

#####    🚀 Features

- Expose programmatic watch controls  -  by
[@&#8203;sxzz](https://redirect.github.com/sxzz) in
[#&#8203;1062](https://redirect.github.com/rolldown/tsdown/issues/1062)
[<samp>(96a40)</samp>](https://redirect.github.com/rolldown/tsdown/commit/96a4098)
- **css**: Support function form for `css.modules.localsConvention`  - 
by [@&#8203;sxzz](https://redirect.github.com/sxzz) and
[@&#8203;lazerg](https://redirect.github.com/lazerg)
[<samp>(b566f)</samp>](https://redirect.github.com/rolldown/tsdown/commit/b566f6d)
- **report**: Add `summary` option to skip per-file size logs  -  by
[@&#8203;lazerg](https://redirect.github.com/lazerg) in
[#&#8203;1036](https://redirect.github.com/rolldown/tsdown/issues/1036)
[<samp>(020e9)</samp>](https://redirect.github.com/rolldown/tsdown/commit/020e9cd)

#####    🐞 Bug Fixes

- Allow `unplugin-unused` v0.5+  -  by
[@&#8203;sxzz](https://redirect.github.com/sxzz)
[<samp>(53c78)</samp>](https://redirect.github.com/rolldown/tsdown/commit/53c78cb)
- Ignore optional dependencies in type definitions  -  by
[@&#8203;sxzz](https://redirect.github.com/sxzz)
[<samp>(94622)</samp>](https://redirect.github.com/rolldown/tsdown/commit/946224d)
- **cli**:
- Camel-case nested flag keys  -  by
[@&#8203;sxzz](https://redirect.github.com/sxzz)
[<samp>(bf53f)</samp>](https://redirect.github.com/rolldown/tsdown/commit/bf53f43)
- **css**:
- Watch files imported via `@import`  -  by
[@&#8203;lazerg](https://redirect.github.com/lazerg) in
[#&#8203;1038](https://redirect.github.com/rolldown/tsdown/issues/1038)
[<samp>(ebee5)</samp>](https://redirect.github.com/rolldown/tsdown/commit/ebee509)
- **deps**:
- Apply `resolveDepSubpath` when `neverBundle` is `true`  -  by
[@&#8203;lazerg](https://redirect.github.com/lazerg) in
[#&#8203;1053](https://redirect.github.com/rolldown/tsdown/issues/1053)
[<samp>(4943c)</samp>](https://redirect.github.com/rolldown/tsdown/commit/4943c08)
- **exports**:
- Scope inlined dependencies to configs with exports  -  by
[@&#8203;lazerg](https://redirect.github.com/lazerg) in
[#&#8203;1040](https://redirect.github.com/rolldown/tsdown/issues/1040)
[<samp>(d5b80)</samp>](https://redirect.github.com/rolldown/tsdown/commit/d5b8015)
- **migrate**:
- Pin migrated projects to tsdown 0.22.14  -  by
[@&#8203;sxzz](https://redirect.github.com/sxzz)
[<samp>(113fb)</samp>](https://redirect.github.com/rolldown/tsdown/commit/113fb8a)
- Support non-interactive environments  -  by
[@&#8203;sxzz](https://redirect.github.com/sxzz)
[<samp>(51e41)</samp>](https://redirect.github.com/rolldown/tsdown/commit/51e4183)

#####    🏎 Performance

- Remove `asyncDispose` polyfill  -  by
[@&#8203;sxzz](https://redirect.github.com/sxzz)
[<samp>(82675)</samp>](https://redirect.github.com/rolldown/tsdown/commit/826755e)
- Replace `ansis` with `util.styleText`  -  by
[@&#8203;sxzz](https://redirect.github.com/sxzz)
[<samp>(be6bf)</samp>](https://redirect.github.com/rolldown/tsdown/commit/be6bfd2)

#####     [View changes on
GitHub](https://redirect.github.com/rolldown/tsdown/compare/v0.22.14...v0.23.0)

</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:eyJjcmVhdGVkSW5WZXIiOiI0NC42MS4zIiwidXBkYXRlZEluVmVyIjoiNDQuNjEuMyIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-09-04 12:23:10 +00:00
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
camc314 6f22859717 chore(deps): update setup-node to v1.4.1 (#26296)
## Summary

- update `oxc-project/setup-node` from v1.4.0 to v1.4.1 across all workflows
- pick up `pnpm/action-setup` v6.0.10, whose newer bootstrap fixes broken `@pnpm/exe` shims during package-manager self-updates

The setup action fix was released after oxc-project/setup-node#34.
2026-09-04 10:20:51 +00:00
Pearce Ropion 253cdb2f46 fix(linter/eslint/id-length): exempt TS interface/type-literal members with never (#26310)
## Summary

The `id-length` lint rule lets users opt out of checking property name
lengths via a `properties: "never"` setting. This exemption worked
correctly for plain JavaScript object properties, but was silently
ignored for TypeScript interface members and object type literal
members. As a result, users who explicitly disabled property length
checks would still see false-positive warnings on their TypeScript type
definitions.

## Why

TypeScript interfaces and type literals describe object shapes using
their own dedicated syntax, distinct from JavaScript object literals.
The rule's internal logic only recognized the JavaScript form when
deciding whether to skip the length check, so the TypeScript equivalents
were treated as ordinary identifiers instead of property names, even
though users intended the same exemption to apply to both.

## Changes

- The rule now recognizes TypeScript interface and type literal members
as property names, so the `properties: "never"` setting applies to them
consistently with plain JavaScript object properties.
- Added test coverage confirming both the exempted and non-exempted
behavior for TypeScript interface and type literal members.

## Test plan

- Added passing test cases showing the exemption now applies to
TypeScript interface and type literal members.
- Added failing test cases confirming the rule still flags these members
under its default settings.
- Verified the fix manually against the exact reproduction case reported
in the issue, confirming the false-positive warning no longer occurs.
- Full linter test suite passes with no regressions.

## AI disclosure

Per the repo's AI usage policy: this fix was drafted with AI assistance
(Claude), and reviewed, tested, and understood by me before submission.
The linked issue itself was also AI-drafted and reviewed by me.

Resolves #26309

---------

Signed-off-by: Cameron <cameron.clark@hey.com>
Co-authored-by: Cameron <cameron.clark@hey.com>
2026-09-04 09:54:59 +01:00
leaysgur 0f4af5d7df test(formatter_tests): assert fingerprint survives formatting (#26322)
Historically, only JS formatter has had the `detect_code_removal` feature, which uses CI to check for missing nodes or comments.

While this would be useful in other languages (especially CSS), but setting up the mechanism is difficult. For now, just start with something simple that just guarantees the number of comments.

That said, even with a mechanism in place, it can't detect anything unless the cases are fully covered by fixtures, so this only tells us that the current state is problem-free.
2026-09-04 07:14:53 +00:00
leaysgur 172ddb67dc fix(formatter_css): keep a same-line line comment on its line (#26321)
Consistent output with other language formatters.
2026-09-04 07:14:53 +00:00
leaysgur cafaf32de1 fix(formatter_css): never drop comments inside an at-rule prelude (#26320)
Fix missing comment bug.
2026-09-04 07:14:52 +00:00
leaysgur 534a0fe838 fix(formatter_css): keep a line comment on its comma's line (#26319)
e.g.

```scss
$my-map: (
  "foo": 1, // Comment
  "bar": 2, // Comment
);
```

should not be formatted:

```scss
$my-map: (
  "foo": 1,
  // Comment
  "bar": 2, // Comment
);
```
2026-09-04 07:14:52 +00:00
leaysgur 99cfd7556e fix(formatter_css): hide raw comment printing API, use strcut instead (#26316)
#26313 for CSS formatter. This also fixes some bugs.
2026-09-04 07:14:52 +00:00
leaysgur 223eb9dcb8 refactor(formatter_yaml): hide raw comment printing API, use struct instead (#26315)
#26313 for YAML formatter.
2026-09-04 07:14:51 +00:00
leaysgur 54316b239f refactor(formatter_json): hide raw comment printing API, use struct instead (#26314)
#26313 for JSON formatter.
2026-09-04 07:14:51 +00:00
leaysgur fa493a735e refactor(formatter): remove impl Format for Comment for safety (#26313)
If line-comment is printed with this and forget to add `hardline` after it, content rides on line-comment and disappear.

To prevent, hide raw API and always use safer struct based one.
2026-09-04 07:14:50 +00:00
leaysgur 32084d466a docs(formatter_core): clarify printer hard_line compression (#26312)
`[hardline, hardline]` does not produce 2 line breaks. This is printer philosophy.
2026-09-04 07:14:50 +00:00
camc314 949d7a9302 chore(deps): update vitest to v5 (#26299)
## Summary

- update workspace test dependencies to Vitest 5.0.0
- pin Vitest and related tooling to Vite 8.2.2
- migrate removed sequential and benchmark APIs
- update the pnpm lockfile
2026-09-03 19:05:05 +00:00
overlookmotel b4f6593c4f ci(lexer): run lint, tests and conformance on both lexer implementations (#26298)
#26263 added the ability to run tests and conformance for both versions of `oxc_lexer` (SIMD and scalar fallback) on any platform.

Run tests and conformance on CI (both SIMD and scalar) on any PR which touches `oxc_lexer` crate or other files which affect conformance runner.

Additionally, run Clippy on the SIMD version (main Lint CI task doesn't lint it, due to the `target_feature = "avx2"` gate on the code).

All of this sets up `oxc_lexer` crate for further development, catching any regressions in CI.
2026-09-03 16:40:21 +00:00
overlookmotel 0aa2fff2eb docs(tools): add comment to lexer just recipe about running x86 version on Mac (#26297)
Follow-on after #26263. That PR added `just` commands to run `oxc_lexer` tests and conformance on any platform. Add a comment to the justfile pointing to solution for the cryptic error you get if `x86_64-apple-darwin` target is not installed on an M-chip Mac (it's not by default).
2026-09-03 16:40:20 +00:00