Skip to content

refactor(linter/plugins): add type assertions to ensure correctness of TEST_CASE_PROP_KEYS_ARRAY#18450

Merged
graphite-app[bot] merged 1 commit intomainfrom
om/01-23-refactor_linter_plugins_add_type_assertions_to_ensure_correctness_of_test_case_prop_keys_array_
Jan 23, 2026
Merged

refactor(linter/plugins): add type assertions to ensure correctness of TEST_CASE_PROP_KEYS_ARRAY#18450
graphite-app[bot] merged 1 commit intomainfrom
om/01-23-refactor_linter_plugins_add_type_assertions_to_ensure_correctness_of_test_case_prop_keys_array_

Conversation

@overlookmotel
Copy link
Member

@overlookmotel overlookmotel commented Jan 23, 2026

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.

@github-actions github-actions bot added A-linter Area - Linter A-cli Area - CLI A-linter-plugins Area - Linter JS plugins C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior labels Jan 23, 2026
Copy link
Member Author

overlookmotel commented Jan 23, 2026


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.

@overlookmotel overlookmotel marked this pull request as ready for review January 23, 2026 12:51
Copilot AI review requested due to automatic review settings January 23, 2026 12:51
Copy link
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 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_KEYS to TEST_CASE_PROP_KEYS_ARRAY and added type constraints using as const satisfies
  • Added helper types (TestCaseOwnKeys, MissingKeys, KeysSet) that enforce completeness at compile time
  • The original TEST_CASE_PROP_KEYS Set 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.

@overlookmotel overlookmotel self-assigned this Jan 23, 2026
@overlookmotel overlookmotel removed the request for review from camc314 January 23, 2026 13:12
@overlookmotel overlookmotel added the 0-merge Merge with Graphite Merge Queue label Jan 23, 2026
Copy link
Member Author

overlookmotel commented Jan 23, 2026

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.
@graphite-app graphite-app bot force-pushed the om/01-23-feat_linter_plugins_ruletester_support_settings branch from 381f3ca to b4b6247 Compare January 23, 2026 13:13
@graphite-app graphite-app bot force-pushed the om/01-23-refactor_linter_plugins_add_type_assertions_to_ensure_correctness_of_test_case_prop_keys_array_ branch from 8c0391b to 85903cd Compare January 23, 2026 13:14
Base automatically changed from om/01-23-feat_linter_plugins_ruletester_support_settings to main January 23, 2026 13:19
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Jan 23, 2026
@graphite-app graphite-app bot merged commit 85903cd into main Jan 23, 2026
20 checks passed
@graphite-app graphite-app bot deleted the om/01-23-refactor_linter_plugins_add_type_assertions_to_ensure_correctness_of_test_case_prop_keys_array_ branch January 23, 2026 13:20
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