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
Change Request: Provide config key when config validation fails #17960
Comments
I upgraded to
Will there be more additions or changes to the validation errors? Are there plans for a type def file for the eslint.config.js? |
I do agree we need to at least indicate what property is involved. |
Why was this closed? |
I also think that it would be good to include the name of the option in the error message. Reopening to get more feedback from the team @eslint/eslint-team. |
I waffled on it and closed because it seemed like the messages were improving and maybe already on the roadmap. But agree if opening is the thing to do to keep on the radar. |
@martypdx that's very strange. The flat config does typically tell you not just the key but the path to the key when there's a validation error. Can you create a Stackblitz that reproduces the issue you're seeing? I'd like to see it in action to understand what is happening here because this is unexpected. |
@nzakas here is a Stackblitz using these dep versions: "dependencies": {
"@eslint/js": "^8.56.0",
"eslint": "^8.56.0",
"globals": "^13.24.0"
} If you run This is same error you would see in OUTPUT ESlint tab of VSCode console |
Awesome ,thanks so much. I'll take a look. |
I was able to reproduce this locally. Interestingly, the unit tests are passing with key information, so somehow we are skipping over the logic that adds the key information to the message in this case. |
Okay, so it turns out the error is being produced with the key information, but our error reporting functionality is swallowing all of the details. |
This was actually caused by a change I made to |
* fix: Ensure config keys are printed for config errors fixes #17960 * Remove unnecessary test
* fix: Ensure config keys are printed for config errors fixes #17960 * Remove unnecessary test
ESLint version
8.55.0
What problem do you want to solve?
When the config file fails validation there is very little information to go on. In connection with #17959, using
"error"
forreportUnusedDisableDirectives
causes the load to fail with error below which has no information on which config caused the error or call stack entry with line numbers.What do you think is the correct solution?
Report:
Participation
Additional comments
Is there a type definition for new config file? I could see implementing this as type validation as well.
The text was updated successfully, but these errors were encountered: