Skip to content

refactor(linter/plugins): better type safety#16905

Merged
graphite-app[bot] merged 1 commit intomainfrom
12-15-refactor_linter_plugins_better_type_safety
Dec 15, 2025
Merged

refactor(linter/plugins): better type safety#16905
graphite-app[bot] merged 1 commit intomainfrom
12-15-refactor_linter_plugins_better_type_safety

Conversation

@overlookmotel
Copy link
Copy Markdown
Member

@overlookmotel overlookmotel commented Dec 15, 2025

Small improvement to type safety. Here we need to remove Readonly from a type, but do only that, rather than full type-casting.

@github-actions github-actions bot added A-linter Area - Linter A-cli Area - CLI A-linter-plugins Area - Linter JS plugins labels Dec 15, 2025
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 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 the C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior label Dec 15, 2025
@overlookmotel overlookmotel marked this pull request as ready for review December 15, 2025 14:12
Copilot AI review requested due to automatic review settings December 15, 2025 14:12
@overlookmotel overlookmotel self-assigned this Dec 15, 2025
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 improves type safety in the plugin options handling code by using a more precise type transformation when casting readonly types to mutable ones. Instead of performing a broad type cast that could potentially hide other type issues, the code now explicitly uses the Writable<T> utility type from type-fest to remove only the readonly modifier while preserving the underlying type structure.

Key changes:

  • Added import for Writable utility type from type-fest package
  • Replaced direct cast as Options with more precise as Writable<(typeof allOptions)[number]> to explicitly indicate removal of readonly modifier

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

@overlookmotel overlookmotel added the 0-merge Merge with Graphite Merge Queue label Dec 15, 2025
Copy link
Copy Markdown
Member Author

overlookmotel commented Dec 15, 2025

Merge activity

Small improvement to type safety. Here we need to remove `Readonly` from a type, but do only that, rather than full type-casting.
@graphite-app graphite-app bot force-pushed the 12-15-refactor_linter_plugins_better_type_safety branch from 3dec902 to 6cd17ed Compare December 15, 2025 14:46
@graphite-app graphite-app bot merged commit 6cd17ed into main Dec 15, 2025
18 checks passed
@graphite-app graphite-app bot deleted the 12-15-refactor_linter_plugins_better_type_safety branch December 15, 2025 14:52
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Dec 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-cli Area - CLI A-linter Area - Linter A-linter-plugins Area - Linter JS plugins C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants