eslint-plugin-rxjs
Version:
ESLint rules for RxJS
49 lines (35 loc) • 754 B
Markdown
for this rule:
```ts
throw "Kaboom!";
```
```ts
import { throwError } from "rxjs";
throwError("Kaboom!");
```
```ts
import { throwError } from "rxjs";
throwError(() => "Kaboom!");
```
Examples of **correct** code for this rule:
```ts
throw new Error("Kaboom!");
```
```ts
throw new RangeError("Kaboom!");
```
```ts
throw new DOMException("Kaboom!");
```
```ts
import { throwError } from "rxjs";
throwError(new Error("Kaboom!"));
```
```ts
import { throwError } from "rxjs";
throwError(() => new Error("Kaboom!"));
```
This rule has no options.
This rule forbids throwing values that are neither `Error` nor `DOMException` instances.
Examples of **incorrect** code