Skip to content
This repository was archived by the owner on Mar 10, 2021. It is now read-only.

Commit 349e62d

Browse files
authored
Merge pull request #2 from henrikra/master
Simplify import statement removing
2 parents d485571 + 5701360 commit 349e62d

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

lib/index.js

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,11 @@ module.exports = function (babel) {
33

44
return {
55
visitor: {
6-
ImportDeclaration (path, state) {
7-
// -=-=-=-=-=-=-=-=-=-=-=-=-=
8-
// nuke all import statements with the word reactotron (including our ReactotronConfig)
9-
// -=-=-=-=-=-=-=-=-=-=-=-=-=
10-
const value = path.node.source.value
11-
if (
12-
value &&
13-
value.toLowerCase &&
14-
value.toLowerCase().indexOf('reactotron') >= 0
15-
) {
6+
ImportDeclaration(path) {
7+
if (path.node.source.value.toLowerCase().includes('reactotron')) {
168
path.remove()
179
}
18-
}, // ImportDeclaration
10+
},
1911

2012
CallExpression (path, state) {
2113
// -=-=-=-=-=-=-=-=-=-=-=-=-=

0 commit comments

Comments
 (0)