From 8d9ba7e9d2477c89e873117ca8996163f92de1fe Mon Sep 17 00:00:00 2001 From: Mathias Schreck Date: Fri, 6 Mar 2020 20:38:46 +0100 Subject: [PATCH] Document new default value for caughtErrorsIgnorePattern --- docs/rules/catch-error-name.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/rules/catch-error-name.md b/docs/rules/catch-error-name.md index c415ac9391..0f613f44e3 100644 --- a/docs/rules/catch-error-name.md +++ b/docs/rules/catch-error-name.md @@ -101,7 +101,7 @@ You can set the `name` option like this: ] ``` -This option lets you specify a regex pattern for matches to ignore. The default is `^_$`. +This option lets you specify a regex pattern for matches to ignore. The default allows `_` and descriptive names like `networkError`. With `^unicorn$`, this would fail: @@ -122,3 +122,7 @@ try { // … } ``` + +## Tip + +In order to avoid shadowing in nested catch clauses the auto-fix rule appends underscores to the identifier name. Since this might be hard to read the default settings for `caughtErrorsIgnorePattern` allows to use descriptive names instead, e.g. `fsError` or `authError`.