Skip to content

refactor(linter): typescript/explicit_module_boundary_types do not construct IdentifierName#23044

Merged
graphite-app[bot] merged 1 commit into
mainfrom
om/06-07-refactor_linter_typescript_explicit_module_boundary_types_do_not_construct_identifiername_
Jun 7, 2026
Merged

refactor(linter): typescript/explicit_module_boundary_types do not construct IdentifierName#23044
graphite-app[bot] merged 1 commit into
mainfrom
om/06-07-refactor_linter_typescript_explicit_module_boundary_types_do_not_construct_identifiername_

Conversation

@overlookmotel

@overlookmotel overlookmotel commented Jun 7, 2026

Copy link
Copy Markdown
Member

#23046 adds #[non_exhaustive] to all AST node types, which forces all AST node construction to go through AstBuilder.

typescript/explicit_module_boundary_types rule was manually constructing IdentifierNames, which violates this rule.

The rule doesn't actually need to construct IdentifierNames - it was just using the type as a convenient way to store a Span + &str pair. Replace it with a TargetSymbol type which contains that data.

overlookmotel commented Jun 7, 2026

Copy link
Copy Markdown
Member Author

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 changes, fast-track this PR to the front of the merge queue

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.

@overlookmotel overlookmotel marked this pull request as ready for review June 7, 2026 00:43
@overlookmotel overlookmotel requested a review from camc314 as a code owner June 7, 2026 00:43
Copilot AI review requested due to automatic review settings June 7, 2026 00:43

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 updates the typescript/explicit_module_boundary_types linter rule to avoid constructing AST node types directly (specifically IdentifierName), aligning the rule with the post-#[non_exhaustive] AST construction requirement that new AST nodes be built via AstBuilder. It introduces a lightweight TargetSymbol wrapper to carry only the Span + symbol name needed for diagnostics and allowedNames checks.

Changes:

  • Replace IdentifierName-based storage for “target symbol” metadata with a new TargetSymbol { span, name } struct.
  • Remove now-unneeded imports (Cell, Ident, NodeId) tied to manual AST node construction.
  • Update allowed-name checks to use &str for function names and target symbol names.

@codspeed-hq

codspeed-hq Bot commented Jun 7, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 5 untouched benchmarks
⏩ 61 skipped benchmarks1


Comparing om/06-07-refactor_linter_typescript_explicit_module_boundary_types_do_not_construct_identifiername_ (4136a3d) with main (fd00966)

Open in CodSpeed

Footnotes

  1. 61 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@camc314 camc314 added the 0-merge Merge with Graphite Merge Queue label Jun 7, 2026

camc314 commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

Merge activity

…construct `IdentifierName` (#23044)

#23046 adds `#[non_exhaustive]` to all AST node types, which forces all AST node construction to go through `AstBuilder`.

`typescript/explicit_module_boundary_types` rule was manually constructing `IdentifierName`s, which violates this rule.

The rule doesn't actually need to construct `IdentifierName`s - it was just using the type as a convenient way to store a `Span` + `&str` pair. Replace it with a `TargetSymbol` type which contains that data.
@graphite-app graphite-app Bot force-pushed the om/06-07-refactor_linter_typescript_explicit_module_boundary_types_do_not_construct_identifiername_ branch from 4136a3d to 388af9d Compare June 7, 2026 07:20
@graphite-app graphite-app Bot merged commit 388af9d into main Jun 7, 2026
29 checks passed
@graphite-app graphite-app Bot removed the 0-merge Merge with Graphite Merge Queue label Jun 7, 2026
@graphite-app graphite-app Bot deleted the om/06-07-refactor_linter_typescript_explicit_module_boundary_types_do_not_construct_identifiername_ branch June 7, 2026 07:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-linter Area - Linter

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants