Files
react/main.js
Benjamin Woodruff c089eece50 Switch to using comma-dangle: always-multiline
This is a machine-generated codemod, but it's pretty safe since it was
generated by hooking into eslint's own report.

A few files had to be touched up by hand because there were existing
formatting issues with nested arrays/objects:

src/shared/utils/__tests__/OrderedMap-test.js
src/shared/utils/__tests__/Transaction-test.js
src/shared/utils/__tests__/traverseAllChildren-test.js
src/isomorphic/children/__tests__/ReactChildren-test.js
2015-06-02 16:57:26 -07:00

39 lines
1.0 KiB
JavaScript

/**
* Copyright 2013-2015, 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';
var jstransform = require('jstransform/simple');
function transformWithDetails(code, opts) {
opts = opts || {};
// Copy out the values we need and make sure they are compatible with
// jstransform options. Always set react:true.
var options = {
react: true,
harmony: opts.harmony,
stripTypes: opts.stripTypes,
sourceMapInline: opts.sourceMap,
sourceFilename: opts.sourceFilename,
es6module: opts.es6module,
nonStrictEs6module: opts.nonStrictEs6module,
target: opts.target,
};
return jstransform.transform(code, options);
}
module.exports = {
transform: function(input, options) {
return transformWithDetails(input, options).code;
},
transformWithDetails: transformWithDetails,
};