Purpose: There are recoverable errors in syntax error, e.g. duplicate names, invalid escapes in RegExp, and etc. ESLint stops all linting if it encountered those recoverable errors. However, ESLint should be able to work.
Proposal: Adds errors option to espree.
const ast = espree.parse(code, { errors: true })
console.log(ast.errors) //→ Array of recoverable errors.
acorn reports errors by this.raiseRecoverable() method if the error is recoverable. If the errors:true option is given, espree collects recoverable errors into ast.errors property instead of throwing exception.
Then ESLint can report the ast.errors to users.
Purpose: There are recoverable errors in syntax error, e.g. duplicate names, invalid escapes in RegExp, and etc. ESLint stops all linting if it encountered those recoverable errors. However, ESLint should be able to work.
Proposal: Adds
errorsoption to espree.acornreports errors bythis.raiseRecoverable()method if the error is recoverable. If theerrors:trueoption is given, espree collects recoverable errors intoast.errorsproperty instead of throwing exception.Then ESLint can report the
ast.errorsto users.