Make babel-standalone an ESModule and enable flow (#9025)

* Make babel-standalone an ESModule and enable flow

* autogenerate plugin list

* Make config an array
This commit is contained in:
Daniel Tschinder
2019-03-06 14:30:43 -08:00
committed by GitHub
parent d8a5329834
commit fb81e8f8b4
13 changed files with 507 additions and 210 deletions

View File

@@ -0,0 +1,11 @@
"use strict";
const prettier = require("prettier");
module.exports = function formatCode(code, filename) {
filename = filename || __filename;
const prettierConfig = prettier.resolveConfig.sync(filename);
prettierConfig.filepath = filename;
prettierConfig.parser = "babel";
return prettier.format(code, prettierConfig);
};