Add errorRecovery option to type definitions in babel-parser (#12564)

* Fix options types for babel-parser

* I love editing files on gh.com
This commit is contained in:
Zach Panzarino 2020-12-27 07:25:48 -05:00 committed by GitHub
parent 0d55896483
commit 0dbc3dd4a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -48,6 +48,13 @@ export interface ParserOptions {
*/ */
allowUndeclaredExports?: boolean; 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. * Indicate the mode the code should be parsed in.
* Can be one of "script", "module", or "unambiguous". Defaults to "script". * Can be one of "script", "module", or "unambiguous". Defaults to "script".