File tree Expand file tree Collapse file tree 3 files changed +59
-0
lines changed
src/converters/lintConfigs/rules
ruleConverters/eslint-plugin-rxjs Expand file tree Collapse file tree 3 files changed +59
-0
lines changed Original file line number Diff line number Diff line change @@ -187,6 +187,7 @@ import { convertJsxWrapMultiline } from "./ruleConverters/eslint-plugin-react/js
187
187
import { convertNoAsyncSubscribe } from "./ruleConverters/eslint-plugin-rxjs/no-async-subscribe" ;
188
188
import { convertNoIgnoredReplayBuffer } from "./ruleConverters/eslint-plugin-rxjs/no-ignored-replay-buffer" ;
189
189
import { convertNoRedundantNotify } from "./ruleConverters/eslint-plugin-rxjs/no-redundant-notify" ;
190
+ import { convertNoShareReplay } from "./ruleConverters/eslint-plugin-rxjs/no-sharereplay" ;
190
191
import { convertNoUnsafeSubjectNext } from "./ruleConverters/eslint-plugin-rxjs/no-unsafe-subject-next" ;
191
192
192
193
/**
@@ -377,6 +378,7 @@ export const ruleConverters = new Map([
377
378
[ "rxjs-no-async-subscribe" , convertNoAsyncSubscribe ] ,
378
379
[ "rxjs-no-ignored-replay-buffer" , convertNoIgnoredReplayBuffer ] ,
379
380
[ "rxjs-no-redundant-notify" , convertNoRedundantNotify ] ,
381
+ [ "rxjs-no-sharereplay" , convertNoShareReplay ] ,
380
382
[ "rxjs-no-unsafe-subject-next" , convertNoUnsafeSubjectNext ] ,
381
383
382
384
// These converters are all for rules that need more complex option conversions.
Original file line number Diff line number Diff line change
1
+ import { RuleConverter } from "../../ruleConverter" ;
2
+
3
+ export const convertNoShareReplay : RuleConverter = ( tslintRule ) => {
4
+ return {
5
+ rules : [
6
+ {
7
+ ...( tslintRule . ruleArguments . length !== 0 && {
8
+ ruleArguments : tslintRule . ruleArguments ,
9
+ } ) ,
10
+ ruleName : "rxjs/no-sharereplay" ,
11
+ } ,
12
+ ] ,
13
+ plugins : [ "eslint-plugin-rxjs" ] ,
14
+ } ;
15
+ } ;
Original file line number Diff line number Diff line change
1
+ import { convertNoShareReplay } from "../no-sharereplay" ;
2
+
3
+ describe ( convertNoShareReplay , ( ) => {
4
+ test ( "conversion without arguments" , ( ) => {
5
+ const result = convertNoShareReplay ( {
6
+ ruleArguments : [ ] ,
7
+ } ) ;
8
+
9
+ expect ( result ) . toEqual ( {
10
+ rules : [
11
+ {
12
+ ruleName : "rxjs/no-sharereplay" ,
13
+ } ,
14
+ ] ,
15
+ plugins : [ "eslint-plugin-rxjs" ] ,
16
+ } ) ;
17
+ } ) ;
18
+
19
+ test ( "conversion without arguments" , ( ) => {
20
+ const result = convertNoShareReplay ( {
21
+ ruleArguments : [
22
+ {
23
+ allowConfig : true ,
24
+ } ,
25
+ ] ,
26
+ } ) ;
27
+
28
+ expect ( result ) . toEqual ( {
29
+ rules : [
30
+ {
31
+ ruleName : "rxjs/no-sharereplay" ,
32
+ ruleArguments : [
33
+ {
34
+ allowConfig : true ,
35
+ } ,
36
+ ] ,
37
+ } ,
38
+ ] ,
39
+ plugins : [ "eslint-plugin-rxjs" ] ,
40
+ } ) ;
41
+ } ) ;
42
+ } ) ;
You can’t perform that action at this time.
0 commit comments