Skip to content

Commit 56200c3

Browse files
refactor: rename to no-unnecessary-collection
1 parent 5d8ea43 commit 56200c3

File tree

6 files changed

+17
-17
lines changed

6 files changed

+17
-17
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ The package includes the following rules.
146146
| [no-tap](docs/rules/no-tap.md) | Disallow the `tap` operator. | | | | ||
147147
| [no-topromise](docs/rules/no-topromise.md) | Disallow use of the `toPromise` method. | ✅ 🔒 | | 💡 | 💭 | |
148148
| [no-unbound-methods](docs/rules/no-unbound-methods.md) | Disallow passing unbound methods. | ✅ 🔒 | | | 💭 | |
149-
| [no-unnecessary-combine](docs/rules/no-unnecessary-combine.md) | Disallow unnecessary usage of combining operators with single values. | 🔒 | | | | |
149+
| [no-unnecessary-collection](docs/rules/no-unnecessary-collection.md) | Disallow unnecessary usage of collection arguments with single values. | 🔒 | | | | |
150150
| [no-unsafe-catch](docs/rules/no-unsafe-catch.md) | Disallow unsafe `catchError` usage in effects and epics. | | | | 💭 | |
151151
| [no-unsafe-first](docs/rules/no-unsafe-first.md) | Disallow unsafe `first`/`take` usage in effects and epics. | | | | 💭 | |
152152
| [no-unsafe-subject-next](docs/rules/no-unsafe-subject-next.md) | Disallow unsafe optional `next` calls. | ✅ 🔒 | | | 💭 | |

docs/rules/no-unnecessary-combine.md renamed to docs/rules/no-unnecessary-collection.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
# Disallow unnecessary usage of combining operators with single values (`rxjs-x/no-unnecessary-combine`)
1+
# Disallow unnecessary usage of collection arguments with single values (`rxjs-x/no-unnecessary-collection`)
22

33
💼 This rule is enabled in the 🔒 `strict` config.
44

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

7-
This rule effects failures when static observable creators that accept multiple observables
8-
(`combineLatest`, `forkJoin`, `merge`, `zip`, `concat`, `race`)
9-
are passed only a single observable.
7+
This rule effects failures when passing a collection (object or array) containing a single observable
8+
to the static observable creators that accept multiple observables
9+
(`combineLatest`, `forkJoin`, `merge`, `zip`, `concat`, `race`).
1010
Use of these creator functions with only a single observable
11-
can be replace with direct usage of the observable itself.
11+
can be replaced with direct usage of the observable itself.
1212

1313
## Rule details
1414

@@ -50,10 +50,10 @@ const h$ = of(1);
5050

5151
## When Not To Use It
5252

53-
If you don't care about unnecessary use of static observable creators,
53+
If you don't care about unnecessary usage of static observable creators,
5454
then you don't need this rule.
5555

5656
## Resources
5757

58-
- [Rule source](/src/rules/no-unnecessary-combine.ts)
59-
- [Test source](/tests/rules/no-unnecessary-combine.test.ts)
58+
- [Rule source](/src/rules/no-unnecessary-collection.ts)
59+
- [Test source](/tests/rules/no-unnecessary-collection.test.ts)

src/configs/strict.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export const createStrictConfig = (
3232
'rxjs-x/no-subscribe-in-pipe': 'error',
3333
'rxjs-x/no-topromise': 'error',
3434
'rxjs-x/no-unbound-methods': 'error',
35-
'rxjs-x/no-unnecessary-combine': 'error',
35+
'rxjs-x/no-unnecessary-collection': 'error',
3636
'rxjs-x/no-unsafe-subject-next': 'error',
3737
'rxjs-x/no-unsafe-takeuntil': 'error',
3838
'rxjs-x/prefer-observer': 'error',

src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ import { noSubscribeInPipeRule } from './rules/no-subscribe-in-pipe';
4040
import { noTapRule } from './rules/no-tap';
4141
import { noTopromiseRule } from './rules/no-topromise';
4242
import { noUnboundMethodsRule } from './rules/no-unbound-methods';
43-
import { noUnnecessaryCombineRule } from './rules/no-unnecessary-combine';
43+
import { noUnnecessaryCollectionRule } from './rules/no-unnecessary-collection';
4444
import { noUnsafeCatchRule } from './rules/no-unsafe-catch';
4545
import { noUnsafeFirstRule } from './rules/no-unsafe-first';
4646
import { noUnsafeSubjectNext } from './rules/no-unsafe-subject-next';
@@ -88,7 +88,7 @@ const allRules = {
8888
'no-tap': noTapRule,
8989
'no-topromise': noTopromiseRule,
9090
'no-unbound-methods': noUnboundMethodsRule,
91-
'no-unnecessary-combine': noUnnecessaryCombineRule,
91+
'no-unnecessary-collection': noUnnecessaryCollectionRule,
9292
'no-unsafe-catch': noUnsafeCatchRule,
9393
'no-unsafe-first': noUnsafeFirstRule,
9494
'no-unsafe-subject-next': noUnsafeSubjectNext,

src/rules/no-unnecessary-combine.ts renamed to src/rules/no-unnecessary-collection.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ import { MULTIPLE_OBSERVABLE_ACCEPTING_STATIC_OBSERVABLE_CREATORS, SOURCES_OBJEC
55
import { getTypeServices, isArrayExpression, isObjectExpression, isProperty } from '../etc';
66
import { ruleCreator } from '../utils';
77

8-
export const noUnnecessaryCombineRule = ruleCreator({
8+
export const noUnnecessaryCollectionRule = ruleCreator({
99
defaultOptions: [],
1010
meta: {
1111
docs: {
12-
description: 'Disallow unnecessary usage of combining operators with single values.',
12+
description: 'Disallow unnecessary usage of collection arguments with single values.',
1313
recommended: 'strict',
1414
requiresTypeChecking: false,
1515
},
@@ -19,7 +19,7 @@ export const noUnnecessaryCombineRule = ruleCreator({
1919
schema: [],
2020
type: 'suggestion',
2121
},
22-
name: 'no-unnecessary-combine',
22+
name: 'no-unnecessary-collection',
2323
create: (context) => {
2424
const { couldBeType, couldBeObservable } = getTypeServices(context);
2525

tests/rules/no-unnecessary-combine.test.ts renamed to tests/rules/no-unnecessary-collection.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { stripIndent } from 'common-tags';
2-
import { noUnnecessaryCombineRule } from '../../src/rules/no-unnecessary-combine';
2+
import { noUnnecessaryCollectionRule } from '../../src/rules/no-unnecessary-collection';
33
import { fromFixture } from '../etc';
44
import { ruleTester } from '../rule-tester';
55

6-
ruleTester({ types: true }).run('no-unnecessary-combine', noUnnecessaryCombineRule, {
6+
ruleTester({ types: true }).run('no-unnecessary-collection', noUnnecessaryCollectionRule, {
77
valid: [
88
// #region valid; multiple observables in array
99
stripIndent`

0 commit comments

Comments
 (0)