mirror of
https://github.com/facebook/lexical.git
synced 2025-08-06 16:39:33 +08:00
Fix invariant and update codes (#2315)
This commit is contained in:
@ -18,6 +18,7 @@ const plugins = [
|
||||
'jsx',
|
||||
'trailingFunctionCommas',
|
||||
'objectRestSpread',
|
||||
'typescript',
|
||||
];
|
||||
|
||||
const babylonOptions = {
|
||||
@ -99,13 +100,7 @@ module.exports = function (opts) {
|
||||
);
|
||||
}
|
||||
|
||||
return function extractErrors(source, isTypeScript) {
|
||||
if (isTypeScript) {
|
||||
babylonOptions.plugins = [...plugins, 'typescript'];
|
||||
} else {
|
||||
babylonOptions.plugins = [...plugins, 'flow'];
|
||||
}
|
||||
|
||||
return function extractErrors(source) {
|
||||
transform(source);
|
||||
flush();
|
||||
};
|
||||
|
Reference in New Issue
Block a user