Markdownlint: Move required heading structure into TOP004 rule directly #28759
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Because
We use different required heading structures for lesson and project files which are currently being handled by separate config files that extend the base markdownlint config. Because of this, the VSCode extension doesn't pick up any TOP004 errors. Because of this, people sometimes make unnecessary "fixes" because they ran the wrong lint script (e.g. lesson script for a project file).
By moving the heading structure definitions into the rule itself, we can make the rule determine which heading structure to use based on the file name, eliminating the need for separate configs and scripts.
This PR
ellipsify
andhandleCase
.markdownlint-cli2.jsonc
)Issue
N/A
Additional information
Sorry for the markdownlint bomb recently, Eric!
Pull Request Requirements
location of change: brief description of change
format, e.g.Intro to HTML and CSS lesson: Fix link text
Because
section summarizes the reason for this PRThis PR
section has a bullet point list describing the changes in this PRIssue
section