Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .markdownlint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"line-length": false
}
4 changes: 3 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
There's nothing here, yet. Thanks for looking. I'll eventually get around to filling this out.
# Contributing

There's nothing here, yet. Thanks for looking. I'll eventually get around to filling this out.
100 changes: 57 additions & 43 deletions README.md

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion docs/rules/ban-observables.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Avoid banned observable creators (`ban-observables`)
# Disallow banned observable creators (`rxjs-x/ban-observables`)

<!-- end auto-generated rule header -->

This rule can be configured so that developers can ban any observable creators they want to avoid in their project.

Expand Down
4 changes: 3 additions & 1 deletion docs/rules/ban-operators.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Avoid banned operators (`ban-operators`)
# Disallow banned operators (`rxjs-x/ban-operators`)

<!-- end auto-generated rule header -->

This rule can be configured so that developers can ban any operators they want to avoid in their project.

Expand Down
21 changes: 20 additions & 1 deletion docs/rules/finnish.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# Use Finnish notation (`finnish`)
# Enforce Finnish notation (`rxjs-x/finnish`)

💭 This rule requires [type information](https://typescript-eslint.io/linting/typed-linting).

<!-- end auto-generated rule header -->

This rule enforces the use of Finnish notation - i.e. the `$` suffix.

Expand All @@ -18,6 +22,21 @@ const answer$ = of(42, 54);

## Options

<!-- begin auto-generated rule options list -->

| Name | Type |
| :----------- | :------ |
| `functions` | Boolean |
| `methods` | Boolean |
| `names` | Object |
| `parameters` | Boolean |
| `properties` | Boolean |
| `strict` | Boolean |
| `types` | Object |
| `variables` | Boolean |

<!-- end auto-generated rule options list -->

This rule accepts a single option which is an object with properties that determine whether Finnish notation is enforced for `functions`, `methods`, `parameters`, `properties` and `variables`. It also contains:

- `names` and `types` properties that determine whether of not Finnish notation is to be enforced for specific names or types.
Expand Down
10 changes: 5 additions & 5 deletions docs/rules/just.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Use `just` instead of `of` (`just`)
# Require the use of `just` instead of `of` (`rxjs-x/just`)

This rule enforces the use of `just` instead of `of`. Some other languages with Rx implementations use the former and this rule is for developers who have that preference.
🔧 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix).

## Options
<!-- end auto-generated rule header -->

This rule has no options.
This rule enforces the use of `just` instead of `of`. Some other languages with Rx implementations use the former and this rule is for developers who have that preference.

## Further reading

