You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
Add a file called ProntoEslintError.js that contains an empty Javascript class:
classProntoEslintError{}
Add the file to the stage: git add .
Run pronto against staged changes: bundle exec pronto run --staged
Observe: Pronto displays a parser error showing .eslintrc as the offending file.
Expected: Pronto displays a warning showing the actual path and line number where the issue occurred.
Technical details
Gem version: 0.10.0
Operating system: Ubuntu 18.04.5
The text was updated successfully, but these errors were encountered:
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 theclass
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
ProntoEslintError.js
that contains an empty Javascript class:git add .
bundle exec pronto run --staged
Observe: Pronto displays a parser error showing
.eslintrc
as the offending file.Expected: Pronto displays a warning showing the actual path and line number where the issue occurred.
Technical details
The text was updated successfully, but these errors were encountered: