Change Request: Allow processors to report syntax errors #16104
Labels
accepted
There is consensus among the team that this change meets the criteria for inclusion
archived due to age
This issue has been archived; please open a new issue for any further discussion
core
Relates to ESLint's core APIs and features
enhancement
This change enhances an existing feature of ESLint
Projects
ESLint version
v8.19.0
What problem do you want to solve?
Originally discussed in #16015, the
@graphql-eslint/graphql
processor is encountering a syntax error in the file that is being processed (the "physical" file, if code blocks are "virtual" files). That syntax error results in an exception thrown within the processor that currently crashes the entire lint run. It would be better if processors could report syntax errors like other parsers without crashing the whole process.What do you think is the correct solution?
We should mimic
parse()
's behavior by wrapping thepreprocess()
call intry
/catch
and transforming the exception thrown by the processor into a lint error.Participation
Additional comments
In the discussion, @JounQin asked to take this, but I'm also willing to tackle it as a fallback if necessary.
The text was updated successfully, but these errors were encountered: