From b4efddae65fb80184d107da510c5992dcdc1c5f4 Mon Sep 17 00:00:00 2001 From: auvred Date: Fri, 29 Dec 2023 20:04:17 +0000 Subject: [PATCH] chore(eslint-plugin): [switch-exhaustiveness-check] remove extra quotes in rule options headers --- .../eslint-plugin/docs/rules/switch-exhaustiveness-check.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/eslint-plugin/docs/rules/switch-exhaustiveness-check.md b/packages/eslint-plugin/docs/rules/switch-exhaustiveness-check.md index b0cbaf1c47d4..1c53690ae77a 100644 --- a/packages/eslint-plugin/docs/rules/switch-exhaustiveness-check.md +++ b/packages/eslint-plugin/docs/rules/switch-exhaustiveness-check.md @@ -13,14 +13,14 @@ This rule reports when a `switch` statement over a value typed as a union of lit ## Options -### `"allowDefaultCaseForExhaustiveSwitch"` +### `allowDefaultCaseForExhaustiveSwitch` Defaults to true. If set to false, this rule will also report when a `switch` statement has a case for everything in a union and _also_ contains a `default` case. Thus, by setting this option to false, the rule becomes stricter. When a `switch` statement over a union type is exhaustive, a final `default` case would be a form of dead code. Additionally, if a new value is added to the union type, a `default` would prevent the `switch-exhaustiveness-check` rule from reporting on the new case not being handled in the `switch` statement. -#### `"allowDefaultCaseForExhaustiveSwitch"` Caveats +#### `allowDefaultCaseForExhaustiveSwitch` Caveats It can sometimes be useful to include a redundant `default` case on an exhaustive `switch` statement if it's possible for values to have types not represented by the union type. For example, in applications that can have version mismatches between clients and servers, it's possible for a server running a newer software version to send a value not recognized by the client's older typings.