docs: incomplete config example#1463
Conversation
There was a problem hiding this comment.
Pull request overview
This PR attempts to fix an incomplete configuration example in the documentation for overriding recommended rules. The author identified that the original example only worked when setting rules to "off" but not when setting them to "error". However, the proposed solution introduces unnecessary complexity and deviates from standard ESLint flat config patterns.
Key Changes:
- Adds import for
defineConfigfrom "eslint/config" - Changes configuration structure from array to single object wrapped in
defineConfig - Uses
extendsproperty to extend the recommended config with overridden files and rules
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Didn't realize we had Copilot enabled. That must be new. Though it was 0 for 3 this round 😆 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1463 +/- ##
=======================================
Coverage 97.39% 97.39%
=======================================
Files 28 28
Lines 575 575
Branches 169 169
=======================================
Hits 560 560
Misses 1 1
Partials 14 14 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Looks good. Thanks for taking this up.
As I mentioned in #1451 (comment), I'd like to include defineConfig in all of our examples for consistency. Let me know if you're planning to update this PR to include, and if not, I'll add it on top of your changes. I'll wait to hear back before making the update.
|
@all-contributors please add @OlivierZal for docs |
|
I've put up a pull request to add @OlivierZal! 🎉 |
Adds @OlivierZal as a contributor for doc. This was requested by michaelfaith [in this comment](#1463 (comment)) --------- Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
|
Sure, @michaelfaith. Updated accordingly. |
|
🎉 This is included in version v0.86.0 🎉 The release is available on: Cheers! 📦🚀 |
PR Checklist
status: accepting prsOverview
In the documentation, the following works:
But the following:
raises the following error:
To fix it, it should be embedded in eslint's
defineConfigmethod and include thefileskey: