question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Change Request: Allow processors to report syntax errors

See original GitHub issue

ESLint 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:closed
  • Created a year ago
  • Reactions:3
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
B2o5Tcommented, Jul 6, 2022

Thanks @JounQin 💪🏻

0reactions
mdjermanoviccommented, Jul 8, 2022

Since @nzakas already approved the PR, it seems we have consensus to implement this change, so I’m marking it as accepted.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found