mirror of
https://github.com/status-im/react-native.git
synced 2025-01-14 03:26:07 +00:00
[react-native] Use trailing commas transform
Summary: @public Apparently trailing commas transform isn't exported by react-tools. We need to pull it out manually. This is not so clean but we're swtching to babel very shortly. Test Plan: * npm start * write `foo(a,b,c,)` in some file * request that file in the browser and make sure that trailing comma is gone
This commit is contained in:
parent
40da7bb835
commit
d9b7e63e47
@ -16,10 +16,12 @@ var reactVisitors =
|
|||||||
require('react-tools/vendor/fbtransform/visitors').getAllVisitors();
|
require('react-tools/vendor/fbtransform/visitors').getAllVisitors();
|
||||||
var staticTypeSyntax =
|
var staticTypeSyntax =
|
||||||
require('jstransform/visitors/type-syntax').visitorList;
|
require('jstransform/visitors/type-syntax').visitorList;
|
||||||
|
var trailingCommaVisitors =
|
||||||
|
require('jstransform/visitors/es7-trailing-comma-visitors.js').visitorList;
|
||||||
|
|
||||||
// Note that reactVisitors now handles ES6 classes, rest parameters, arrow
|
// Note that reactVisitors now handles ES6 classes, rest parameters, arrow
|
||||||
// functions, template strings, and object short notation.
|
// functions, template strings, and object short notation.
|
||||||
var visitorList = reactVisitors;
|
var visitorList = reactVisitors.concat(trailingCommaVisitors);
|
||||||
|
|
||||||
|
|
||||||
function transform(srcTxt, filename) {
|
function transform(srcTxt, filename) {
|
||||||
var options = {
|
var options = {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user