Change Request: Allow processors to report syntax errors
See original GitHub issueESLint version
v8.19.0
What problem do you want to solve?
Originally discussed in https://github.com/eslint/eslint/discussions/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 the preprocess()
call in try
/catch
and transforming the exception thrown by the processor into a lint error.
Participation
- I am willing to submit a pull request for this change.
Additional comments
In the discussion, @JounQin asked to take this, but I’m also willing to tackle it as a fallback if necessary.
Issue Analytics
- State:
- Created a year ago
- Reactions:3
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Syntax Error - an overview | ScienceDirect Topics
Syntax errors are mistakes in the source code, such as spelling and punctuation errors, incorrect labels, and so on, which cause an error...
Read more >Transport failed : Syntax error in routine - SAP Community
The transport of a transformation fails with message: Syntax error in routine ... Execute reports for change/transport request: DL3K900578.
Read more >Count Responses With Syntax Errors As Submissions for a ...
From My Classes, click Edit Class Settings. In the Class Settings page, click Advanced Options. Under Syntax Errors, select or clear on numerical...
Read more >Processors - Datadog Docs
A processor executes within a Pipeline to complete a data-structuring action and generate attributes to enrich your logs. In log configuration settings, ...
Read more >Understand and Resolve Syntax Errors in a Template or Script
To resolve such a syntax error, select an entry in the processing stack and click Go To Error. (Usually, you should select the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks @JounQin 💪🏻
Since @nzakas already approved the PR, it seems we have consensus to implement this change, so I’m marking it as accepted.