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";
4545import { convertNoDuplicateImports } from "./converters/no-duplicate-imports" ;
4646import { convertNoDuplicateSuper } from "./converters/no-duplicate-super" ;
4747import { convertNoDuplicateSwitchCase } from "./converters/no-duplicate-switch-case" ;
48+ import { convertNoDuplicateVariable } from "./converters/no-duplicate-variable" ;
4849import { convertNoEmpty } from "./converters/no-empty" ;
4950import { convertNoEmptyInterface } from "./converters/no-empty-interface" ;
5051import { convertNoEval } from "./converters/no-eval" ;
@@ -172,6 +173,7 @@ export const converters = new Map([
172173 [ "no-duplicate-imports" , convertNoDuplicateImports ] ,
173174 [ "no-duplicate-super" , convertNoDuplicateSuper ] ,
174175 [ "no-duplicate-switch-case" , convertNoDuplicateSwitchCase ] ,
176+ [ "no-duplicate-variable" , convertNoDuplicateVariable ] ,
175177 [ "no-empty-interface" , convertNoEmptyInterface ] ,
176178 [ "no-empty" , convertNoEmpty ] ,
177179 [ "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