Skip to content

Commit 7b138ef

Browse files
docs(throw-error): when not to use it
1 parent a02f9a2 commit 7b138ef

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

docs/rules/throw-error.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,16 @@ throwError(() => new Error("Kaboom!"));
3838
| `allowThrowingUnknown` | Whether to always allow throwing values typed as `unknown`. | Boolean | `true` |
3939

4040
<!-- end auto-generated rule options list -->
41+
42+
## When Not To Use It
43+
44+
If you don't care about throwing values that are not `Error` objects, then you don't need this rule.
45+
However, keep in mind that, while JavaScript _allows_ throwing any value,
46+
most developer may find this behavior surprising or inconvenient to handle.
47+
48+
Type checked lint rules are more powerful than traditional lint rules, but also require configuring type checked linting.
49+
50+
## Resources
51+
52+
- [Rule source](https://github.com/JasonWeinzierl/eslint-plugin-rxjs-x/blob/main/src/rules/throw-error.ts)
53+
- [Test source](https://github.com/JasonWeinzierl/eslint-plugin-rxjs-x/blob/main/tests/rules/throw-error.test.ts)

0 commit comments

Comments
 (0)