Skip to content

Comments

fix(ast)!: add TSGlobalDeclaration type#15712

Merged
graphite-app[bot] merged 1 commit intomainfrom
11-06-fix_ast_add_tsglobaldeclaration_type
Nov 17, 2025
Merged

fix(ast)!: add TSGlobalDeclaration type#15712
graphite-app[bot] merged 1 commit intomainfrom
11-06-fix_ast_add_tsglobaldeclaration_type

Conversation

@overlookmotel
Copy link
Member

@overlookmotel overlookmotel commented Nov 15, 2025

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 TSModuleDeclarations 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 TSModuleDeclarations.

This change simplifies the parser quite a bit.

oxc_semantic's SymbolDeclarationTest tester now tests that all TSModuleDeclarations with id: BindingIdentifier do have a symbol:

https://github.com/oxc-project/oxc/pull/15712/files#diff-ce544d71b839faa898887ac920237e563e59a708e7fca86b53023498ab67a611L101-R110

@github-actions github-actions bot added A-linter Area - Linter A-parser Area - Parser A-semantic Area - Semantic A-cli Area - CLI A-ast Area - AST A-transformer Area - Transformer / Transpiler A-codegen Area - Code Generation A-isolated-declarations Isolated Declarations A-ast-tools Area - AST tools A-formatter Area - Formatter A-linter-plugins Area - Linter JS plugins labels Nov 15, 2025
Copy link
Member Author

overlookmotel commented Nov 15, 2025


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@codspeed-hq
Copy link

codspeed-hq bot commented Nov 15, 2025

CodSpeed Performance Report

Merging #15712 will not alter performance

Comparing 11-06-fix_ast_add_tsglobaldeclaration_type (3fee43e) with main (32f4fdd)

Summary

✅ 37 untouched

@overlookmotel overlookmotel force-pushed the 11-06-fix_ast_add_tsglobaldeclaration_type branch from 0925464 to 18b2813 Compare November 15, 2025 12:00
@overlookmotel overlookmotel marked this pull request as ready for review November 15, 2025 12:07
@overlookmotel overlookmotel changed the title fix(ast): add TSGlobalDeclaration type fix(ast)!: add TSGlobalDeclaration type Nov 15, 2025
@overlookmotel
Copy link
Member Author

@overlookmotel
Copy link
Member Author

overlookmotel commented Nov 15, 2025

I assume this'll break Rolldown, but probably not too hard to fix.

