File tree Expand file tree Collapse file tree 3 files changed +49
-0
lines changed Expand file tree Collapse file tree 3 files changed +49
-0
lines changed Original file line number Diff line number Diff line change @@ -80,6 +80,7 @@ import { convertNoUnsafeFinally } from "./converters/no-unsafe-finally";
80
80
import { convertNoUseBeforeDeclare } from "./converters/no-use-before-declare" ;
81
81
import { convertNoVarKeyword } from "./converters/no-var-keyword" ;
82
82
import { convertNoVarRequires } from "./converters/no-var-requires" ;
83
+ import { convertNoVoidExpression } from "./converters/no-void-expression" ;
83
84
import { convertObjectLiteralKeyQuotes } from "./converters/object-literal-key-quotes" ;
84
85
import { convertObjectLiteralShorthand } from "./converters/object-literal-shorthand" ;
85
86
import { convertOneVariablePerDeclaration } from "./converters/one-variable-per-declaration" ;
@@ -168,6 +169,7 @@ export const converters = new Map([
168
169
[ "no-use-before-declare" , convertNoUseBeforeDeclare ] ,
169
170
[ "no-var-keyword" , convertNoVarKeyword ] ,
170
171
[ "no-var-requires" , convertNoVarRequires ] ,
172
+ [ "no-void-expression" , convertNoVoidExpression ] ,
171
173
[ "prefer-for-of" , convertPreferForOf ] ,
172
174
[ "prefer-object-spread" , convertPreferObjectSpread ] ,
173
175
[ "promise-function-async" , convertPromiseFunctionAsync ] ,
Original file line number Diff line number Diff line change
1
+ import { RuleConverter } from "../converter" ;
2
+
3
+ export const convertNoVoidExpression : RuleConverter = tslintRule => {
4
+ return {
5
+ rules : [
6
+ {
7
+ ...( tslintRule . ruleArguments . length > 0 &&
8
+ tslintRule . ruleArguments . includes ( "ignore-arrow-function-shorthand" ) && {
9
+ notices : [ "ESLint does not support ignoring arrow function shorthand." ] ,
10
+ } ) ,
11
+ ruleName : "no-void" ,
12
+ } ,
13
+ ] ,
14
+ } ;
15
+ } ;
Original file line number Diff line number Diff line change
1
+ import { convertNoVoidExpression } from "../no-void-expression" ;
2
+
3
+ describe ( convertNoVoidExpression , ( ) => {
4
+ test ( "conversion without arguments" , ( ) => {
5
+ const result = convertNoVoidExpression ( {
6
+ ruleArguments : [ ] ,
7
+ } ) ;
8
+
9
+ expect ( result ) . toEqual ( {
10
+ rules : [
11
+ {
12
+ ruleName : "no-void" ,
13
+ } ,
14
+ ] ,
15
+ } ) ;
16
+ } ) ;
17
+
18
+ test ( "conversion with ignore-arrow-function-shorthand argument" , ( ) => {
19
+ const result = convertNoVoidExpression ( {
20
+ ruleArguments : [ "ignore-arrow-function-shorthand" ] ,
21
+ } ) ;
22
+
23
+ expect ( result ) . toEqual ( {
24
+ rules : [
25
+ {
26
+ notices : [ "ESLint does not support ignoring arrow function shorthand." ] ,
27
+ ruleName : "no-void" ,
28
+ } ,
29
+ ] ,
30
+ } ) ;
31
+ } ) ;
32
+ } ) ;
You can’t perform that action at this time.
0 commit comments