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
701ab87e3e
release(crates): oxc v0.101.0 ( #16381 )
2025-12-02 17:19:30 +08:00
leaysgur
8c2d09f39f
refactor(formatter/sort-imports): Resolve default options.(internalPattern|groups) in options.rs ( #16375 )
...
Yet another pure refactoring.
2025-12-02 07:37:06 +00:00
leaysgur
e5a78ed269
refactor(formatter/sort-imports): Move SortImportsOptions to sort_imports/options.rs ( #16374 )
...
Pure refactoring.
2025-12-02 07:37:06 +00:00
leaysgur
73748568af
feat(formatter/sort-imports): Support options.internalPattern ( #16372 )
...
Part of #14253
The original implementation accepts a `RegExp` string, but based on the actual usage, it seems that checking as prefix is sufficient for now.
https://github.com/search?q=%22internalPattern%3A+%5B%22&type=code
2025-12-02 07:37:06 +00:00
Boshen
08727586bc
release(crates): oxc v0.100.0 ( #16331 )
...
### 💥 BREAKING CHANGES
- 74cf572 ast: [**BREAKING**] Make `source` field of `TSImportType` a
`StringLiteral` (#16114 ) (copilot-swe-agent)
- 43156ae ast: [**BREAKING**] Rename `TSImportType` `argument` field to
`source` (#16110 ) (overlookmotel)
- 934d873 napi: [**BREAKING**] Drop `armv7-unknown-linux-musleabihf`
support (#16105 ) (Boshen)
### 🚀 Features
- 669afe0 ast: Add `Expression::is_jsx` method (#16154 ) (Dunqing)
- 17a8caa parser: Add diagnostic for JSX identifiers with hyphens
(#16133 ) (camchenry)
- 0549ae5 parser: Add diagnostic for expected ident after optional chain
(#16132 ) (camchenry)
- db839ae parser: Improve diagnostic for unexpected optional
declarations (#16131 ) (camchenry)
- bab4bc8 napi/parser: Add type annotations to parse-raw-worker test
(#15998 ) (camc314)
### 🐛 Bug Fixes
- 35ed36c traverse: Fix panic when truncating non-ASCII variable names
(#16265 ) (peter)
- 9149a26 linter/plugins, napi/parser: Deep freeze visitor keys (#16293 )
(overlookmotel)
- 6b54dab minifier: Incorrect non-null object condition simplification
with `&&` and `||` (#16161 ) (sapphi-red)
- 9cc20a1 minifier: Avoid merging side effectful expressions to next
assignment statement if the side effect may change the left hand side
reference (#16165 ) (sapphi-red)
- 91eb3f2 ast/estree: Convert `TSImportType` `argument` field to
`Literal` (#16109 ) (overlookmotel)
- 1199cee parser: Reject invalid modifiers on parameter properties with
binding patterns (#16083 ) (camc314)
- f376325 traverse: Remove `console.log` from build script (#16049 )
(overlookmotel)
### ⚡ Performance
- 82d784f lexer: Reduce bounds checks in `Lexer::get_string` (#16317 )
(overlookmotel)
- cc2f352 span: Add `#[inline]` to `Atom` methods (#16311 )
(overlookmotel)
- ffca070 span: Add `#[repr(transparent)]` to `Atom` (#16310 )
(overlookmotel)
- 02bdf90 linter/plugins, napi/parser: Reuse arrays in visitor keys
(#16294 ) (overlookmotel)
### 📚 Documentation
- 891e0b4 parser: Add note about falling back to parse TSType in
TSImportType (#16119 ) (camc314)
Co-authored-by: Boshen <1430279+Boshen@users.noreply.github.com >
2025-12-01 15:01:33 +00:00
Arsh
16518066d8
feat(linter/plugins): rule options ( #16215 )
...
- Implements #14825
- Rebased #15822 . Refactored. Pruned the slop. Tests passing.
### Big changes from the original approach
- [x] Options IDs are stored in their own arrays. This was laid out in
#16158 . The original approach was to store `ruleId`-`optionId` pairs as
tuples in an array - several heap allocated objects and excessive
pointer indirection.
- [x] The rust code populates the options by calling a new JS callback
named `setupConfigs()`. I expect we would use this callback for more
plugin related data, including settings which are currently implemented
in a hacky way.
- [ ] Investigate a refactor to avoid requiring a mutable reference to
`ExternalPluginStore` everywhere.
<details>
<summary>
#### Smaller Changes
</summary>
- Removed the extra fixture ("working version"). There were no
meaningful changes compared to the first fixture. Probably slop.
</details>
---------
Co-authored-by: Peter Wagenet <peter@wagenet.us >
Co-authored-by: overlookmotel <theoverlookmotel@gmail.com >
2025-12-01 12:28:40 +00:00
overlookmotel
02bdf906af
perf(linter/plugins, napi/parser): reuse arrays in visitor keys ( #16294 )
...
Many AST nodes have the same set of visitor keys. Re-use arrays for those sharing the same keys. This reduces object creation and `Object.freeze` calls.
2025-11-30 14:04:52 +00:00
overlookmotel
9149a26f4f
fix(linter/plugins, napi/parser): deep freeze visitor keys ( #16293 )
...
Visitor keys object used by `oxlint` and `napi/parser` is frozen, but the individual arrays of keys were not. Deep freeze the whole structure to prevent user modifying it.
2025-11-30 14:04:52 +00:00
overlookmotel
bb6e3574db
refactor(napi/parser): simplify raw_transfer_supported ( #16238 )
...
Pure refactor. Instead of having 2 feature-gated implementations of `raw_transfer_supported`, just have one. This makes it clearer on what platforms raw transfer is supported.
2025-11-28 10:30:08 +00:00
overlookmotel
d4c5337b1a
refactor(napi/parser): move global allocator declaration ( #16237 )
...
Pure refactor. Move `#[global_allocator]` declaration to after imports.
2025-11-28 10:30:08 +00:00
overlookmotel
e3fbf148cc
refactor(napi/parser): move clippy attrs onto NAPI functions ( #16236 )
...
Pure refactor. Remove blanket disable of `clippy::needless_pass_by_value` lint rule, and disable it on individual NAPI functions instead. This reveals one other function which was taking a `String` when it could take a `&str`.
2025-11-28 10:30:08 +00:00
renovate
e44b288902
chore(deps): update dependency oxlint-tsgolint to v0.8.3 ( #16187 )
...
This PR contains the following updates:
| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [oxlint-tsgolint](https://redirect.github.com/oxc-project/tsgolint ) | [`0.8.2` -> `0.8.3`](https://renovatebot.com/diffs/npm/oxlint-tsgolint/0.8.2/0.8.3 ) | [](https://docs.renovatebot.com/merge-confidence/ ) | [](https://docs.renovatebot.com/merge-confidence/ ) | [](https://docs.renovatebot.com/merge-confidence/ ) | [](https://docs.renovatebot.com/merge-confidence/ ) |
---
### Release Notes
<details>
<summary>oxc-project/tsgolint (oxlint-tsgolint)</summary>
### [`v0.8.3`](https://redirect.github.com/oxc-project/tsgolint/releases/tag/v0.8.3 )
[Compare Source](https://redirect.github.com/oxc-project/tsgolint/compare/v0.8.2...v0.8.3 )
##### What's Changed
- chore(deps): update typescript-go digest to [`e34615c`](https://redirect.github.com/oxc-project/tsgolint/commit/e34615c ) by [@​renovate](https://redirect.github.com/renovate )\[bot] in [#​465](https://redirect.github.com/oxc-project/tsgolint/pull/465 )
- chore(deps): update typescript-go digest to [`bd7c18d`](https://redirect.github.com/oxc-project/tsgolint/commit/bd7c18d ) by [@​renovate](https://redirect.github.com/renovate )\[bot] in [#​466](https://redirect.github.com/oxc-project/tsgolint/pull/466 )
- chore(deps): update typescript-go digest to [`417387a`](https://redirect.github.com/oxc-project/tsgolint/commit/417387a ) by [@​renovate](https://redirect.github.com/renovate )\[bot] in [#​467](https://redirect.github.com/oxc-project/tsgolint/pull/467 )
- chore(deps): update dependency vitest>vite to v7.2.8 by [@​renovate](https://redirect.github.com/renovate )\[bot] in [#​469](https://redirect.github.com/oxc-project/tsgolint/pull/469 )
- chore(deps): update typescript-go digest to [`d1be94b`](https://redirect.github.com/oxc-project/tsgolint/commit/d1be94b ) by [@​renovate](https://redirect.github.com/renovate )\[bot] in [#​470](https://redirect.github.com/oxc-project/tsgolint/pull/470 )
- chore(deps): update crate-ci/typos action to v1.40.0 by [@​renovate](https://redirect.github.com/renovate )\[bot] in [#​471](https://redirect.github.com/oxc-project/tsgolint/pull/471 )
**Full Changelog**: <https://github.com/oxc-project/tsgolint/compare/v0.8.2...v0.8.3 >
</details>
---
### Configuration
📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 **Automerge**: Enabled.
♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 **Ignore**: Close this PR and you won't be reminded about this update again.
---
- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box
---
This PR was generated by [Mend Renovate](https://mend.io/renovate/ ). View the [repository job log](https://developer.mend.io/github/oxc-project/oxc ).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0Mi4xOS45IiwidXBkYXRlZEluVmVyIjoiNDIuMTkuOSIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->
2025-11-27 08:31:05 +00:00
sapphi-red
9cc20a1de7
fix(minifier): avoid merging side effectful expressions to next assignment statement if the side effect may change the left hand side reference ( #16165 )
...
fixes https://github.com/rolldown/rolldown/issues/7093
```js
function wrapper() { let foo; const bar = (() => { foo = {} })(); foo.bar = bar; return foo }
```
cannot be compressed to
```js
function wrapper() { let foo; return foo.bar = (() => { foo = {} })(), foo }
```
because `foo` is read on left hand side.
2025-11-27 07:35:43 +00:00
copilot-swe-agent
74cf5720bc
feat(ast)!: Make source field of TSImportType a StringLiteral ( #16114 )
...
- [x] Change `source` field type in `TSImportType` from `TSType<'a>` to `StringLiteral<'a>` in `crates/oxc_ast/src/ast/ts.rs`
- [x] Remove `#[estree(via = TSImportTypeSource)]` attribute from the field
- [x] Run `just ast` to regenerate all derived code
- [x] Update the parser in `crates/oxc_parser/src/ts/types.rs` to parse a `StringLiteral` directly and emit errors for non-string literals
- [x] Delete the dead code `TSImportTypeSource` serializer from `crates/oxc_ast/src/serialize/ts.rs`
- [x] Add `ts_string_literal_expected` diagnostic (TS1141)
- [x] Update semantic snapshot for `import-type-with-type-params.snap`
- [x] Add test case for invalid import type source
- [x] Verify all tests pass
- [x] Simplify error recovery - just report error and create dummy string literal (per review feedback)
- [x] Fix spurious "Expected ')'" error by skipping invalid tokens in error recovery
<!-- START COPILOT CODING AGENT SUFFIX -->
<details>
<summary>Original prompt</summary>
>
> ----
>
> *This section details on the original issue you should resolve*
>
> <issue_title>AST: Make `source` field of `TSImportType` a `StringLiteral`</issue_title>
> <issue_description>Continuation of oxc-project/oxc#16074 .
>
> The expression inside `import(...)` in TS context (`TSImportType`) cannot legally be anything other than a string literal.
>
> Our parser is too liberal. We currently accept all kind of crazy stuff like:
>
> ```ts
> type A = typeof import(`react`);
> type B = typeof import(A);
> type C = typeof import(`${A} ${B}`);
> type D = typeof import(typeof import('react'));
> ```
>
> [Playground](https://playground.oxc.rs/#eNptU9tOGzEQ/ZXIQqJIqUSRKqFUfQjQSJVooaUqL31g1jsbDF7bHc/molX+nfEmdkDhyfaZ+5njXmk1UbwOOJqOvo7SxTcj0wZP/OGBEDQ/nHz55waPiwOPabFdHkYf9dPN6Ki/2OwzXB14vX0dDxWPT1KAGiuvJr2izqXDGsdq0oCNOFaNpxaYkQrCBC4muCAmeguM9RVqCwRsvIvFuHw0jDGAxgK14OZ2/9S+DYRxHxK1D2Jm6tJj3Vbe5pdu5ju3zVgFoJga6xWuGF2UuoniKPOAtX75G7kjd9NxNDXOOqdTZzlTKom0wFsgCc3oEPf3/LtjMpJQF0NE6ZqN/kbkaYdKC4mroQW5v6KqV13EP1DtZ2Ko7k3Nj2pyNlbo6pvm2jgZUtlG2g1SjXf281OpZhJDvzrPe5qe4uruHfh/et2SD1JLQfzoEGusJafsyUh780vftpBs1goqc5gyrMyyzPOLfQnrxF1FoJ+R72RnEp6dMwotbjvf1ffVE2q+JwiSI5OaCg29TlmIrDrpEOlNGK4CkmnRMdgbuQJ7uvXRbFeUGFJCadHallQGmqNoU2E8O/30WaoIzVfYSOKZp0sLMc4M2rps7XUVUacfyuytreGC/kCGGliY2q32fVX3KspEQQSC5EB0mcWofY1zHD6QS0Iokn2KtZevv6PcOc9DroxYnGffIUv+C0lR+aPI5D5c4wJL0mfE8FNWkQU2hIpovZ2JgFPEAqnyMROe5nFpUclUbhuB64G+BJfbJuGJZoisNi/WFa5W )
>
> TypeScript says these are all errors: [TS Playground](https://www.typescriptlang.org/play/?#code/C4TwDgpgBAglC8VSQPYDMoEsC2YUCdgAKAA3wgEMBjYEgSgG4AoZaAIQSXAnS1wOIxGLblADCnVrxx5CpACQBvGAF8oStivrNWUACKTu0-nKkYZAogHJy1YFbrCgA )
>
> ### AST change
>
> We should alter the type of the `source` field from `TSType<'a>` to `StringLiteral<'a>`:
>
> https://github.com/oxc-project/oxc/blob/35d0ee491cbcd271ebceaac7e25cff0490ded5c4/crates/oxc_ast/src/ast/ts.rs#L1382-L1389
>
> ```diff
> pub struct TSImportType<'a> {
> pub span: Span,
> - #[estree(via = TSImportTypeSource)]
> - pub source: TSType<'a>,
> + pub source: StringLiteral<'a>,
> pub options: Option<Box<'a, ObjectExpression<'a>>>,
> pub qualifier: Option<TSImportTypeQualifier<'a>>,
> pub type_arguments: Option<Box<'a, TSTypeParameterInstantiation<'a>>>,
> }
> ```
>
> ### Parser changes
>
> If we change the AST first and run `just ast` to regenerate traits code, then all the places which rely on the type of `source` field will become apparent. We'll then need to alter the parser to throw an error if it encounters something that isn't a string literal.
>
> ### `ESTree` serialization
>
> Currently there's a custom deserializer to alter the AST on JS side from `TSType` to `StringLiteral`:
>
> https://github.com/oxc-project/oxc/blob/91eb3f2be509cef11cffeff51fac61a3a4fbd12c/crates/oxc_ast/src/serialize/ts.rs#L506-L538
>
> Once we've changed the field type in AST, this code can be deleted - it's dead code once `#[estree(via = TSImportTypeSource)]` attribute is removed from the `source` field in AST struct.</issue_description>
>
> ## Comments on the Issue (you are @copilot in this section)
>
> <comments>
> </comments>
>
</details>
- Fixes oxc-project/oxc#16111
<!-- START COPILOT CODING AGENT TIPS -->
---
💬 We'd love your input! Share your thoughts on Copilot coding agent in our [2 minute survey](https://gh.io/copilot-coding-agent-survey ).
2025-11-25 18:51:16 +00:00
overlookmotel
91eb3f2be5
fix(ast/estree): convert TSImportType argument field to Literal ( #16109 )
...
Fixes #16074 .
Convert `argument` field of `TSImportType` to `Literal` in TS-ESTree AST, and rename it to `source`. This follows the change made recently in TS-ESLint (https://github.com/typescript-eslint/typescript-eslint/pull/11591 ).
2025-11-25 14:11:12 +00:00
Boshen
934d873eb0
feat(napi)!: drop armv7-unknown-linux-musleabihf support ( #16105 )
...
Also add `aarch64-unknown-linux-ohos` support.
`armv7-unknown-linux-musleabihf` target is broken for a while (https://github.com/nodejs/node/issues/53489 ) and is a legacy target.
part of #16094
2025-11-25 13:03:14 +00:00
camc314
a18c065f21
chore(ast): run just ast to re-format code ( #16096 )
2025-11-25 09:31:11 +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
leaysgur
a446e2c05a
fix(playground): Remove unsupported experimental options ( #16090 )
...
Also removed from playground.
2025-11-25 05:33:44 +00: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
d2c97404c1
refactor(napi): prefer oxlint-disable over eslint-disable ( #16054 )
...
Nit. Use `// oxlint-disable` comments in our own code, instead of `// eslint-disable`.
2025-11-24 12:12:12 +00:00
overlookmotel
5877752586
ci(lint): enable no-console rule ( #16053 )
...
Enable `no-console` rule in our linting setup. Add `oxlint-disable` comments where we do want to log (in scripts).
2025-11-24 12:06:00 +00:00
Boshen
7252123e5e
release(crates): oxc v0.99.0 ( #16037 )
...
### 💥 BREAKING CHANGES
- cbb27fd ast: [**BREAKING**] Add `TSGlobalDeclaration` type (#15712 )
(overlookmotel)
### 🚀 Features
- 0c1f82b linter/plugins: Add `tokens` property to `Program` (#16020 )
(overlookmotel)
- 6cff132 span: Add `Span::merge_within` method (#15869 ) (sapphi-red)
- 102365d allocator/vec: Add `Vec::into_bump_slice` method (#15770 )
(Dunqing)
### 🐛 Bug Fixes
- e2ca770 codegen: Add support for printing type arguments in new
expressions (#15963 ) (Ives van Hoorne)
- 2bd3cb6 apps, editors, napi: Fix `oxlint-disable` comments (#16014 )
(overlookmotel)
- 622cb5e parser: Preserve legal comments with @preserve/@license when
preceded by other annotations (#15929 ) (copilot-swe-agent)
- 7c46a9e transformer/tagged-template-transform: Handle `\n` escape
sequences (#15830 ) (Dunqing)
- f386efc minifier: Avoid generating invalid spans (#15778 ) (sapphi-red)
- d4ff004 parser: Forbid invalid modifiers on `module` and `global`
(#15723 ) (overlookmotel)
- 2191ae9 semantic: Allow reserved keywords in typescript ambient
contexts (#15495 ) (sapphi-red)
- 7d1ebad isolated-declarations: Incorrect nested namespace output in
isolated declarations (#15800 ) (copilot-swe-agent)
### ⚡ Performance
- b4b0ed8 transformer/typescript: Reverse order of checks (#15722 )
(overlookmotel)
### 📚 Documentation
- c81a331 data_structures: Doc comments on fields of `Stack` (#15793 )
(overlookmotel)
- cfae31d allocator: Use `allocator` as var name in examples (#15781 )
(overlookmotel)
Co-authored-by: Boshen <1430279+Boshen@users.noreply.github.com >
2025-11-24 10:06:24 +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
Boshen
4f8c414a71
ci(rust): fix cargo shear warnings ( #15960 )
2025-11-22 08:32:33 +00:00
leaysgur
7818e22367
feat(formatter/sort-imports): Support options.groups ( #15831 )
...
Part of #14253
Now user can specify own `groups` like:
```js
groups: [
"type",
["external", "builtin"]
]
```
- [x] Parse config
- [x] Implementation
- [x] Test
- [x] Refactor for readability
- [x] Refactor for performance
- [x] ~~Report non-defaults?~~
Sorry for the large diffs. Yes, it's incredibly complicated. 😓
2025-11-20 09:09:00 +00:00
Boshen
ab004627f4
chore(ci): check playground in wasi test ( #15824 )
2025-11-19 05:55:38 +00:00
overlookmotel
cbb27fd51b
fix(ast)!: add TSGlobalDeclaration type ( #15712 )
...
Fix #14860 .
### The problem
`TSModuleDeclaration` type was used to represent 4 different syntaxes:
* `namespace X {}`
* `module X {}`
* `module "x" {}`
* `global {}`
(and all the above prefixed with `declare`)
`global {}` is quite different from the others in a few ways:
* It has no identifier (`global` is a keyword, not an identifier).
* It has no symbol.
* The `body` block is not optional.
* Directives are not allowed in the `body` block.
* It is always ambient context (regardless of whether it has `declare` modifier).
In particular, it was causing panics because `symbol_id` field for `TSModuleDeclaration`s representing `global {}` was `None`.
### Solution
Rather than trying to make `TSModuleDeclaration` type encode all these differences, and make Oxc's code reason about them, split `global {}` into a new type `TSGlobalDeclaration`.
The rest of the diff is just adjusting code to also handle `TSGlobalDeclaration` where it was dealing with `TSModuleDeclaration`s.
This change simplifies the parser quite a bit.
`oxc_semantic`'s `SymbolDeclarationTest` tester now tests that all `TSModuleDeclaration`s with `id: BindingIdentifier` do have a symbol:
https://github.com/oxc-project/oxc/pull/15712/files#diff-ce544d71b839faa898887ac920237e563e59a708e7fca86b53023498ab67a611L101-R110
### Formatter bug
There is one regression in the formatter for `typescript/module/global.ts` case.
https://github.com/oxc-project/oxc/pull/15712/files#diff-f248b1d49b8c482864810055632d7322cdebc895dd4dfe05fbefcf5e23ba12c9R51
Input:
```ts
declare /* module */ global {}
declare /* namespace */ global {}
```
Output:
```diff
- declare /* module */ global {}
- declare /* namespace */ global {}
+ declare global /* module */ {}
+ declare global /* namespace */ {}
```
I assume this is happening because there's no longer a `BindingIdentifier` for the `global` keyword for the comment to get attached to.
I am not sure how to fix this. Maybe the `global_span` field can help?
@Dunqing This PR touches a *lot* of files. Can I propose that we merge it before it gets conflicts, and if you can give me some guidance, I'll do a follow-up PR to fix it?
2025-11-17 19:25:24 +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 ) | [](https://docs.renovatebot.com/merge-confidence/ ) | [](https://docs.renovatebot.com/merge-confidence/ ) | [](https://docs.renovatebot.com/merge-confidence/ ) | [](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 ([#​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
Boshen
c588bc59ac
release(crates): oxc v0.98.0 ( #15771 )
...
### 💥 BREAKING CHANGES
- ea51b0b napi: [**BREAKING**] Standardize function naming with sync
suffixes (#15661 ) (Boshen)
### 🚀 Features
- 77efb76 parser: Improve error message for invalid switch clauses
(#15728 ) (sapphi-red)
- 5691727 parser: Improve `import source` `from` error message (#15727 )
(sapphi-red)
- b7404bc parser: Improve error message for missing function body
(#15726 ) (sapphi-red)
- 71c2fb0 parser: Improve error message when JSX is found while not
enabled (#15725 ) (sapphi-red)
- 56e7e44 minifier: Disable removal of unnecessary `use strict`
directives for DCE (#15691 ) (sapphi-red)
- 8a61cfd allocator, ast: Introduce `UnstableAddress` trait (#15700 )
(overlookmotel)
- f5ce55a napi: Export all options using wildcard exports (Boshen)
- 68703b9 minifier: Rotate binary expressions to remove parentheses
(#15473 ) (sapphi-red)
### 🐛 Bug Fixes
- c023ba6 semantic: Do not duplicate statements in temp `Vec` when
binding `TSModuleDeclaration`s (#15724 ) (overlookmotel)
- d60ca81 parser: Reject `import something 'source'` (#15746 )
(sapphi-red)
- e0728fa ast: Exclude comment end position from `is_inside_comment`
check (#15753 ) (camc314)
- 9f54a36 semantic: Error on `\00` in strict mode (#15743 ) (sapphi-red)
- 440a977 ast: Include rest properties when using
`get_binding_identifiers` (#15710 ) (camc314)
### ⚡ Performance
- 1f09d3c parser: Faster checking for invalid modifiers (#15717 )
(overlookmotel)
- d8d4e31 ast: Use loop instead of recursion in
`TSModuleDeclarationBody::as_module_block_mut` (#15713 ) (overlookmotel)
### 📚 Documentation
- e033d50 ast: Clarify behavior of
`TSModuleDeclaration::has_use_strict_directive` (#15730 ) (overlookmotel)
- 9eda70f allocator: Improve docs for `Address` methods (#15697 )
(overlookmotel)
2025-11-17 12:38:34 +00:00
Dunqing
1b18457e05
feat(transformer): support tagged template expression with </script transformation ( #15664 )
...
Implement a transformation plugin for tagged template expressions containing </script> tags to prevent script tag issues in browser environments.
This plugin transforms tagged template literals containing `</script` (case-insensitive) to use a helper function call with template caching, matching esbuild's behavior.
### Example
Transforms tagged templates to use cached template objects with a helper function:
Input:
```js
foo`</script>`
bar`<script>${content}</script>`
```
Output:
```js
var _templateObject, _templateObject2;
foo(_templateObject || (_templateObject = babelHelpers.taggedTemplateLiteral(["<\/script>"])));
bar(_templateObject2 || (_templateObject2 = babelHelpers.taggedTemplateLiteral(["<script>", "<\/script>"])), content);
```
Closes #15306
2025-11-17 11:55:13 +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
Boshen
f5ce55a40a
feat(napi): export all options using wildcard exports
...
Closes #15618
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com >
2025-11-13 15:38:52 +08:00
Boshen
98585f01a1
release(crates): oxc v0.97.0 ( #15582 )
2025-11-11 17:18:13 +08:00
leaysgur
25a01638d5
feat(formatter/sort_imports): Sort imports by Array<Array<string>> groups ( #15578 )
...
Current implementation was performimg sort based on hard-coded `enum`.
This PR changed it to use group definitions like this.
```js
[
'type-import',
['value-builtin', 'value-external'],
'type-internal',
'value-internal',
['type-parent', 'type-sibling', 'type-index'],
['value-parent', 'value-sibling', 'value-index'],
'ts-equals-import',
'unknown',
]
```
> https://perfectionist.dev/rules/sort-imports#groups
And this will be refactored in the subsequent 2 PRs.
2025-11-11 05:53:54 +00:00
sapphi-red
3dc24b5cf5
docs(linter,minifier): always refer as "ES Modules" instead of "ES6 Modules" ( #15409 )
...
Nowadays, we normally call them "ES Modules" instead of "ES6 Modules". I made that consistent through the docs.
2025-11-07 10:13:26 +00:00
leaysgur
5708126aa8
feat(formatter/sort_imports): Add options.newlinesBetween ( #15369 )
...
Part of #14253
Implement `options.newlinseBetween`.
> https://perfectionist.dev/rules/sort-imports#newlinesbetween
Original implementation for this is `type: number | 'ignore'default: 1`.
However, our printer does not allow to insert multiple empty lines.
https://github.com/oxc-project/oxc/blob/e061ae3883dab0864bbe3803fa3d76248a7c2e43/crates/oxc_formatter/src/formatter/printer/mod.rs#L129
So, we only support as `bool` for now.
2025-11-07 02:46:25 +00:00
sapphi-red
4b904b1584
docs(transformer): clarify jsx.pure option would affect JSX elements ( #15376 )
...
Update the doc comment as `jsx.pure` option also affects JSX elements.
https://github.com/oxc-project/oxc/blob/b1d3e005def3fe1899e77d2ace0c0584c9b22f80/crates/oxc_transformer/src/jsx/jsx_impl.rs#L779
I'll update the docs after this PR is merged.
2025-11-07 02:33:23 +00:00
renovate[bot]
1395c67b05
chore(deps): lock file maintenance npm packages ( #15232 )
2025-11-05 20:49:00 +08:00
overlookmotel
c82fab0787
perf(ast/estree): remove pointless assignments from raw transfer deserializers ( #15305 )
...
Small perf optimization to raw transfer. Shorten deserializers by not assigning `null` to fields which were already initialized as `null`.
2025-11-05 11:22:52 +00:00
overlookmotel
7f079abf9d
fix(ast/estree): fix raw transfer deserializer for AssignmentTargetPropertyIdentifier ( #15304 )
...
1. Tiny bug fix - make sure `range` arrays for `key` and `value` are independent objects, so mutating one doesn't mutate the other.
2. Perf optimization - remove usage of `...` spread, which is expensive.
2025-11-05 11:22:52 +00:00
overlookmotel
a7cf8560ec
refactor(ast/estree): shorten raw transfer deserializer for AssignmentTargetPropertyIdentifier ( #15303 )
...
There are no `deserialize` calls while constructing `value` here, so it's pointless to assign to `parent` and then set it back again. Remove this pointless code, and shorten the deserializer a little.
2025-11-05 11:22:51 +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
renovate
c417564c4b
chore(deps): update dependency rust to v1.91.0 ( #15163 )
...
This PR contains the following updates:
| Package | Update | Change |
|---|---|---|
| [rust](https://redirect.github.com/rust-lang/rust ) | minor | `1.90.0` -> `1.91.0` |
---
### Release Notes
<details>
<summary>rust-lang/rust (rust)</summary>
### [`v1.91.0`](https://redirect.github.com/rust-lang/rust/blob/HEAD/RELEASES.md#Version-1910-2025-10-30 )
[Compare Source](https://redirect.github.com/rust-lang/rust/compare/1.90.0...1.91.0 )
\==========================
<a id="1.91.0-Language"></a>
## Language
- [Lower pattern bindings in the order they're written and base drop order on primary bindings' order](https://redirect.github.com/rust-lang/rust/pull/143764 )
- [Stabilize declaration of C-style variadic functions for `sysv64`, `win64`, `efiapi`, and `aapcs` ABIs](https://redirect.github.com/rust-lang/rust/pull/144066 ).
This brings these ABIs in line with the C ABI: variadic functions can be declared in extern blocks but not defined.
- [Add `dangling_pointers_from_locals` lint to warn against dangling pointers from local variables](https://redirect.github.com/rust-lang/rust/pull/144322 )
- [Upgrade `semicolon_in_expressions_from_macros` from warn to deny](https://redirect.github.com/rust-lang/rust/pull/144369 )
- [Stabilize LoongArch32 inline assembly](https://redirect.github.com/rust-lang/rust/pull/144402 )
- [Add warn-by-default `integer_to_ptr_transmutes` lint against integer-to-pointer transmutes](https://redirect.github.com/rust-lang/rust/pull/144531 )
- [Stabilize `sse4a` and `tbm` target features](https://redirect.github.com/rust-lang/rust/pull/144542 )
- [Add `target_env = "macabi"` and `target_env = "sim"` cfgs](https://redirect.github.com/rust-lang/rust/pull/139451 ) as replacements for the `target_abi` cfgs with the same values.
<a id="1.91.0-Compiler"></a>
## Compiler
- [Don't warn on never-to-any `as` casts as unreachable](https://redirect.github.com/rust-lang/rust/pull/144804 )
<a id="1.91.0-Platform-Support"></a>
## Platform Support
- [Promote `aarch64-pc-windows-gnullvm` and `x86_64-pc-windows-gnullvm` to Tier 2 with host tools.](https://redirect.github.com/rust-lang/rust/pull/143031 )
Note: llvm-tools and MSI installers are missing but will be added in future releases.
- [Promote `aarch64-pc-windows-msvc` to Tier 1](https://redirect.github.com/rust-lang/rust/pull/145682 )
Refer to Rust's [platform support page][platform-support-doc]
for more information on Rust's tiered platform support.
[platform-support-doc]: https://doc.rust-lang.org/rustc/platform-support.html
<a id="1.91.0-Libraries"></a>
## Libraries
- [Print thread ID in panic message](https://redirect.github.com/rust-lang/rust/pull/115746 )
- [Fix overly restrictive lifetime in `core::panic::Location::file` return type](https://redirect.github.com/rust-lang/rust/pull/132087 )
- [Guarantee parameter order for `_by()` variants of `min` / `max`/ `minmax` in `std::cmp`](https://redirect.github.com/rust-lang/rust/pull/139357 )
- [Document assumptions about `Clone` and `Eq` traits](https://redirect.github.com/rust-lang/rust/pull/144330/ )
- [`std::thread`: Return error if setting thread stack size fails](https://redirect.github.com/rust-lang/rust/pull/144210 )
This used to panic within the standard library.
<a id="1.91.0-Stabilized-APIs"></a>
## Stabilized APIs
- [`Path::file_prefix`](https://doc.rust-lang.org/stable/std/path/struct.Path.html#method.file_prefix )
- [`AtomicPtr::fetch_ptr_add`](https://doc.rust-lang.org/stable/std/sync/atomic/struct.AtomicPtr.html#method.fetch_ptr_add )
- [`AtomicPtr::fetch_ptr_sub`](https://doc.rust-lang.org/stable/std/sync/atomic/struct.AtomicPtr.html#method.fetch_ptr_sub )
- [`AtomicPtr::fetch_byte_add`](https://doc.rust-lang.org/stable/std/sync/atomic/struct.AtomicPtr.html#method.fetch_byte_add )
- [`AtomicPtr::fetch_byte_sub`](https://doc.rust-lang.org/stable/std/sync/atomic/struct.AtomicPtr.html#method.fetch_byte_sub )
- [`AtomicPtr::fetch_or`](https://doc.rust-lang.org/stable/std/sync/atomic/struct.AtomicPtr.html#method.fetch_or )
- [`AtomicPtr::fetch_and`](https://doc.rust-lang.org/stable/std/sync/atomic/struct.AtomicPtr.html#method.fetch_and )
- [`AtomicPtr::fetch_xor`](https://doc.rust-lang.org/stable/std/sync/atomic/struct.AtomicPtr.html#method.fetch_xor )
- [`{integer}::strict_add`](https://doc.rust-lang.org/stable/std/primitive.u32.html#method.strict_add )
- [`{integer}::strict_sub`](https://doc.rust-lang.org/stable/std/primitive.u32.html#method.strict_sub )
- [`{integer}::strict_mul`](https://doc.rust-lang.org/stable/std/primitive.u32.html#method.strict_mul )
- [`{integer}::strict_div`](https://doc.rust-lang.org/stable/std/primitive.i32.html#method.strict_div )
- [`{integer}::strict_div_euclid`](https://doc.rust-lang.org/stable/std/primitive.i32.html#method.strict_div_euclid )
- [`{integer}::strict_rem`](https://doc.rust-lang.org/stable/std/primitive.i32.html#method.strict_rem )
- [`{integer}::strict_rem_euclid`](https://doc.rust-lang.org/stable/std/primitive.i32.html#method.strict_rem_euclid )
- [`{integer}::strict_neg`](https://doc.rust-lang.org/stable/std/primitive.u32.html#method.strict_neg )
- [`{integer}::strict_shl`](https://doc.rust-lang.org/stable/std/primitive.u32.html#method.strict_shl )
- [`{integer}::strict_shr`](https://doc.rust-lang.org/stable/std/primitive.u32.html#method.strict_shr )
- [`{integer}::strict_pow`](https://doc.rust-lang.org/stable/std/primitive.u32.html#method.strict_pow )
- [`i{N}::strict_add_unsigned`](https://doc.rust-lang.org/stable/std/primitive.i32.html#method.strict_add_unsigned )
- [`i{N}::strict_sub_unsigned`](https://doc.rust-lang.org/stable/std/primitive.i32.html#method.strict_sub_unsigned )
- [`i{N}::strict_abs`](https://doc.rust-lang.org/stable/std/primitive.i32.html#method.strict_abs )
- [`u{N}::strict_add_signed`](https://doc.rust-lang.org/stable/std/primitive.u32.html#method.strict_add_signed )
- [`u{N}::strict_sub_signed`](https://doc.rust-lang.org/stable/std/primitive.u32.html#method.strict_sub_signed )
- [`PanicHookInfo::payload_as_str`](https://doc.rust-lang.org/stable/std/panic/struct.PanicHookInfo.html#method.payload_as_str )
- [`core::iter::chain`](https://doc.rust-lang.org/stable/core/iter/fn.chain.html )
- [`u{N}::checked_signed_diff`](https://doc.rust-lang.org/stable/std/primitive.u16.html#method.checked_signed_diff )
- [`core::array::repeat`](https://doc.rust-lang.org/stable/core/array/fn.repeat.html )
- [`PathBuf::add_extension`](https://doc.rust-lang.org/stable/std/path/struct.PathBuf.html#method.add_extension )
- [`PathBuf::with_added_extension`](https://doc.rust-lang.org/stable/std/path/struct.PathBuf.html#method.with_added_extension )
- [`Duration::from_mins`](https://doc.rust-lang.org/stable/std/time/struct.Duration.html#method.from_mins )
- [`Duration::from_hours`](https://doc.rust-lang.org/stable/std/time/struct.Duration.html#method.from_hours )
- [`impl PartialEq<str> for PathBuf`](https://doc.rust-lang.org/stable/std/path/struct.PathBuf.html#impl-PartialEq%3Cstr%3E-for-PathBuf )
- [`impl PartialEq<String> for PathBuf`](https://doc.rust-lang.org/stable/std/path/struct.PathBuf.html#impl-PartialEq%3CString%3E-for-PathBuf )
- [`impl PartialEq<str> for Path`](https://doc.rust-lang.org/stable/std/path/struct.Path.html#impl-PartialEq%3Cstr%3E-for-Path )
- [`impl PartialEq<String> for Path`](https://doc.rust-lang.org/stable/std/path/struct.Path.html#impl-PartialEq%3CString%3E-for-Path )
- [`impl PartialEq<PathBuf> for String`](https://doc.rust-lang.org/stable/std/string/struct.String.html#impl-PartialEq%3CPathBuf%3E-for-String )
- [`impl PartialEq<Path> for String`](https://doc.rust-lang.org/stable/std/string/struct.String.html#impl-PartialEq%3CPath%3E-for-String )
- [`impl PartialEq<PathBuf> for str`](https://doc.rust-lang.org/stable/std/primitive.str.html#impl-PartialEq%3CPathBuf%3E-for-str )
- [`impl PartialEq<Path> for str`](https://doc.rust-lang.org/stable/std/primitive.str.html#impl-PartialEq%3CPath%3E-for-str )
- [`Ipv4Addr::from_octets`](https://doc.rust-lang.org/stable/std/net/struct.Ipv4Addr.html#method.from_octets )
- [`Ipv6Addr::from_octets`](https://doc.rust-lang.org/stable/std/net/struct.Ipv6Addr.html#method.from_octets )
- [`Ipv6Addr::from_segments`](https://doc.rust-lang.org/stable/std/net/struct.Ipv6Addr.html#method.from_segments )
- [`impl<T> Default for Pin<Box<T>> where Box<T>: Default, T: ?Sized`](https://doc.rust-lang.org/stable/std/default/trait.Default.html#impl-Default-for-Pin%3CBox%3CT%3E%3E )
- [`impl<T> Default for Pin<Rc<T>> where Rc<T>: Default, T: ?Sized`](https://doc.rust-lang.org/stable/std/default/trait.Default.html#impl-Default-for-Pin%3CRc%3CT%3E%3E )
- [`impl<T> Default for Pin<Arc<T>> where Arc<T>: Default, T: ?Sized`](https://doc.rust-lang.org/stable/std/default/trait.Default.html#impl-Default-for-Pin%3CArc%3CT%3E%3E )
- [`Cell::as_array_of_cells`](https://doc.rust-lang.org/stable/std/cell/struct.Cell.html#method.as_array_of_cells )
- [`u{N}::carrying_add`](https://doc.rust-lang.org/stable/std/primitive.u64.html#method.carrying_add )
- [`u{N}::borrowing_sub`](https://doc.rust-lang.org/stable/std/primitive.u64.html#method.borrowing_sub )
- [`u{N}::carrying_mul`](https://doc.rust-lang.org/stable/std/primitive.u64.html#method.carrying_mul )
- [`u{N}::carrying_mul_add`](https://doc.rust-lang.org/stable/std/primitive.u64.html#method.carrying_mul_add )
- [`BTreeMap::extract_if`](https://doc.rust-lang.org/stable/std/collections/struct.BTreeMap.html#method.extract_if )
- [`BTreeSet::extract_if`](https://doc.rust-lang.org/stable/std/collections/struct.BTreeSet.html#method.extract_if )
- [`impl Debug for windows::ffi::EncodeWide<'_>`](https://doc.rust-lang.org/stable/std/os/windows/ffi/struct.EncodeWide.html#impl-Debug-for-EncodeWide%3C'_%3E )
- [`str::ceil_char_boundary`](https://doc.rust-lang.org/stable/std/primitive.str.html#method.ceil_char_boundary )
- [`str::floor_char_boundary`](https://doc.rust-lang.org/stable/std/primitive.str.html#method.floor_char_boundary )
- [`impl Sum for Saturating<u{N}>`](https://doc.rust-lang.org/stable/std/num/struct.Saturating.html#impl-Sum-for-Saturating%3Cu32%3E )
- [`impl Sum<&Self> for Saturating<u{N}>`](https://doc.rust-lang.org/stable/std/num/struct.Saturating.html#impl-Sum%3C%26Saturating%3Cu32%3E%3E-for-Saturating%3Cu32%3E )
- [`impl Product for Saturating<u{N}>`](https://doc.rust-lang.org/stable/std/num/struct.Saturating.html#impl-Product-for-Saturating%3Cu32%3E )
- [`impl Product<&Self> for Saturating<u{N}>`](https://doc.rust-lang.org/stable/std/num/struct.Saturating.html#impl-Product%3C%26Saturating%3Cu32%3E%3E-for-Saturating%3Cu32%3E )
These previously stable APIs are now stable in const contexts:
- [`<[T; N]>::each_ref`](https://doc.rust-lang.org/stable/std/primitive.array.html#method.each_ref )
- [`<[T; N]>::each_mut`](https://doc.rust-lang.org/stable/std/primitive.array.html#method.each_mut )
- [`OsString::new`](https://doc.rust-lang.org/stable/std/ffi/struct.OsString.html#method.new )
- [`PathBuf::new`](https://doc.rust-lang.org/stable/std/path/struct.PathBuf.html#method.new )
- [`TypeId::of`](https://doc.rust-lang.org/stable/std/any/struct.TypeId.html#method.of )
- [`ptr::with_exposed_provenance`](https://doc.rust-lang.org/stable/std/ptr/fn.with_exposed_provenance.html )
- [`ptr::with_exposed_provenance_mut`](https://doc.rust-lang.org/stable/std/ptr/fn.with_exposed_provenance_mut.html )
<a id="1.91.0-Cargo"></a>
## Cargo
- 🎉 Stabilize `build.build-dir`.
This config sets the directory where intermediate build artifacts are stored.
These artifacts are produced by Cargo and rustc during the build process.
End users usually won't need to interact with them, and the layout inside
`build-dir` is an implementation detail that may change without notice.
([config doc](https://doc.rust-lang.org/stable/cargo/reference/config.html#buildbuild-dir ))
([build cache doc](https://doc.rust-lang.org/stable/cargo/reference/build-cache.html ))
[#​15833](https://redirect.github.com/rust-lang/cargo/pull/15833 )
[#​15840](https://redirect.github.com/rust-lang/cargo/pull/15840 )
- The `--target` flag and the `build.target` configuration can now take literal
`"host-tuple"` string, which will internally be substituted by the host
machine's target triple.
[#​15838](https://redirect.github.com/rust-lang/cargo/pull/15838 )
[#​16003](https://redirect.github.com/rust-lang/cargo/pull/16003 )
[#​16032](https://redirect.github.com/rust-lang/cargo/pull/16032 )
<a id="1.91.0-Rustdoc"></a>
## Rustdoc
- [In search results, rank doc aliases lower than non-alias items with the same name](https://redirect.github.com/rust-lang/rust/pull/145100 )
- [Raw pointers now work in type-based search like references](https://redirect.github.com/rust-lang/rust/pull/145731 ). This means you can now search for things like `*const u8 ->`, and additionally functions that take or return raw pointers will now display their signature properly in search results.
<a id="1.91.0-Compatibility-Notes"></a>
## Compatibility Notes
- [Always require coroutine captures to be drop-live](https://redirect.github.com/rust-lang/rust/pull/144156 )
- [Apple: Always pass SDK root when linking with `cc`, and pass it via `SDKROOT` env var](https://redirect.github.com/rust-lang/rust/pull/131477 ). This should fix linking issues with `rustc` running inside Xcode. Libraries in `/usr/local/lib` may no longer be linked automatically, if you develop or use a crate that relies on this, you should explicitly set `cargo::rustc-link-search=/usr/local/lib` in a `build.rs` script.
- [Relaxed bounds in associated type bound position like in `TraitRef<AssocTy: ?Sized>` are now correctly forbidden](https://redirect.github.com/rust-lang/rust/pull/135331 )
- [Add unstable `#[sanitize(xyz = "on|off")]` built-in attribute that shadows procedural macros with the same name](https://redirect.github.com/rust-lang/rust/pull/142681 )
- [Fix the drop checker being more permissive for bindings declared with let-else](https://redirect.github.com/rust-lang/rust/pull/143028 )
- [Be more strict when parsing attributes, erroring on many invalid attributes](https://redirect.github.com/rust-lang/rust/pull/144689 )
- [Error on invalid `#[should_panic]` attributes](https://redirect.github.com/rust-lang/rust/pull/143808 )
- [Error on invalid `#[link]` attributes](https://redirect.github.com/rust-lang/rust/pull/143193 )
- [Mark all deprecation lints in name resolution as deny-by-default and also report in dependencies](https://redirect.github.com/rust-lang/rust/pull/143929 )
- The lint `semicolon_in_expressions_from_macros`, for `macro_rules!` macros in expression position that expand to end in a semicolon (`;`), is now deny-by-default. It was already warn-by-default, and a future compatibility warning (FCW) that warned even in dependencies. This lint will become a hard error in the future.
- [Trait impl modifiers (e.g., `unsafe`, `!`, `default`) in inherent impls are no longer syntactically valid](https://redirect.github.com/rust-lang/rust/pull/144386 )
- [Start reporting future breakage for `ill_formed_attribute_input` in dependencies](https://redirect.github.com/rust-lang/rust/pull/144544 )
- [Restrict the scope of temporaries created by the macros `pin!`, `format_args!`, `write!`, and `writeln!` in `if let` scrutinees in Rust Edition 2024.](https://redirect.github.com/rust-lang/rust/pull/145342 ) This applies [Rust Edition 2024's `if let` temporary scope rules](https://doc.rust-lang.org/edition-guide/rust-2024/temporary-if-let-scope.html ) to these temporaries, which previously could live past the `if` expression regardless of Edition.
- [Invalid numeric literal suffixes in tuple indexing, tuple struct indexing, and struct field name positions are now correctly rejected](https://redirect.github.com/rust-lang/rust/pull/145463 )
- [Closures marked with the keyword `static` are now syntactically invalid](https://redirect.github.com/rust-lang/rust/pull/145604 )
- [Shebangs inside `--cfg` and `--check-cfg` arguments are no longer allowed](https://redirect.github.com/rust-lang/rust/pull/146211 )
- [Add future incompatibility lint for temporary lifetime shortening in Rust 1.92](https://redirect.github.com/rust-lang/rust/pull/147056 )
Cargo compatibility notes:
- `cargo publish` no longer keeps `.crate` tarballs as final build artifacts
when `build.build-dir` is set. These tarballs were previously included due to
an oversight and are now treated as intermediate artifacts.
To get `.crate` tarballs as final artifacts, use `cargo package`.
In a future version, this change will apply regardless of `build.build-dir`.
[#​15910](https://redirect.github.com/rust-lang/cargo/pull/15910 )
- Adjust Cargo messages to match rustc diagnostic style.
This changes some of the terminal colors used by Cargo messages.
[#​15928](https://redirect.github.com/rust-lang/cargo/pull/15928 )
- Tools and projects relying on the
[internal details of Cargo's `build-dir`](https://doc.rust-lang.org/cargo/reference/build-cache.html )
may not work for users changing their `build-dir` layout.
For those doing so, we'd recommend proactively testing these cases
particularly as we are considering changing the default location of the `build-dir` in the future
([cargo#16147](https://redirect.github.com/rust-lang/cargo/issues/16147 )).
If you can't migrate off of Cargo's internal details,
we'd like to learn more about your use case as we prepare to change the layout of the `build-dir`
([cargo#15010](https://redirect.github.com/rust-lang/cargo/issues/15010 )).
<a id="1.91.0-Internal-Changes"></a>
## Internal Changes
These changes do not affect any public interfaces of Rust, but they represent
significant improvements to the performance or internals of rustc and related
tools.
- [Update to LLVM 21](https://redirect.github.com/rust-lang/rust/pull/143684 )
</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:eyJjcmVhdGVkSW5WZXIiOiI0MS4xNTkuNCIsInVwZGF0ZWRJblZlciI6IjQxLjE1OS40IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->
2025-10-30 22:23:29 +00:00
Copilot
d7daf079a2
test(transformer): add escaping tests for inject import sources with special characters ( #15127 )
...
Investigated the reported issue where import source specifiers with
special characters (like quotes) were claimed to not be escaped in the
inject global variables transformer.
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com >
Co-authored-by: sapphi-red <49056869+sapphi-red@users.noreply.github.com >
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-10-30 20:37:33 +09:00