graphite-app bot pushed a commit that referenced this pull request Nov 15, 2025
…:as_module_block_mut` (#15713)

Small perf optimization. Use a loop instead of recursion, to avoid generating stack frames.

Rust compiler does not guarantee tail call optimization, and anyway (according to Claude) it wouldn't be possible in this case, due to the `and_then` closure.

(noticed this while working on #15712)
@camc314 camc314 changed the base branch from 11-15-refactor_transformer_typescript_use_exhaustive_match to graphite-base/15712 November 15, 2025 13:55
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR splits TypeScript's global {} declarations into a dedicated TSGlobalDeclaration AST node type, separating it from TSModuleDeclaration. This change addresses semantic differences where global {} has no identifier symbol, a mandatory body, disallows directives, and is always ambient.

Key Changes:

  • Introduced new TSGlobalDeclaration AST node type distinct from TSModuleDeclaration
  • Removed Global variant from TSModuleDeclarationKind enum
  • Updated parser to handle global {} separately
  • Modified all visitor, serialization, and transformation code to handle both types
  • Updated semantic analysis to treat TSGlobalDeclaration correctly without symbol creation

Reviewed Changes

Copilot reviewed 37 out of 76 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
crates/oxc_ast/src/ast/ts.rs Defines new TSGlobalDeclaration struct with global_span field and updates TSModuleDeclarationKind
crates/oxc_parser/src/ts/statement.rs Splits parsing logic to handle global separately from module/namespace
crates/oxc_semantic/src/binder.rs Removes special case for global in TSModuleDeclaration binding
crates/oxc_formatter/src/write/mod.rs Adds formatter implementation for TSGlobalDeclaration
Generated files Updates to all generated visitors, serializers, and type definitions

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@graphite-app graphite-app bot added the 0-merge Merge with Graphite Merge Queue label Nov 17, 2025
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?
@graphite-app graphite-app bot force-pushed the 11-06-fix_ast_add_tsglobaldeclaration_type branch from 3fee43e to cbb27fd Compare November 17, 2025 19:25
@graphite-app graphite-app bot merged commit cbb27fd into main Nov 17, 2025
22 checks passed
@graphite-app graphite-app bot deleted the 11-06-fix_ast_add_tsglobaldeclaration_type branch November 17, 2025 19:30
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Nov 17, 2025
graphite-app bot pushed a commit that referenced this pull request Nov 17, 2025
Follow-on after #15712. Correct a comment, based on AI review: #15712 (comment)
graphite-app bot pushed a commit that referenced this pull request Nov 18, 2025
Error on invalid modifiers before `module` and `global` declarations.

Previously illegal syntax like this would be parsed without error:

```ts
protected accessor readonly async declare global {}
protected accessor readonly async global {}
protected accessor readonly async module "foo" {}
```

Discovered this bug while working on #15712.

Similar to #11713.
camc314 pushed a commit that referenced this pull request Nov 18, 2025
Error on invalid modifiers before `module` and `global` declarations.

Previously illegal syntax like this would be parsed without error:

```ts
protected accessor readonly async declare global {}
protected accessor readonly async global {}
protected accessor readonly async module "foo" {}
```

Discovered this bug while working on #15712.

Similar to #11713.
camc314 added a commit to camc314/rolldown that referenced this pull request Nov 20, 2025
camc314 added a commit to camc314/rolldown that referenced this pull request Nov 22, 2025
camc314 added a commit to camc314/rolldown that referenced this pull request Nov 24, 2025
overlookmotel pushed a commit that referenced this pull request Nov 24, 2025
### 💥 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 <[email protected]>
overlookmotel added a commit that referenced this pull request Nov 24, 2025
# Oxlint
### 💥 BREAKING CHANGES

- cbb27fd ast: [**BREAKING**] Add `TSGlobalDeclaration` type (#15712)
(overlookmotel)

### 🚀 Features

- 72660f7 linter: Support auto generate config document for tuple lint
option (#15904) (Duc Nghiem Xuan)
- 0c1f82b linter/plugins: Add `tokens` property to `Program` (#16020)
(overlookmotel)
- 9e61beb linter/plugins: Implement `SourceCode#getFirstToken()`
(#16002) (Arsh)
- 9a548dd linter/plugins: Implement `SourceCode#getLastTokens()`
(#16000) (Arsh)
- 0b6cb11 linter/plugins: Implement `SourceCode#getFirstTokens()`
(#15976) (Arsh)
- 166781e linter/plugins: Implement `SourceCode#getTokenAfter()`
(#15973) (Arsh)
- 6ae232b linter: Expose type errors via tsgolint (#15917) (camc314)
- 2bfdd26 linter/plugins: Implement `SourceCode#getTokensAfter()`
(#15971) (Arsh)
- 45fffc1 linter/plugins: Implement `SourceCode#getTokenBefore()`
(#15956) (Arsh)
- 776e473 linter/plugins: Implement `SourceCode#getTokensBefore()`
(#15955) (Arsh)
- 595867a oxlint: Generate markdownDescription fields for oxlint JSON
schema. (#15959) (connorshea)
- 5569317 vscode: Add quick actions to status bar tooltip (#15962)
(Sysix)
- 986cac1 linter/plugins: Token-related `SourceCode` APIs (TS ESLint
implementation) (#15861) (Arsh)
- a21f9e4 linter: Implement unicorn/prefer-bigint-literals rule (#15923)
(Michiel Vrins)
- 4b9d8d2 linter/type-aware: Include range with tsconfig diagnostics
(#15916) (camc314)
- 220d01e editor: Improve the status bar item for the VS Code extension
by adding a tooltip. (#15819) (connorshea)

### 🐛 Bug Fixes

- 2bd3cb6 apps, editors, napi: Fix `oxlint-disable` comments (#16014)
(overlookmotel)
- 81f5360 linter/prefer-number-properties: Get fixer to replace entire
call expr (#15979) (camc314)
- e4ba07f language_server: Always write to memory file system (#15975)
(Sysix)
- a8a2032 linter: Support missing `range` for internal diagnostics
(#15964) (camc314)
- 619a226 oxlint/lsp: Don't register `textDocument/formatting`
capability (#15882) (Sysix)
- 6ab1a20 linter: Fix no_useless_spread producing invalid syntax when
removing empty object spreads (#15905) (camc314)
- be4b6df linter: Unicorn/prefer-string-replace-all incorrectly escapes
backslashes (#15901) (camc314)
- 9fa9ef2 linter: Gracefully fail when using import plugin, large file
counf and JS plugins (#15864) (camc314)
- c027398 linter/plugins: Correct bindings package names glob in TSDown
config (#15871) (overlookmotel)
- b622ef8 linter: Fix `oxc/bad_array_method_on_arguments` rule behavior.
(#15854) (connorshea)
- aa06c3f linter: Recognize NewExpression as value context in
no-unused-private-class-members (#15843) (camc314)
- e89c5ba typescript/prefer-namespace-keyword: Skip nested
`TSModuleDeclaration`s (#15806) (overlookmotel)
- 646d020 linter/exhaustive-dependencies: Prevent is_callee_of_call_expr
flag from leaking into nested expressions (#15832) (camc314)
- 46bd6bd linter/plugins: Pin `@typescript-eslint/scope-manager`
dependency (#15807) (overlookmotel)
- fba31fa linter: Patch `@typescript-eslint/scope manager` (#15214)
(Arsh)
- 50307c1 linter/jest: Ignore `expect` identifier in argument position
(#15785) (camc314)

### ⚡ Performance

- 024b48a linter/plugins: Lazy-load tokens parsing code (#16011)
(overlookmotel)
- 15365c9 linter/plugins: Reduce var assignments (#15953)
(overlookmotel)
- 84d1f4f linter/plugins: Downgrade some checks to debug-only (#15922)
(overlookmotel)
- a49f704 linter/typescript: Avoid searching source text unless required
(#15805) (overlookmotel)

### 📚 Documentation

- ceffa5a linter: Add config option docs for various rules. (#16024)
(connorshea)
- 9a0ed13 linter: Fix config option docs for eslint/operator-assignment
rule. (#16030) (connorshea)
- 0b18005 linter: Add config docs generation for rules with Regex
arguments (#15978) (connorshea)
- 48d18e0 linter: Improve diagnostic message for promise/catch-or-return
rule (#15980) (connorshea)
- 6c72e84 linter: Use backticks for code elements across more rule
diagnostics (#15958) (connorshea)
- a63dad7 linter/plugins: Add comment (#15952) (overlookmotel)
- 81ea642 vscode: Use markdownDescription for better formatting in
VSCode Settings (#15889) (connorshea)
- db6a110 linter/plugins: Fix JSDoc comment (#15884) (overlookmotel)
- 1487271 linter: Add config option docs for `jsdoc/require-param` and
`jsdoc/require-returns` rules (#15857) (connorshea)
- fbf0fd4 linter/plugins: Add JSDoc comments to `Plugin` and `Rule`
types (#15815) (overlookmotel)
- ac5e4b5 linter/plugins: Add JSDoc comments and improve comments
(#15814) (overlookmotel)
- 9b7b083 linter: Fix error in `curly` `"all"` example (#15801)
(camc314)
- 65a3520 linter: Improve diagnostic for consistent-type-definitions
rule. (#15752) (connorshea)

### 🛡️ Security

- f9b9276 deps: Update dependency rolldown to v1.0.0-beta.51 (#15856)
(renovate[bot])
# Oxfmt
### 💥 BREAKING CHANGES

- a937890 formatter: [**BREAKING**] Default to `lineWidth: 100` (#15933)
(leaysgur)
- 03d5f5a formatter/sort-imports: [**BREAKING**] Change default order to
`natural` with `natord` crate (#15828) (leaysgur)
- cbb27fd ast: [**BREAKING**] Add `TSGlobalDeclaration` type (#15712)
(overlookmotel)

### 🚀 Features

- 7818e22 formatter/sort-imports: Support `options.groups` (#15831)
(leaysgur)
- f9a502c oxfmt: `oxfmt --lsp` support (#15765) (leaysgur)

### 🐛 Bug Fixes

- 4817486 formatter: Revert `FormatElement::BestFitting` printing logic
(#16028) (Dunqing)
- 5562dd6 formatter: Incorrect formatting method chain with trailing
comments (#16027) (Dunqing)
- 6d14c8b formatter: Comments in export class decorators are printing
incorrectly (#15897) (Dunqing)
- 683c764 formatter: Correct a few minor mismatched typescript tests
(#15894) (Dunqing)
- c11cc07 formatter: Improve formatting for default type on type
parameters (#15893) (Dunqing)
- 0bff596 formatter: Handle JSX expresssion dangling comment (#15890)
(leaysgur)
- 16a9dc8 formatter: Inconsistent printing of class extends and
interface extends (#15892) (Dunqing)
- 300b496 formatter: Inconsistent CallExpression and NewExpression
around member chain and logical expression (#15858) (Dunqing)

### ⚡ Performance

- 65174cc formatter: Reduce the size of `TextWidth` to 4 byte (#15827)
(Dunqing)
- 4fe3aac formatter: Use `ArenaVec` and `ArenaBox` (#15420) (Dunqing)

Co-authored-by: overlookmotel <[email protected]>
Boshen pushed a commit to rolldown/rolldown that referenced this pull request Nov 24, 2025
There's only one breaking change at the moment:
 - oxc-project/oxc#15712
taearls pushed a commit to taearls/oxc that referenced this pull request Dec 11, 2025
…:as_module_block_mut` (oxc-project#15713)

Small perf optimization. Use a loop instead of recursion, to avoid generating stack frames.

Rust compiler does not guarantee tail call optimization, and anyway (according to Claude) it wouldn't be possible in this case, due to the `and_then` closure.

(noticed this while working on oxc-project#15712)
taearls pushed a commit to taearls/oxc that referenced this pull request Dec 11, 2025
…5711)

Pure refactor. Use an exhaustive match, so get a compilation error rather than misbehavior if we add a `Declaration` variant (I hit this problem in oxc-project#15712).
taearls pushed a commit to taearls/oxc that referenced this pull request Dec 11, 2025
Fix oxc-project#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?
taearls pushed a commit to taearls/oxc that referenced this pull request Dec 11, 2025
taearls pushed a commit to taearls/oxc that referenced this pull request Dec 11, 2025
…roject#15723)

Error on invalid modifiers before `module` and `global` declarations.

Previously illegal syntax like this would be parsed without error:

```ts
protected accessor readonly async declare global {}
protected accessor readonly async global {}
protected accessor readonly async module "foo" {}
```

Discovered this bug while working on oxc-project#15712.

Similar to oxc-project#11713.
taearls pushed a commit to taearls/oxc that referenced this pull request Dec 11, 2025
### 💥 BREAKING CHANGES

- cbb27fd ast: [**BREAKING**] Add `TSGlobalDeclaration` type (oxc-project#15712)
(overlookmotel)

### 🚀 Features

- 0c1f82b linter/plugins: Add `tokens` property to `Program` (oxc-project#16020)
(overlookmotel)
- 6cff132 span: Add `Span::merge_within` method (oxc-project#15869) (sapphi-red)
- 102365d allocator/vec: Add `Vec::into_bump_slice` method (oxc-project#15770)
(Dunqing)

### 🐛 Bug Fixes

- e2ca770 codegen: Add support for printing type arguments in new
expressions (oxc-project#15963) (Ives van Hoorne)
- 2bd3cb6 apps, editors, napi: Fix `oxlint-disable` comments (oxc-project#16014)
(overlookmotel)
- 622cb5e parser: Preserve legal comments with @preserve/@license when
preceded by other annotations (oxc-project#15929) (copilot-swe-agent)
- 7c46a9e transformer/tagged-template-transform: Handle `\n` escape
sequences (oxc-project#15830) (Dunqing)
- f386efc minifier: Avoid generating invalid spans (oxc-project#15778) (sapphi-red)
- d4ff004 parser: Forbid invalid modifiers on `module` and `global`
(oxc-project#15723) (overlookmotel)
- 2191ae9 semantic: Allow reserved keywords in typescript ambient
contexts (oxc-project#15495) (sapphi-red)
- 7d1ebad isolated-declarations: Incorrect nested namespace output in
isolated declarations (oxc-project#15800) (copilot-swe-agent)

### ⚡ Performance

- b4b0ed8 transformer/typescript: Reverse order of checks (oxc-project#15722)
(overlookmotel)

### 📚 Documentation

- c81a331 data_structures: Doc comments on fields of `Stack` (oxc-project#15793)
(overlookmotel)
- cfae31d allocator: Use `allocator` as var name in examples (oxc-project#15781)
(overlookmotel)

Co-authored-by: Boshen <[email protected]>
taearls pushed a commit to taearls/oxc that referenced this pull request Dec 11, 2025
# Oxlint
### 💥 BREAKING CHANGES

- cbb27fd ast: [**BREAKING**] Add `TSGlobalDeclaration` type (oxc-project#15712)
(overlookmotel)

### 🚀 Features

- 72660f7 linter: Support auto generate config document for tuple lint
option (oxc-project#15904) (Duc Nghiem Xuan)
- 0c1f82b linter/plugins: Add `tokens` property to `Program` (oxc-project#16020)
(overlookmotel)
- 9e61beb linter/plugins: Implement `SourceCode#getFirstToken()`
(oxc-project#16002) (Arsh)
- 9a548dd linter/plugins: Implement `SourceCode#getLastTokens()`
(oxc-project#16000) (Arsh)
- 0b6cb11 linter/plugins: Implement `SourceCode#getFirstTokens()`
(oxc-project#15976) (Arsh)
- 166781e linter/plugins: Implement `SourceCode#getTokenAfter()`
(oxc-project#15973) (Arsh)
- 6ae232b linter: Expose type errors via tsgolint (oxc-project#15917) (camc314)
- 2bfdd26 linter/plugins: Implement `SourceCode#getTokensAfter()`
(oxc-project#15971) (Arsh)
- 45fffc1 linter/plugins: Implement `SourceCode#getTokenBefore()`
(oxc-project#15956) (Arsh)
- 776e473 linter/plugins: Implement `SourceCode#getTokensBefore()`
(oxc-project#15955) (Arsh)
- 595867a oxlint: Generate markdownDescription fields for oxlint JSON
schema. (oxc-project#15959) (connorshea)
- 5569317 vscode: Add quick actions to status bar tooltip (oxc-project#15962)
(Sysix)
- 986cac1 linter/plugins: Token-related `SourceCode` APIs (TS ESLint
implementation) (oxc-project#15861) (Arsh)
- a21f9e4 linter: Implement unicorn/prefer-bigint-literals rule (oxc-project#15923)
(Michiel Vrins)
- 4b9d8d2 linter/type-aware: Include range with tsconfig diagnostics
(oxc-project#15916) (camc314)
- 220d01e editor: Improve the status bar item for the VS Code extension
by adding a tooltip. (oxc-project#15819) (connorshea)

### 🐛 Bug Fixes

- 2bd3cb6 apps, editors, napi: Fix `oxlint-disable` comments (oxc-project#16014)
(overlookmotel)
- 81f5360 linter/prefer-number-properties: Get fixer to replace entire
call expr (oxc-project#15979) (camc314)
- e4ba07f language_server: Always write to memory file system (oxc-project#15975)
(Sysix)
- a8a2032 linter: Support missing `range` for internal diagnostics
(oxc-project#15964) (camc314)
- 619a226 oxlint/lsp: Don't register `textDocument/formatting`
capability (oxc-project#15882) (Sysix)
- 6ab1a20 linter: Fix no_useless_spread producing invalid syntax when
removing empty object spreads (oxc-project#15905) (camc314)
- be4b6df linter: Unicorn/prefer-string-replace-all incorrectly escapes
backslashes (oxc-project#15901) (camc314)
- 9fa9ef2 linter: Gracefully fail when using import plugin, large file
counf and JS plugins (oxc-project#15864) (camc314)
- c027398 linter/plugins: Correct bindings package names glob in TSDown
config (oxc-project#15871) (overlookmotel)
- b622ef8 linter: Fix `oxc/bad_array_method_on_arguments` rule behavior.
(oxc-project#15854) (connorshea)
- aa06c3f linter: Recognize NewExpression as value context in
no-unused-private-class-members (oxc-project#15843) (camc314)
- e89c5ba typescript/prefer-namespace-keyword: Skip nested
`TSModuleDeclaration`s (oxc-project#15806) (overlookmotel)
- 646d020 linter/exhaustive-dependencies: Prevent is_callee_of_call_expr
flag from leaking into nested expressions (oxc-project#15832) (camc314)
- 46bd6bd linter/plugins: Pin `@typescript-eslint/scope-manager`
dependency (oxc-project#15807) (overlookmotel)
- fba31fa linter: Patch `@typescript-eslint/scope manager` (oxc-project#15214)
(Arsh)
- 50307c1 linter/jest: Ignore `expect` identifier in argument position
(oxc-project#15785) (camc314)

### ⚡ Performance

- 024b48a linter/plugins: Lazy-load tokens parsing code (oxc-project#16011)
(overlookmotel)
- 15365c9 linter/plugins: Reduce var assignments (oxc-project#15953)
(overlookmotel)
- 84d1f4f linter/plugins: Downgrade some checks to debug-only (oxc-project#15922)
(overlookmotel)
- a49f704 linter/typescript: Avoid searching source text unless required
(oxc-project#15805) (overlookmotel)

### 📚 Documentation

- ceffa5a linter: Add config option docs for various rules. (oxc-project#16024)
(connorshea)
- 9a0ed13 linter: Fix config option docs for eslint/operator-assignment
rule. (oxc-project#16030) (connorshea)
- 0b18005 linter: Add config docs generation for rules with Regex
arguments (oxc-project#15978) (connorshea)
- 48d18e0 linter: Improve diagnostic message for promise/catch-or-return
rule (oxc-project#15980) (connorshea)
- 6c72e84 linter: Use backticks for code elements across more rule
diagnostics (oxc-project#15958) (connorshea)
- a63dad7 linter/plugins: Add comment (oxc-project#15952) (overlookmotel)
- 81ea642 vscode: Use markdownDescription for better formatting in
VSCode Settings (oxc-project#15889) (connorshea)
- db6a110 linter/plugins: Fix JSDoc comment (oxc-project#15884) (overlookmotel)
- 1487271 linter: Add config option docs for `jsdoc/require-param` and
`jsdoc/require-returns` rules (oxc-project#15857) (connorshea)
- fbf0fd4 linter/plugins: Add JSDoc comments to `Plugin` and `Rule`
types (oxc-project#15815) (overlookmotel)
- ac5e4b5 linter/plugins: Add JSDoc comments and improve comments
(oxc-project#15814) (overlookmotel)
- 9b7b083 linter: Fix error in `curly` `"all"` example (oxc-project#15801)
(camc314)
- 65a3520 linter: Improve diagnostic for consistent-type-definitions
rule. (oxc-project#15752) (connorshea)

### 🛡️ Security

- f9b9276 deps: Update dependency rolldown to v1.0.0-beta.51 (oxc-project#15856)
(renovate[bot])
# Oxfmt
### 💥 BREAKING CHANGES

- a937890 formatter: [**BREAKING**] Default to `lineWidth: 100` (oxc-project#15933)
(leaysgur)
- 03d5f5a formatter/sort-imports: [**BREAKING**] Change default order to
`natural` with `natord` crate (oxc-project#15828) (leaysgur)
- cbb27fd ast: [**BREAKING**] Add `TSGlobalDeclaration` type (oxc-project#15712)
(overlookmotel)

### 🚀 Features

- 7818e22 formatter/sort-imports: Support `options.groups` (oxc-project#15831)
(leaysgur)
- f9a502c oxfmt: `oxfmt --lsp` support (oxc-project#15765) (leaysgur)

### 🐛 Bug Fixes

- 4817486 formatter: Revert `FormatElement::BestFitting` printing logic
(oxc-project#16028) (Dunqing)
- 5562dd6 formatter: Incorrect formatting method chain with trailing
comments (oxc-project#16027) (Dunqing)
- 6d14c8b formatter: Comments in export class decorators are printing
incorrectly (oxc-project#15897) (Dunqing)
- 683c764 formatter: Correct a few minor mismatched typescript tests
(oxc-project#15894) (Dunqing)
- c11cc07 formatter: Improve formatting for default type on type
parameters (oxc-project#15893) (Dunqing)
- 0bff596 formatter: Handle JSX expresssion dangling comment (oxc-project#15890)
(leaysgur)
- 16a9dc8 formatter: Inconsistent printing of class extends and
interface extends (oxc-project#15892) (Dunqing)
- 300b496 formatter: Inconsistent CallExpression and NewExpression
around member chain and logical expression (oxc-project#15858) (Dunqing)

### ⚡ Performance

- 65174cc formatter: Reduce the size of `TextWidth` to 4 byte (oxc-project#15827)
(Dunqing)
- 4fe3aac formatter: Use `ArenaVec` and `ArenaBox` (oxc-project#15420) (Dunqing)

Co-authored-by: overlookmotel <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-ast Area - AST A-ast-tools Area - AST tools A-cli Area - CLI A-codegen Area - Code Generation A-formatter Area - Formatter A-isolated-declarations Isolated Declarations A-linter Area - Linter A-linter-plugins Area - Linter JS plugins A-parser Area - Parser A-semantic Area - Semantic A-transformer Area - Transformer / Transpiler C-bug Category - Bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ast: remove BindingIdentifer TSModuleDeclaration when ModuleDeclarationKind is global

4 participants