eslint / eslint

Find and fix problems in your JavaScript code.
https://eslint.org
MIT License
24.39k stars 4.4k forks source link

feat: Provide helpful error message for nullish configs #18357

Closed nzakas closed 4 weeks ago

nzakas commented 1 month ago

Prerequisites checklist

What is the purpose of this pull request? (put an "X" next to an item)

[ ] Documentation update [ ] Bug fix (template) [ ] New rule (template) [ ] Changes an existing rule (template) [ ] Add autofix to a rule [ ] Add a CLI option [x] Add something to the core [ ] Other, please explain:

What changes did you make? (Give an overview)

Upgraded @humanwhocodes/config-array to include new error details, then updated FlatConfigArray to use that info to produce an error message containing the index of the config that caused the error.

fixes #18259

Is there anything you'd like reviewers to focus on?

I used the terms "original", "base", and "user-defined" to differentiate between the different parts of the config array. I'm not sure how accurate those are but they are at least indicating the different parts of the array where the error occurred.

netlify[bot] commented 1 month ago

Deploy Preview for docs-eslint canceled.

Name Link
Latest commit 2833384aabe56cb7935297960e1cfad1ff25e315
Latest deploy log https://app.netlify.com/sites/docs-eslint/deploys/6621877a9912550008cb597c
fasttime commented 4 weeks ago

Merging now to get this change in v9.1.0.