File tree 3 files changed +48
-0
lines changed
3 files changed +48
-0
lines changed Original file line number Diff line number Diff line change @@ -38,6 +38,7 @@ import { convertNoConstantCondition } from "./converters/no-constant-condition";
38
38
import { convertNoConstruct } from "./converters/no-construct" ;
39
39
import { convertNoControlRegex } from "./converters/no-control-regex" ;
40
40
import { convertNoDebugger } from "./converters/no-debugger" ;
41
+ import { convertNoDuplicateImports } from "./converters/no-duplicate-imports" ;
41
42
import { convertNoDuplicateSuper } from "./converters/no-duplicate-super" ;
42
43
import { convertNoDuplicateSwitchCase } from "./converters/no-duplicate-switch-case" ;
43
44
import { convertNoEmpty } from "./converters/no-empty" ;
@@ -140,6 +141,7 @@ export const converters = new Map([
140
141
[ "no-conditional-assignment" , convertNoConditionalAssignment ] ,
141
142
[ "no-construct" , convertNoConstruct ] ,
142
143
[ "no-debugger" , convertNoDebugger ] ,
144
+ [ "no-duplicate-imports" , convertNoDuplicateImports ] ,
143
145
[ "no-duplicate-super" , convertNoDuplicateSuper ] ,
144
146
[ "no-duplicate-switch-case" , convertNoDuplicateSwitchCase ] ,
145
147
[ "no-empty-interface" , convertNoEmptyInterface ] ,
Original file line number Diff line number Diff line change
1
+ import { RuleConverter } from "../converter" ;
2
+
3
+ export const convertNoDuplicateImports : RuleConverter = tslintRule => {
4
+ return {
5
+ rules : [
6
+ {
7
+ ...( tslintRule . ruleArguments . includes ( "allow-namespace-imports" ) && {
8
+ notices : [ "ESLint does not support optional config allow-namespace-imports." ] ,
9
+ } ) ,
10
+ ruleName : "no-duplicate-imports" ,
11
+ } ,
12
+ ] ,
13
+ } ;
14
+ } ;
Original file line number Diff line number Diff line change
1
+ import { convertNoDuplicateImports } from "../no-duplicate-imports" ;
2
+
3
+ describe ( convertNoDuplicateImports , ( ) => {
4
+ test ( "conversion without arguments" , ( ) => {
5
+ const result = convertNoDuplicateImports ( {
6
+ ruleArguments : [ ] ,
7
+ } ) ;
8
+
9
+ expect ( result ) . toEqual ( {
10
+ rules : [
11
+ {
12
+ ruleName : "no-duplicate-imports" ,
13
+ } ,
14
+ ] ,
15
+ } ) ;
16
+ } ) ;
17
+
18
+ test ( "conversion with allow-namespace-imports argument" , ( ) => {
19
+ const result = convertNoDuplicateImports ( {
20
+ ruleArguments : [ "allow-namespace-imports" ] ,
21
+ } ) ;
22
+
23
+ expect ( result ) . toEqual ( {
24
+ rules : [
25
+ {
26
+ notices : [ "ESLint does not support optional config allow-namespace-imports." ] ,
27
+ ruleName : "no-duplicate-imports" ,
28
+ } ,
29
+ ] ,
30
+ } ) ;
31
+ } ) ;
32
+ } ) ;
You can’t perform that action at this time.
0 commit comments