Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve parsing #36

Merged
merged 3 commits into from
Mar 22, 2024
Merged

Conversation

DamienCassou
Copy link
Contributor

This PR consists of 3 commits:

  • clarification of the code
  • bug fix when a diagnostic spans several lines
  • bug fix when JSON output is active but eslint crashes

Both `any' and `not-newline' are converted to the "." regular
expression. I find the later more explicit and this use of `any' isn't
mentioned in the docstring of `rx' (in Emacs 29.2 at least).
In some cases, eslint can produce a multi-line error message. This
happens for example for the import/no-deprecated rule [1] which shows
a user-constructed message in the error. Replacing `any' (which
matches anything but a new line) with `anychar' allows for matching
new lines within the message.

[1] https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-deprecated.md
Even if "--format json" is passed to eslint, the output will be
non-json in case of a crash, e.g.,

  Error: Failed to load plugin 'foo' declared in '.eslintrc.cjs':
  Cannot find module 'eslint-plugin-foo' …

This commit makes sure that such eslint's crash doesn't prevent
flymake-eslint from reporting the error.
@DamienCassou
Copy link
Contributor Author

/cc @orzechowskid

Is there any interest in this PR?

@orzechowskid
Copy link
Owner

apologies for my lack of communication, I don't have much free time these days. this looks great, thank you!

@orzechowskid orzechowskid merged commit 6ab909b into orzechowskid:master Mar 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants