Skip to content

Commit

Permalink
amend babel definitions to allow inline plugins without configuration
Browse files Browse the repository at this point in the history
Summary: Updates babel flow defs to allow for inline plugins without configuration arguments.

Reviewed By: jeanlauliac

Differential Revision: D4442217

fbshipit-source-id: 1b4392bf13977d97984c72cff65b28e62f602300
  • Loading branch information
davidaurelio authored and facebook-github-bot committed Jan 20, 2017
1 parent c9ad000 commit cec7875
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 2 additions & 2 deletions flow/babel.js.flow
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,14 @@ type GeneratorOptions = {
sourceFileName?: string,
};

type InlinePlugin = [string | {} | () => {}, any];
type InlinePlugin = string | {} | () => {};

// based on https://babeljs.io/docs/usage/options/ -- 2016-11-11
type __TransformOptions = {
filename?: string,
filenameRelative?: string,
presets?: Array<string | Object>,
plugins?: Array<string | Object | InlinePlugin>,
plugins?: Array<string | Object | [InlinePlugin] | [InlinePlugin, mixed]>,
parserOpts?: BabylonOptions,
generatorOpts?: GeneratorOptions,
highlightCode?: boolean,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,6 @@ function optimize(transformed, file, originalCode, options): TransformResult {
}

function optimizeCode(code, map, filename, inliningOptions) {
/* $FlowFixMe(>=0.38.0 site=react_native_fb,react_native_oss) - Flow error
* detected during the deployment of v0.38.0. To see the error, remove this
* comment and run flow
*/
return babel.transform(code, {
plugins: [
[constantFolding],
Expand Down

0 comments on commit cec7875

Please sign in to comment.