-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Markdownlint: Move required heading structure into TOP004 rule directly #28759
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
Open
MaoShizhong
wants to merge
11
commits into
TheOdinProject:main
Choose a base branch
from
MaoShizhong:TOP004-config-refactor
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Markdownlint: Move required heading structure into TOP004 rule directly #28759
MaoShizhong
wants to merge
11
commits into
TheOdinProject:main
from
MaoShizhong:TOP004-config-refactor
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
No need to extract from separate custom config
Carryover from original rule - we always want to match case with ours
Detail field required for VSCode extension error message - context field alone is insufficient. Removed ellipsify method and unused params (carryover from original rule).
Separated lesson/project tests due to different required headings. Separated different kinds of heading errors from lesson test file.
Default config is .markdownlint-cli2.jsonc. Contributing guide amended accordingly.
TOP005 also missing a few language exceptions
To reflect script changes
Some directories e.g. foundations/html_css/html-foundations/ use kebab case instead of snake case. Instead of changing many files (which will need changes in the website repo fixtures), just include leading "project-" in the "isProject" condition. Kebab case test files included, which will behave the same as snake case test files.
3 tasks
b5c8fd9
to
ed0d3ef
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
)package.json
example in npm lesson to reflect changed scriptsIssue
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