From 0dbc3dd4a079bad776a6932dbaf82a580cb61350 Mon Sep 17 00:00:00 2001 From: Zach Panzarino Date: Sun, 27 Dec 2020 07:25:48 -0500 Subject: [PATCH] Add errorRecovery option to type definitions in babel-parser (#12564) * Fix options types for babel-parser * I love editing files on gh.com --- packages/babel-parser/typings/babel-parser.d.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/babel-parser/typings/babel-parser.d.ts b/packages/babel-parser/typings/babel-parser.d.ts index d53210217a..76f0f327e0 100644 --- a/packages/babel-parser/typings/babel-parser.d.ts +++ b/packages/babel-parser/typings/babel-parser.d.ts @@ -48,6 +48,13 @@ export interface ParserOptions { */ allowUndeclaredExports?: boolean; + /** + * By default, Babel always throws an error when it finds some invalid code. + * When this option is set to true, it will store the parsing error and + * try to continue parsing the invalid input file. + */ + errorRecovery?: boolean; + /** * Indicate the mode the code should be parsed in. * Can be one of "script", "module", or "unambiguous". Defaults to "script".