Skip to content

fix(linter): mark consistent-type-definitions fix as dangerous inside declare global blocks#16745

Merged
graphite-app[bot] merged 1 commit intomainfrom
c/12-11-fix_linter_mark_consistent-type-definitions_fix_as_dangerous_inside_declare_global_blocks
Dec 11, 2025
Merged

fix(linter): mark consistent-type-definitions fix as dangerous inside declare global blocks#16745
graphite-app[bot] merged 1 commit intomainfrom
c/12-11-fix_linter_mark_consistent-type-definitions_fix_as_dangerous_inside_declare_global_blocks

Conversation

@camc314
Copy link
Copy Markdown
Contributor

@camc314 camc314 commented Dec 11, 2025

Fixes #16743

🤖 generated with help from Claude Opus 4.5

Copy link
Copy Markdown
Contributor Author

camc314 commented Dec 11, 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.

@github-actions github-actions bot added A-linter Area - Linter C-bug Category - Bug labels Dec 11, 2025
@camc314 camc314 force-pushed the c/12-11-fix_linter_mark_consistent-type-definitions_fix_as_dangerous_inside_declare_global_blocks branch 2 times, most recently from d23707c to fde6142 Compare December 11, 2025 11:40
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Dec 11, 2025

CodSpeed Performance Report

Merging #16745 will not alter performance

Comparing c/12-11-fix_linter_mark_consistent-type-definitions_fix_as_dangerous_inside_declare_global_blocks (fde6142) with main (3ffe342)

Summary

✅ 4 untouched
⏩ 41 skipped1

Footnotes

  1. 41 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 self-assigned this Dec 11, 2025
@camc314 camc314 marked this pull request as ready for review December 11, 2025 12:47
Copilot AI review requested due to automatic review settings December 11, 2025 12:47
@camc314 camc314 added the 0-merge Merge with Graphite Merge Queue label Dec 11, 2025
Copy link
Copy Markdown
Contributor Author

camc314 commented Dec 11, 2025

Merge activity

graphite-app bot pushed a commit that referenced this pull request Dec 11, 2025
… declare global blocks (#16745)

Fixes #16743

🤖 generated with help from Claude Opus 4.5
@graphite-app graphite-app bot force-pushed the c/12-11-fix_linter_mark_consistent-type-definitions_fix_as_dangerous_inside_declare_global_blocks branch from fde6142 to 36b2c72 Compare December 11, 2025 12:48
Copy link
Copy Markdown
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 addresses issue #16743 by marking the auto-fix for the consistent-type-definitions rule as dangerous when converting interfaces to types within declare global blocks. The fix is now conditional based on the context - safe in normal code but dangerous within global declarations, where interface merging behavior differs from type aliases.

Key changes:

  • Changed the rule's fix capability from fix to conditional_fix_dangerous to support context-dependent fix safety
  • Added runtime checking via is_within_declare_global_block() helper function to detect global declaration contexts
  • Refactored fix application logic to use ctx.diagnostic_with_dangerous_fix() when inside global blocks and ctx.diagnostic_with_fix() elsewhere

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

graphite-app bot pushed a commit that referenced this pull request Dec 11, 2025
… declare global blocks (#16745)

Fixes #16743

🤖 generated with help from Claude Opus 4.5
@graphite-app graphite-app bot force-pushed the c/12-11-fix_linter_mark_consistent-type-definitions_fix_as_dangerous_inside_declare_global_blocks branch from d6d1da8 to 06b3dae Compare December 11, 2025 12:51
… declare global blocks (#16745)

Fixes #16743

🤖 generated with help from Claude Opus 4.5
@graphite-app graphite-app bot force-pushed the c/12-11-fix_linter_mark_consistent-type-definitions_fix_as_dangerous_inside_declare_global_blocks branch from b529655 to cb51c74 Compare December 11, 2025 12:53
@graphite-app graphite-app bot merged commit cb51c74 into main Dec 11, 2025
20 checks passed
@graphite-app graphite-app bot deleted the c/12-11-fix_linter_mark_consistent-type-definitions_fix_as_dangerous_inside_declare_global_blocks branch December 11, 2025 12:58
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Dec 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-linter Area - Linter C-bug Category - Bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

linter: typescript/consistent-type-definition: "type" autofix should ignore interfaces within declare blocks

2 participants