-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Feature: Improve error message reported by getParserServices #8482
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
Comments
Could you please provide some more info here - what usecase are you looking to improve by adding the parser path? I personally am not convinced that it's a good thing based on the usecases I know of and would think the extra information would be noise in those cases - so I'm going to need some more information from you. |
I've had to debug this issue and it is difficult in a large monorepo project without knowing that value. As the error is about, or based on, that specific value, it would be very helpful information in debugging that error when it occurs. |
Sorry that's the part I don't understand. How would knowing that the parser path is Could you please describe how knowing that would have helped you debug? |
Here is the output when linting the project:
It says In short, it refers to this "other" parser as being the cause of the error. It would be very helpful to know which one is unintentially being found. That would aid in tracking down the root cause to the error. I am happy to submit a pull request for this change, and to take any feedback on the pull request. |
Using the example in the automated test for that error, it would now output
The information that the parser it found was @babel/parser.js can help track down the cause of the error. |
Seems reasonable to me to mention the parser explicitly. The downside is having a bit more verbose of a log, but the upside of being more explicit & clear can IMO help folks figure out where things are going wrong. So, what disaacson said. 😄 cc @bradzacher - thoughts? |
sure sounrds good |
I updated the PR's checklist. Let me know if you have any feedback or requested changes. Thanks! |
Suggestion
I'm getting an error from this line
https://github.com/typescript-eslint/typescript-eslint/blame/18c3216485c381dd0215cfa7099f33bc721c8efe/packages/utils/src/eslint-utils/getParserServices.ts#L93
I would like to submit a pull request to include in the error message the
parserPath
value that is causing the error. That could help with debugging this issue when it arises.The text was updated successfully, but these errors were encountered: