Skip to content

Commit b09a098

Browse files
kbrillaKrzysztof BrillaJoshuaKGoldberg
authored
Adding the rule, mapping it and writing the tests (#800)
Co-authored-by: Krzysztof Brilla <brilla.krzysztof@gmail.com> Co-authored-by: Josh Goldberg <me@joshuakgoldberg.com>
1 parent 2e06429 commit b09a098

File tree

3 files changed

+32
-0
lines changed

3 files changed

+32
-0
lines changed

src/converters/lintConfigs/rules/ruleConverters.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@ 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 { convertNoUnboundMethods } from "./ruleConverters/eslint-plugin-rxjs/no-unbound-methods";
196197
import { convertNoUnsafeSubjectNext } from "./ruleConverters/eslint-plugin-rxjs/no-unsafe-subject-next";
197198

198199
/**
@@ -389,6 +390,7 @@ export const ruleConverters = new Map([
389390
["rxjs-no-nested-subscribe", convertNoNestedSubscribe],
390391
["rxjs-no-redundant-notify", convertNoRedundantNotify],
391392
["rxjs-no-sharereplay", convertNoShareReplay],
393+
["rxjs-no-unbound-methods", convertNoUnboundMethods],
392394
["rxjs-no-unsafe-subject-next", convertNoUnsafeSubjectNext],
393395

394396
// These converters are all for rules that need more complex option conversions.
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 convertNoUnboundMethods: RuleConverter = () => {
4+
return {
5+
rules: [
6+
{
7+
ruleName: "rxjs/no-unbound-methods",
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 { convertNoUnboundMethods } from "../no-unbound-methods";
2+
3+
describe(convertNoUnboundMethods, () => {
4+
test("conversion without arguments", () => {
5+
const result = convertNoUnboundMethods({
6+
ruleArguments: [],
7+
});
8+
9+
expect(result).toEqual({
10+
rules: [
11+
{
12+
ruleName: "rxjs/no-unbound-methods",
13+
},
14+
],
15+
plugins: ["eslint-plugin-rxjs"],
16+
});
17+
});
18+
});

0 commit comments

Comments
 (0)