File tree 5 files changed +1237
-0
lines changed
5 files changed +1237
-0
lines changed Original file line number Diff line number Diff line change
1
+ {
2
+ "plugins" : [" ./index.js" ]
3
+ }
Original file line number Diff line number Diff line change
1
+ const transformer = function ( babel ) {
2
+ return {
3
+ visitor : {
4
+ Identifier : function ( path , state ) {
5
+ if ( path . node . name === 'log' ) {
6
+ if ( path . parent . object . name === 'console' ) {
7
+ const args = path . parentPath . parentPath . node . arguments ;
8
+ console . log ( args ) ;
9
+ }
10
+ }
11
+ }
12
+ }
13
+ }
14
+
15
+ }
16
+
17
+ module . exports = transformer ;
Original file line number Diff line number Diff line change
1
+ {
2
+ "name" : " y" ,
3
+ "version" : " y" ,
4
+ "description" : " Babel plugin to log the names of variables when used for debugging" ,
5
+ "main" : " y" ,
6
+ "author" : " Kashyap Kondamudi" ,
7
+ "license" : " MIT" ,
8
+ "dependencies" : {
9
+ "babel-cli" : " ^6.26.0" ,
10
+ "babel-core" : " ^6.26.0"
11
+ },
12
+ "scripts" : {
13
+ "debug" : " babel-node --inspect test.js" ,
14
+ "test" : " babel-node test.js"
15
+ }
16
+ }
Original file line number Diff line number Diff line change
1
+ const a = 12 ;
2
+ const b = 144 ;
3
+ console . log ( a , b ) ;
You can’t perform that action at this time.
0 commit comments