File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1717 "test" : " qunit tests/**/*-test.js"
1818 },
1919 "dependencies" : {
20- "@babel/parser" : " ^7.0.0-beta.51 " ,
20+ "@babel/parser" : " ^7.0.0-beta.53 " ,
2121 "chalk" : " ^2.4.1" ,
2222 "common-tags" : " ^1.8.0" ,
2323 "execa" : " ^0.10.0" ,
Original file line number Diff line number Diff line change 22
33function getJSCodeshiftParser ( api ) {
44 try {
5- let parser = require ( 'recast/parsers/typescript' ) ;
5+ // this is bad, but works around a bug in recent @babel/parser versions:
6+ let babelParser = require ( '@babel/parser' ) ;
7+ let parser = {
8+ parse ( source , _options ) {
9+ let options = require ( 'recast/parsers/_babylon_options' ) ( _options ) ;
10+ options . plugins = options . plugins . filter ( plugin => plugin !== 'pipelineOperator' ) ;
11+ options . plugins . push ( [ 'pipelineOperator' , { proposal : 'minimal' } ] ) ;
12+ options . plugins . push ( 'typescript' ) ;
13+
14+ return babelParser . parse ( source , options ) ;
15+ } ,
16+ } ;
17+
18+ // the above should be replace with the following (once
19+ // https://github.com/benjamn/recast/pull/521 lands in a release):
20+ // let parser = require('recast/parsers/typescript');
621
722 return api . jscodeshift . withParser ( parser ) ;
823 } catch ( e ) {
Original file line number Diff line number Diff line change 1717 js-tokens "^3.0.0"
1818
1919" @babel/parser@^7.0.0-beta.51 " :
20- version "7.0.0-beta.51 "
21- resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.0.0-beta.51 .tgz#27cec2df409df60af58270ed8f6aa55409ea86f6 "
20+ version "7.0.0-beta.53 "
21+ resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.0.0-beta.53 .tgz#1f45eb617bf9463d482b2c04d349d9e4edbf4892 "
2222
2323" @mrmlnc/readdir-enhanced@^2.2.1 " :
2424 version "2.2.1"
You can’t perform that action at this time.
0 commit comments