Skip to content

Commit 4463111

Browse files
kbrillaKrzysztof BrillaJoshuaKGoldberg
authored
rxjs-no-subject-value (#801)
* Adding the rule, mapping it and writing the tests * Missing imports post merge Co-authored-by: Krzysztof Brilla <brilla.krzysztof@gmail.com> Co-authored-by: Josh Goldberg <me@joshuakgoldberg.com>
1 parent b09a098 commit 4463111

File tree

3 files changed

+32
-1
lines changed

3 files changed

+32
-1
lines changed

src/converters/lintConfigs/rules/ruleConverters.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,11 +193,11 @@ import { convertNoInternal } from "./ruleConverters/eslint-plugin-rxjs/no-intern
193193
import { convertNoNestedSubscribe } from "./ruleConverters/eslint-plugin-rxjs/no-nested-subscribe";
194194
import { convertNoRedundantNotify } from "./ruleConverters/eslint-plugin-rxjs/no-redundant-notify";
195195
import { convertNoShareReplay } from "./ruleConverters/eslint-plugin-rxjs/no-sharereplay";
196+
import { convertNoSubjectValue } from "./ruleConverters/eslint-plugin-rxjs/no-subject-value";
196197
import { convertNoUnboundMethods } from "./ruleConverters/eslint-plugin-rxjs/no-unbound-methods";
197198
import { convertNoUnsafeSubjectNext } from "./ruleConverters/eslint-plugin-rxjs/no-unsafe-subject-next";
198199

199200
/**
200-
* Keys TSLint rule names to their ESLint rule converters.
201201
*/
202202
export const ruleConverters = new Map([
203203
["adjacent-overload-signatures", convertAdjacentOverloadSignatures],
@@ -390,6 +390,7 @@ export const ruleConverters = new Map([
390390
["rxjs-no-nested-subscribe", convertNoNestedSubscribe],
391391
["rxjs-no-redundant-notify", convertNoRedundantNotify],
392392
["rxjs-no-sharereplay", convertNoShareReplay],
393+
["rxjs-no-subject-value", convertNoSubjectValue],
393394
["rxjs-no-unbound-methods", convertNoUnboundMethods],
394395
["rxjs-no-unsafe-subject-next", convertNoUnsafeSubjectNext],
395396

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { RuleConverter } from "../../ruleConverter";
2+
3+
export const convertNoSubjectValue: RuleConverter = () => {
4+
return {
5+
rules: [
6+
{
7+
ruleName: "rxjs/no-subject-value",
8+
},
9+
],
10+
plugins: ["eslint-plugin-rxjs"],
11+
};
12+
};
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { convertNoSubjectValue } from "../no-subject-value";
2+
3+
describe(convertNoSubjectValue, () => {
4+
test("conversion without arguments", () => {
5+
const result = convertNoSubjectValue({
6+
ruleArguments: [],
7+
});
8+
9+
expect(result).toEqual({
10+
rules: [
11+
{
12+
ruleName: "rxjs/no-subject-value",
13+
},
14+
],
15+
plugins: ["eslint-plugin-rxjs"],
16+
});
17+
});
18+
});

0 commit comments

Comments
 (0)