File tree Expand file tree Collapse file tree 2 files changed +4
-5
lines changed Expand file tree Collapse file tree 2 files changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ const smartGlob = require('../smart_glob.js');
88
99const STANDARD_BABEL_CONFIG = {
1010 compact : false ,
11- parserOpts : { plugins : [ ...standardBabelParserPlugins , 'flow' ] }
11+ parserOpts : { plugins : [ ...standardBabelParserPlugins , 'flow' , 'jsx' ] }
1212} ;
1313
1414/**
Original file line number Diff line number Diff line change @@ -2,8 +2,8 @@ const babelParser = require('@babel/parser');
22const path = require ( 'path' ) ;
33
44const TYPESCRIPT_EXTS = {
5- '.ts' : true ,
6- '.tsx' : true
5+ '.ts' : [ 'typescript' ] ,
6+ '.tsx' : [ 'typescript' , 'jsx' ]
77} ;
88
99const standardBabelParserPlugins = [
@@ -14,7 +14,6 @@ const standardBabelParserPlugins = [
1414 'exportDefaultFrom' ,
1515 'exportExtensions' ,
1616 'functionBind' ,
17- 'jsx' ,
1817 'partialApplication' ,
1918 [ 'pipelineOperator' , { proposal : 'minimal' } ] ,
2019 'throwExpressions'
@@ -29,7 +28,7 @@ function getParserOpts(file) {
2928 plugins : [
3029 ...standardBabelParserPlugins ,
3130 [ 'decorators' , { decoratorsBeforeExport : false } ] ,
32- TYPESCRIPT_EXTS [ path . extname ( file || '' ) ] ? 'typescript' : 'flow'
31+ ... ( TYPESCRIPT_EXTS [ path . extname ( file || '' ) ] || [ 'flow' , 'jsx' ] )
3332 ]
3433 } ;
3534}
You can’t perform that action at this time.
0 commit comments