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

Wrong line number for fatal errors from ESLint #22

Open
theotherdon opened this issue Feb 5, 2021 · 0 comments
Open

Wrong line number for fatal errors from ESLint #22

theotherdon opened this issue Feb 5, 2021 · 0 comments

Comments

@theotherdon
Copy link

Issue

Fatal errors from ESLint don't show the file or line number that caused the error. After looking at the code, it appears that this is because there's an expectation that all fatal errors are parser errors. One such example is using the class keyword when ESLint is set to a version of ECMAScript that doesn't support classes. Paths and line numbers should be displayed when fatal errors like the class keyword that contain this information are encountered.

I took an initial swing at getting this fixed and was able to get file paths and line numbers to correctly display. However, there are a couple of failing tests that are kind of hard to follow, so I haven't been able to figure out what's going on in a reasonable amount of time. I'll be referencing the WIP PR after creating this issue, but I wanted to create this issue for reference as I ask for help in the WIP PR.

Steps to reproduce

  1. Add a file called ProntoEslintError.js that contains an empty Javascript class:
class ProntoEslintError {}
  1. Add the file to the stage: git add .
  2. Run pronto against staged changes: bundle exec pronto run --staged

Observe: Pronto displays a parser error showing .eslintrc as the offending file.

Screen Shot 2021-02-05 at 9 23 57 AM

Expected: Pronto displays a warning showing the actual path and line number where the issue occurred.

Screen Shot 2021-02-05 at 9 22 48 AM

Technical details

  • Gem version: 0.10.0
  • Operating system: Ubuntu 18.04.5
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

No branches or pull requests

1 participant