- [Rename `of` to `just`](https://github.com/ReactiveX/rxjs/issues/3747)
- [Rename `of` to `just`](https://github.com/ReactiveX/rxjs/issues/3747)
8 changes: 4 additions & 4 deletions docs/rules/macro.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Use the RxJS Tools macro (`macro`)
# Require the use of the RxJS Tools Babel macro (`rxjs-x/macro`)

This rule ensures that modules that import `rxjs` also import the Babel macro for [RxJS Tools](https://rxjs.tools).
🔧 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix).

## Options
<!-- end auto-generated rule header -->

This rule has no options.
This rule ensures that modules that import `rxjs` also import the Babel macro for [RxJS Tools](https://rxjs.tools).
12 changes: 7 additions & 5 deletions docs/rules/no-async-subscribe.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
# Avoid passing async functions to `subscribe` (`no-async-subscribe`)
# Disallow passing `async` functions to `subscribe` (`rxjs-x/no-async-subscribe`)

💼 This rule is enabled in the ✅ `recommended` config.

💭 This rule requires [type information](https://typescript-eslint.io/linting/typed-linting).

<!-- end auto-generated rule header -->

This rule effects failures if async functions are passed to `subscribe`.

Expand All @@ -18,10 +24,6 @@ import { of } from "rxjs";
of(42).subscribe(() => console.log(value));
```

## Options

This rule has no options.

## Further reading

- [Why does this rule exist?](https://stackoverflow.com/q/71559135)
8 changes: 3 additions & 5 deletions docs/rules/no-compat.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
# Avoid the `rxjs-compat` package (`no-compat`)
# Disallow the `rxjs-compat` package (`rxjs-x/no-compat`)

This rule prevents the use of `rxjs-compat`.
<!-- end auto-generated rule header -->

## Options

This rule has no options.
This rule prevents importing from locations that depend upon the `rxjs-compat` package.

## Further reading

Expand Down
8 changes: 4 additions & 4 deletions docs/rules/no-connectable.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Avoid connectable observables (`no-connectable`)
# Disallow operators that return connectable observables (`rxjs-x/no-connectable`)

This rule prevents the use of connectable observables.
💭 This rule requires [type information](https://typescript-eslint.io/linting/typed-linting).

## Options
<!-- end auto-generated rule header -->

This rule has no options.
This rule prevents the use of connectable observables.
12 changes: 7 additions & 5 deletions docs/rules/no-create.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
# Avoid the static `create` function (`no-create`)
# Disallow the static `Observable.create` function (`rxjs-x/no-create`)

💼 This rule is enabled in the ✅ `recommended` config.

💭 This rule requires [type information](https://typescript-eslint.io/linting/typed-linting).

<!-- end auto-generated rule header -->

This rule prevents the use of the static `create` function in `Observable`. Developers should use `new` and the constructor instead.

Expand All @@ -23,7 +29,3 @@ const answers = new Observable<number>(subscriber => {
subscriber.complete();
});
```

## Options

This rule has no options.
16 changes: 14 additions & 2 deletions docs/rules/no-cyclic-action.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# Avoid cyclic actions in effects and epics (`no-cyclic-action`)
# Disallow cyclic actions in effects and epics (`rxjs-x/no-cyclic-action`)

💭 This rule requires [type information](https://typescript-eslint.io/linting/typed-linting).

<!-- end auto-generated rule header -->

This rule effects failures for effects and epics that emit actions that would pass their `ofType` filter. Such actions are cyclic and, upon emission, immediately re-trigger the effect or epic.

Expand All @@ -22,7 +26,7 @@ actions.pipe(
);
```

This rule can be used with effects _and epics_, so it makes __no attempt__ to discern whether or not dispatching is disabled for an NgRx effect. That is, code like this will effect (🙈) a failure:
This rule can be used with effects _and epics_, so it makes **no attempt** to discern whether or not dispatching is disabled for an NgRx effect. That is, code like this will effect (🙈) a failure:

```ts
someEffect = createEffect(() =>
Expand Down Expand Up @@ -50,6 +54,14 @@ Or you can use an ESLint [inline comment](https://eslint.org/docs/user-guide/con

## Options

<!-- begin auto-generated rule options list -->

| Name | Type |
| :----------- | :----- |
| `observable` | String |

<!-- end auto-generated rule options list -->

This rule accepts a single option which is an object with an `observable` property that is a regular expression used to match an effect or epic's actions observable. The default `observable` regular expression should match most effect and epic action sources.

```json
Expand Down
8 changes: 3 additions & 5 deletions docs/rules/no-explicit-generics.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Avoid unnecessary explicit type arguments (`no-explicit-generics`)
# Disallow unnecessary explicit generic type arguments (`rxjs-x/no-explicit-generics`)

<!-- end auto-generated rule header -->

This rule prevents the use of explicit type arguments when the type arguments can be inferred.

Expand All @@ -17,7 +19,3 @@ Examples of **correct** code for this rule:
import { BehaviorSubject } from "rxjs";
const subject = new BehaviorSubject(42);
```

## Options

This rule has no options.
16 changes: 14 additions & 2 deletions docs/rules/no-exposed-subjects.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Avoid public and protected subjects (`no-exposed-subjects`)
# Disallow public and protected subjects (`rxjs-x/no-exposed-subjects`)

This rule prevents the public or protected subjects. Developers should instead expose observables via the subjects' `toObservable` method.
💭 This rule requires [type information](https://typescript-eslint.io/linting/typed-linting).

<!-- end auto-generated rule header -->

This rule prevents exposed (i.e. non-private) subjects. Developers should instead expose observables via the subjects' `toObservable` method.

## Rule details

Expand All @@ -27,6 +31,14 @@ class Answers {

## Options

<!-- begin auto-generated rule options list -->

| Name | Type |
| :--------------- | :------ |
| `allowProtected` | Boolean |

<!-- end auto-generated rule options list -->

This rule accepts a single option which is an object with an `allowProtected` property that determines whether or not protected subjects are allowed. By default, they are not.

```json
Expand Down
12 changes: 6 additions & 6 deletions docs/rules/no-finnish.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# Avoid Finnish notation (`no-finnish`)
# Disallow Finnish notation (`rxjs-x/no-finnish`)

💭 This rule requires [type information](https://typescript-eslint.io/linting/typed-linting).

<!-- end auto-generated rule header -->

This rule prevents the use of Finnish notation.

Expand All @@ -16,10 +20,6 @@ Examples of **correct** code for this rule:
const answers = of(42, 54);
```

## Options

This rule has no options.

## Further reading

- [Observables and Finnish Notation](https://medium.com/@benlesh/observables-and-finnish-notation-df8356ed1c9b)
- [Observables and Finnish Notation](https://medium.com/@benlesh/observables-and-finnish-notation-df8356ed1c9b)
10 changes: 5 additions & 5 deletions docs/rules/no-ignored-error.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# Enforce the passing of error handlers (`no-ignored-error`)
# Disallow calling `subscribe` without specifying an error handler (`rxjs-x/no-ignored-error`)

💭 This rule requires [type information](https://typescript-eslint.io/linting/typed-linting).

<!-- end auto-generated rule header -->

This rule enforces the passing of an error handler to `subscribe` calls.

Expand Down Expand Up @@ -31,7 +35,3 @@ source.subscribe({
error: (error) => console.error(error)
});
```

## Options

This rule has no options.
12 changes: 7 additions & 5 deletions docs/rules/no-ignored-notifier.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
# Ensure `repeatWhen` or `retryWhen` notifiers are used (`no-ignored-notifier`)
# Disallow observables not composed from the `repeatWhen` or `retryWhen` notifier (`rxjs-x/no-ignored-notifier`)

💼 This rule is enabled in the ✅ `recommended` config.

💭 This rule requires [type information](https://typescript-eslint.io/linting/typed-linting).

<!-- end auto-generated rule header -->

This rule effects failures if the notifier passed to a `repeatWhen` or `retryWhen` callback is not used.

Expand All @@ -24,7 +30,3 @@ const repeating = source.pipe(
repeatWhen(notifications => notifications.pipe(take(3)))
);
```

## Options

This rule has no options.
10 changes: 5 additions & 5 deletions docs/rules/no-ignored-observable.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# Use returned observables (`no-ignored-observable`)
# Disallow ignoring observables returned by functions (`rxjs-x/no-ignored-observable`)

💭 This rule requires [type information](https://typescript-eslint.io/linting/typed-linting).

<!-- end auto-generated rule header -->

The effects failures if an observable returned by a function is neither assigned to a variable or property or passed to a function.

Expand All @@ -17,7 +21,3 @@ Examples of **correct** code for this rule:
import { of } from "rxjs";
const answers = of(42, 54);
```

## Options

This rule has no options.
10 changes: 5 additions & 5 deletions docs/rules/no-ignored-replay-buffer.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# Avoid unbounded replay buffers (`no-ignored-replay-buffer`)
# Disallow using `ReplaySubject`, `publishReplay` or `shareReplay` without specifying the buffer size (`rxjs-x/no-ignored-replay-buffer`)

💼 This rule is enabled in the ✅ `recommended` config.

<!-- end auto-generated rule header -->

This rule effects failures if the buffer size of a replay buffer is not explicitly specified.

Expand All @@ -22,7 +26,3 @@ const subject = new ReplaySubject<number>(1);
import { ReplaySubject } from "rxjs";
const subject = new ReplaySubject<number>(Infinity);
```

## Options

This rule has no options.
10 changes: 5 additions & 5 deletions docs/rules/no-ignored-subscribe.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# Enforce the passing of handlers to `subscribe` (`no-ignored-subscribe`)
# Disallow calling `subscribe` without specifying arguments (`rxjs-x/no-ignored-subscribe`)

💭 This rule requires [type information](https://typescript-eslint.io/linting/typed-linting).

<!-- end auto-generated rule header -->

This rule effects failures whenever `subscribe` is called without handlers.

Expand All @@ -22,7 +26,3 @@ import { of } from "rxjs";

of(42, 54).subscribe((value) => console.log(value));
```

## Options

This rule has no options.
10 changes: 5 additions & 5 deletions docs/rules/no-ignored-subscription.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# Use returned subscriptions (`no-ignored-subscription`)
# Disallow ignoring the subscription returned by `subscribe` (`rxjs-x/no-ignored-subscription`)

💭 This rule requires [type information](https://typescript-eslint.io/linting/typed-linting).

<!-- end auto-generated rule header -->

The effects failures if an subscription returned by call to `subscribe` is neither assigned to a variable or property or passed to a function.

Expand Down Expand Up @@ -27,7 +31,3 @@ const numbers = new Observable<number>(subscriber => {
interval(1e3).subscribe(subscriber);
});
```

## Options

This rule has no options.
10 changes: 5 additions & 5 deletions docs/rules/no-ignored-takewhile-value.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# Avoid unused `takeWhile` values (`no-ignored-takewhile-value`)
# Disallow ignoring the value within `takeWhile` (`rxjs-x/no-ignored-takewhile-value`)

💼 This rule is enabled in the ✅ `recommended` config.

<!-- end auto-generated rule header -->

This rule effects failures if the value received by a `takeWhile` callback is not used in an expression.

Expand All @@ -20,7 +24,3 @@ import { takeWhile } from "rxjs/operators";

const whilst = source.pipe(takeWhile(value => value));
```

## Options

This rule has no options.
Loading