File tree Expand file tree Collapse file tree 3 files changed +48
-0
lines changed Expand file tree Collapse file tree 3 files changed +48
-0
lines changed Original file line number Diff line number Diff line change @@ -45,6 +45,7 @@ import { convertNoDefaultExport } from "./converters/no-default-export";
45
45
import { convertNoDuplicateImports } from "./converters/no-duplicate-imports" ;
46
46
import { convertNoDuplicateSuper } from "./converters/no-duplicate-super" ;
47
47
import { convertNoDuplicateSwitchCase } from "./converters/no-duplicate-switch-case" ;
48
+ import { convertNoDuplicateVariable } from "./converters/no-duplicate-variable" ;
48
49
import { convertNoEmpty } from "./converters/no-empty" ;
49
50
import { convertNoEmptyInterface } from "./converters/no-empty-interface" ;
50
51
import { convertNoEval } from "./converters/no-eval" ;
@@ -172,6 +173,7 @@ export const converters = new Map([
172
173
[ "no-duplicate-imports" , convertNoDuplicateImports ] ,
173
174
[ "no-duplicate-super" , convertNoDuplicateSuper ] ,
174
175
[ "no-duplicate-switch-case" , convertNoDuplicateSwitchCase ] ,
176
+ [ "no-duplicate-variable" , convertNoDuplicateVariable ] ,
175
177
[ "no-empty-interface" , convertNoEmptyInterface ] ,
176
178
[ "no-empty" , convertNoEmpty ] ,
177
179
[ "no-eval" , convertNoEval ] ,
Original file line number Diff line number Diff line change
1
+ import { RuleConverter } from "../converter" ;
2
+
3
+ export const convertNoDuplicateVariable : RuleConverter = tslintRule => {
4
+ return {
5
+ rules : [
6
+ {
7
+ ...( tslintRule . ruleArguments . includes ( "check-parameters" ) && {
8
+ notices : [ "ESLint does not support check-parameters." ] ,
9
+ } ) ,
10
+ ruleName : "no-redeclare" ,
11
+ } ,
12
+ ] ,
13
+ } ;
14
+ } ;
Original file line number Diff line number Diff line change
1
+ import { convertNoDuplicateVariable } from "../no-duplicate-variable" ;
2
+
3
+ describe ( convertNoDuplicateVariable , ( ) => {
4
+ test ( "conversion without arguments" , ( ) => {
5
+ const result = convertNoDuplicateVariable ( {
6
+ ruleArguments : [ ] ,
7
+ } ) ;
8
+
9
+ expect ( result ) . toEqual ( {
10
+ rules : [
11
+ {
12
+ ruleName : "no-redeclare" ,
13
+ } ,
14
+ ] ,
15
+ } ) ;
16
+ } ) ;
17
+
18
+ test ( "conversion with check parameters argument" , ( ) => {
19
+ const result = convertNoDuplicateVariable ( {
20
+ ruleArguments : [ "check-parameters" ] ,
21
+ } ) ;
22
+
23
+ expect ( result ) . toEqual ( {
24
+ rules : [
25
+ {
26
+ ruleName : "no-redeclare" ,
27
+ notices : [ "ESLint does not support check-parameters." ] ,
28
+ } ,
29
+ ] ,
30
+ } ) ;
31
+ } ) ;
32
+ } ) ;
You can’t perform that action at this time.
0 commit comments