From 514e883af17cbfe5f1de7c2b92c08a5f5a3a8fad Mon Sep 17 00:00:00 2001 From: Richie Foreman Date: Wed, 13 Aug 2025 18:59:46 -0400 Subject: [PATCH] chore(gemini.md): Make the checkExhaustive helper section more brief/direct (#6181) --- GEMINI.md | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/GEMINI.md b/GEMINI.md index 6eab6a47..82f69c8a 100644 --- a/GEMINI.md +++ b/GEMINI.md @@ -117,25 +117,12 @@ TypeScript's power lies in its ability to provide static type checking, catching ### Type narrowing `switch` clauses -When authoring a switch clause over an enumeration or fixed list of items, -always prefer to use the `checkExhaustive` helper method within the default -clause of the switch. This will ensure that all of the possible options within -the value or enumeration are used. +Use the `checkExhaustive` helper in the default clause of a switch statement. +This will ensure that all of the possible options within the value or +enumeration are used. This helper method can be found in `packages/cli/src/utils/checks.ts` -Here's an example of using the helper method properly: - -``` -switch (someValue) { - case 1: - case 2: - // ... - default: - return checkExhaustive(someValue); -} -``` - ### Embracing JavaScript's Array Operators To further enhance code cleanliness and promote safe functional programming practices, leverage JavaScript's rich set of array operators as much as possible. Methods like `.map()`, `.filter()`, `.reduce()`, `.slice()`, `.sort()`, and others are incredibly powerful for transforming and manipulating data collections in an immutable and declarative way.