refactor(linter/plugins): better type safety#16905
Conversation
How to use the Graphite Merge QueueAdd either label to this PR to merge it via 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. |
There was a problem hiding this comment.
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
Writableutility type fromtype-festpackage - Replaced direct cast
as Optionswith more preciseas 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.
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.
3dec902 to
6cd17ed
Compare

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