File tree 3 files changed +60
-0
lines changed
3 files changed +60
-0
lines changed Original file line number Diff line number Diff line change @@ -56,6 +56,7 @@ import { convertNoFloatingPromises } from "./converters/no-floating-promises";
56
56
import { convertNoForIn } from "./converters/no-for-in" ;
57
57
import { convertNoForInArray } from "./converters/no-for-in-array" ;
58
58
import { convertNoImplicitDependencies } from "./converters/no-implicit-dependencies" ;
59
+ import { convertNoImportSideEffect } from "./converters/no-import-side-effect" ;
59
60
import { convertNoInferrableTypes } from "./converters/no-inferrable-types" ;
60
61
import { convertNoInternalModule } from "./converters/no-internal-module" ;
61
62
import { convertNoInvalidRegexp } from "./converters/no-invalid-regexp" ;
@@ -189,6 +190,7 @@ export const converters = new Map([
189
190
[ "no-for-in-array" , convertNoForInArray ] ,
190
191
[ "no-implicit-dependencies" , convertNoImplicitDependencies ] ,
191
192
[ "no-for-in" , convertNoForIn ] ,
193
+ [ "no-import-side-effect" , convertNoImportSideEffect ] ,
192
194
[ "no-inferrable-types" , convertNoInferrableTypes ] ,
193
195
[ "no-internal-module" , convertNoInternalModule ] ,
194
196
[ "no-invalid-regexp" , convertNoInvalidRegexp ] ,
Original file line number Diff line number Diff line change
1
+ import { RuleConverter } from "../converter" ;
2
+
3
+ export const convertNoImportSideEffect : RuleConverter = tsLintRule => {
4
+ const notices = [ ] ;
5
+
6
+ if ( tsLintRule . ruleArguments . length > 0 ) {
7
+ notices . push (
8
+ "ESLint's no-import-side-effect now accepts a glob pattern for ignores; you'll need to manually convert your ignore-module settings." ,
9
+ ) ;
10
+ }
11
+
12
+ return {
13
+ rules : [
14
+ {
15
+ ruleArguments : [ ] ,
16
+ ruleName : "no-import-side-effect" ,
17
+ notices : notices ,
18
+ } ,
19
+ ] ,
20
+ } ;
21
+ } ;
Original file line number Diff line number Diff line change
1
+ import { convertNoImportSideEffect } from "../no-import-side-effect" ;
2
+
3
+ describe ( convertNoImportSideEffect , ( ) => {
4
+ test ( "conversion without arguments" , ( ) => {
5
+ const result = convertNoImportSideEffect ( {
6
+ ruleArguments : [ ] ,
7
+ } ) ;
8
+
9
+ expect ( result ) . toEqual ( {
10
+ rules : [
11
+ {
12
+ ruleArguments : [ ] ,
13
+ ruleName : "no-import-side-effect" ,
14
+ notices : [ ] ,
15
+ } ,
16
+ ] ,
17
+ } ) ;
18
+ } ) ;
19
+
20
+ test ( "conversion with arguments" , ( ) => {
21
+ const result = convertNoImportSideEffect ( {
22
+ ruleArguments : [ true , { "ignore-module" : "(\\.html|\\.css)$" } ] ,
23
+ } ) ;
24
+
25
+ expect ( result ) . toEqual ( {
26
+ rules : [
27
+ {
28
+ ruleArguments : [ ] ,
29
+ ruleName : "no-import-side-effect" ,
30
+ notices : [
31
+ "ESLint's no-import-side-effect now accepts a glob pattern for ignores; you'll need to manually convert your ignore-module settings." ,
32
+ ] ,
33
+ } ,
34
+ ] ,
35
+ } ) ;
36
+ } ) ;
37
+ } ) ;
You can’t perform that action at this time.
0 commit comments