File tree Expand file tree Collapse file tree 3 files changed +60
-0
lines changed Expand file tree Collapse file tree 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";
5656import { convertNoForIn } from "./converters/no-for-in" ;
5757import { convertNoForInArray } from "./converters/no-for-in-array" ;
5858import { convertNoImplicitDependencies } from "./converters/no-implicit-dependencies" ;
59+ import { convertNoImportSideEffect } from "./converters/no-import-side-effect" ;
5960import { convertNoInferrableTypes } from "./converters/no-inferrable-types" ;
6061import { convertNoInternalModule } from "./converters/no-internal-module" ;
6162import { convertNoInvalidRegexp } from "./converters/no-invalid-regexp" ;
@@ -189,6 +190,7 @@ export const converters = new Map([
189190 [ "no-for-in-array" , convertNoForInArray ] ,
190191 [ "no-implicit-dependencies" , convertNoImplicitDependencies ] ,
191192 [ "no-for-in" , convertNoForIn ] ,
193+ [ "no-import-side-effect" , convertNoImportSideEffect ] ,
192194 [ "no-inferrable-types" , convertNoInferrableTypes ] ,
193195 [ "no-internal-module" , convertNoInternalModule ] ,
194196 [ "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