Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Josh Goldberg ✨ <git@joshuakgoldberg.com>
  • Loading branch information
ST-DDT and JoshuaKGoldberg committed Nov 12, 2023
1 parent 7b77360 commit e85158d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ switch (value) {
}
```

Since `value` is a non-union type it requires the switch case to have a default clause.
Since `value` is a non-union type it requires the switch case to have a default clause only with `requireDefaultForNonUnion` enabled.

## When Not To Use It

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ export default createRule<Options, MessageIds>({
suggest: [
{
messageId: 'addMissingCases',
fix(fixer): TSESLint.RuleFix | null {
fix(fixer): TSESLint.RuleFix {
return fixSwitch(fixer, node, [null]);
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ function test(value: ObjectUnion): number {
// switch with default clause on non-union type
{
code: `
const value: number = Math.floor(Math.random() * 3);
declare const value: number;
switch (value) {
case 0:
Expand Down

0 comments on commit e85158d

Please sign in to comment.