-
Notifications
You must be signed in to change notification settings - Fork 481
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Brie
committed
Nov 18, 2018
1 parent
595b15c
commit f51472c
Showing
6 changed files
with
91 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/* | ||
* Copyright (c) 2015-present, Facebook, Inc. | ||
* All rights reserved. | ||
* | ||
* This source code is licensed under the BSD-style license found in the | ||
* LICENSE file in the root directory of this source tree. An additional grant | ||
* of patent rights can be found in the PATENTS file in the same directory. | ||
* | ||
*/ | ||
|
||
'use strict'; | ||
|
||
const babylon = require('babylon'); | ||
const options = require('./tsOptions'); | ||
|
||
exports.parse = function parse (code) { | ||
return babylon.parse(code, options); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* | ||
* Copyright (c) 2015-present, Facebook, Inc. | ||
* All rights reserved. | ||
* | ||
* This source code is licensed under the BSD-style license found in the | ||
* LICENSE file in the root directory of this source tree. An additional grant | ||
* of patent rights can be found in the PATENTS file in the same directory. | ||
* | ||
*/ | ||
|
||
'use strict'; | ||
|
||
/** | ||
* Options shared by the TypeScript and TSX parsers. | ||
*/ | ||
module.exports = { | ||
sourceType: 'module', | ||
allowImportExportEverywhere: true, | ||
allowReturnOutsideFunction: true, | ||
plugins: [ | ||
'asyncGenerators', | ||
'bigInt', | ||
'classPrivateMethods', | ||
'classPrivateProperties', | ||
'classProperties', | ||
'decorators-legacy', | ||
'doExpressions', | ||
'dynamicImport', | ||
'exportDefaultFrom', | ||
'exportExtensions', | ||
'exportNamespaceFrom', | ||
'functionBind', | ||
'functionSent', | ||
'importMeta', | ||
'nullishCoalescingOperator', | ||
'numericSeparator', | ||
'objectRestSpread', | ||
'optionalCatchBinding', | ||
'optionalChaining', | ||
'throwExpressions', | ||
'typescript' | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/* | ||
* Copyright (c) 2015-present, Facebook, Inc. | ||
* All rights reserved. | ||
* | ||
* This source code is licensed under the BSD-style license found in the | ||
* LICENSE file in the root directory of this source tree. An additional grant | ||
* of patent rights can be found in the PATENTS file in the same directory. | ||
* | ||
*/ | ||
|
||
'use strict'; | ||
|
||
const _ = require('lodash'); | ||
const babylon = require('babylon'); | ||
const baseOptions = require('./tsOptions'); | ||
|
||
const options = _.merge(baseOptions, { plugins: ['jsx'] }); | ||
|
||