File tree Expand file tree Collapse file tree 3 files changed +51
-0
lines changed
src/converters/lintConfigs/rules
ruleConverters/eslint-plugin-rxjs Expand file tree Collapse file tree 3 files changed +51
-0
lines changed Original file line number Diff line number Diff line change @@ -185,6 +185,7 @@ import { convertJsxWrapMultiline } from "./ruleConverters/eslint-plugin-react/js
185
185
186
186
// eslint-plugin-rxjs converters
187
187
import { convertNoAsyncSubscribe } from "./ruleConverters/eslint-plugin-rxjs/no-async-subscribe" ;
188
+ import { convertNoImplicitAnyCatch } from "./ruleConverters/eslint-plugin-rxjs/no-implicit-any-catch" ;
188
189
import { convertNoCreate } from "./ruleConverters/eslint-plugin-rxjs/no-create" ;
189
190
import { convertNoIgnoredNotifier } from "./ruleConverters/eslint-plugin-rxjs/no-ignored-notifier" ;
190
191
import { convertNoIgnoredReplayBuffer } from "./ruleConverters/eslint-plugin-rxjs/no-ignored-replay-buffer" ;
@@ -385,6 +386,7 @@ export const ruleConverters = new Map([
385
386
[ "use-pipe-transform-interface" , convertUsePipeTransformInterface ] ,
386
387
[ "variable-name" , convertVariableName ] ,
387
388
[ "rxjs-no-async-subscribe" , convertNoAsyncSubscribe ] ,
389
+ [ "rxjs-no-implicit-any-catch" , convertNoImplicitAnyCatch ] ,
388
390
[ "rxjs-no-create" , convertNoCreate ] ,
389
391
[ "rxjs-no-ignored-notifier" , convertNoIgnoredNotifier ] ,
390
392
[ "rxjs-no-ignored-replay-buffer" , convertNoIgnoredReplayBuffer ] ,
Original file line number Diff line number Diff line change
1
+ import { RuleConverter } from "../../ruleConverter" ;
2
+
3
+ export const convertNoImplicitAnyCatch : RuleConverter = ( tslintRule ) => {
4
+ return {
5
+ rules : [
6
+ {
7
+ ...( tslintRule . ruleArguments . length !== 0 && {
8
+ ruleArguments : tslintRule . ruleArguments ,
9
+ } ) ,
10
+ ruleName : "rxjs/no-implicit-any-catch" ,
11
+ } ,
12
+ ] ,
13
+ plugins : [ "eslint-plugin-rxjs" ] ,
14
+ } ;
15
+ } ;
Original file line number Diff line number Diff line change
1
+ import { convertNoImplicitAnyCatch } from "../no-implicit-any-catch" ;
2
+
3
+ describe ( convertNoImplicitAnyCatch , ( ) => {
4
+ test ( "conversion without arguments" , ( ) => {
5
+ const result = convertNoImplicitAnyCatch ( {
6
+ ruleArguments : [ ] ,
7
+ } ) ;
8
+
9
+ expect ( result ) . toEqual ( {
10
+ rules : [
11
+ {
12
+ ruleName : "rxjs/no-implicit-any-catch" ,
13
+ } ,
14
+ ] ,
15
+ plugins : [ "eslint-plugin-rxjs" ] ,
16
+ } ) ;
17
+ } ) ;
18
+
19
+ test ( "conversion with allowExplicitAny argument" , ( ) => {
20
+ const result = convertNoImplicitAnyCatch ( {
21
+ ruleArguments : [ { allowExplicitAny : true } ] ,
22
+ } ) ;
23
+
24
+ expect ( result ) . toEqual ( {
25
+ rules : [
26
+ {
27
+ ruleName : "rxjs/no-implicit-any-catch" ,
28
+ ruleArguments : [ { allowExplicitAny : true } ] ,
29
+ } ,
30
+ ] ,
31
+ plugins : [ "eslint-plugin-rxjs" ] ,
32
+ } ) ;
33
+ } ) ;
34
+ } ) ;
You can’t perform that action at this time.
0 commit comments