summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--GEMINI.md19
1 files 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.