Skip to content

Commit

Permalink
Document new default value for caughtErrorsIgnorePattern
Browse files Browse the repository at this point in the history
  • Loading branch information
lo1tuma committed Mar 6, 2020
1 parent b33afd3 commit 2306268
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion docs/rules/catch-error-name.md
Expand Up @@ -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` or `error_from_network`.

With `^unicorn$`, this would fail:

Expand All @@ -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`.

0 comments on commit 2306268

Please sign in to comment.