fix: don't re-add removed markdownlint comments to generated lists - #541
JoshuaKGoldberg wants to merge 1 commit into
Conversation
Fixes all-contributors#540. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
Review from Matheus Breguêz (@matbrgz): Great UX improvement for repos with custom markdown linting configurations, @JoshuaKGoldberg! Respecting the absence of |
|
Hey @JoshuaKGoldberg, closed #553 so we keep everything focused here! 😄 Your zero-config heuristic is super clean and solves the main annoyance on existing tables without adding any configuration burden. Just wanted to share the rationale and edge case we were exploring in #553 in case it's helpful as a small enhancement: The Greenfield / Template Repo Edge CaseIn #541, the check is: const withMarkdownlint =
previousList.includes('<!-- markdownlint-disable -->') ||
!previousList.includes('<!-- prettier-ignore-start -->')For existing lists that had comments manually removed, this works smoothly. However, on fresh setups or template repositories (e.g. running
Potential EnhancementIf you think it's worth supporting, an optional config setting (e.g. const withMarkdownlint =
options.markdownlint !== undefined
? Boolean(options.markdownlint)
: previousList.includes('<!-- markdownlint-disable -->') ||
!previousList.includes('<!-- prettier-ignore-start -->')
Either way, #541 is a great quality-of-life fix as-is. Thanks for putting it together! 🚀 |
What: Fixes #540.
Why: Repos that removed the markdownlint comments from their contributors list get them re-added on every run.
How: When a previously generated list (one with
<!-- prettier-ignore-start -->) doesn't have<!-- markdownlint-disable -->, generation now leaves the markdownlint comments out; new and hand-written lists still get them.Checklist: