refactor(linter/plugins): add type assertions to ensure correctness of TEST_CASE_PROP_KEYS_ARRAY#18450
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 adds TypeScript type constraints to ensure that TEST_CASE_PROP_KEYS_ARRAY remains in sync with the TestCase interface properties. This prevents the mistake that was caught in PR #18445 where the settings field was added to the TestCase type but was forgotten in the keys array.
Changes:
- Renamed
TEST_CASE_PROP_KEYStoTEST_CASE_PROP_KEYS_ARRAYand added type constraints usingas const satisfies - Added helper types (
TestCaseOwnKeys,MissingKeys,KeysSet) that enforce completeness at compile time - The original
TEST_CASE_PROP_KEYSSet is now derived from the array with a type constraint that will cause a compile error if any keys are missing
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Merge activity
|
…f `TEST_CASE_PROP_KEYS_ARRAY` (#18450) AI review on #18445 caught a mistake (#18445 (comment)). I'd neglected to add `"settings"` to `TEST_CASE_PROP_KEYS` when I added the field to the `TestCase` type. Add type constraints that prevent this mistake in future.
381f3ca to
b4b6247
Compare
8c0391b to
85903cd
Compare

AI review on #18445 caught a mistake (#18445 (comment)). I'd neglected to add
"settings"toTEST_CASE_PROP_KEYSwhen I added the field to theTestCasetype.Add type constraints that prevent this mistake in future.