-
Notifications
You must be signed in to change notification settings - Fork 74
feat: add frontmatterTitle option to heading-increment #454
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces a frontmatterTitle
option to the heading-increment
rule so that a matching title in frontmatter counts as an H1, preventing skipped-heading errors. It adds a helper, integrates frontmatter handlers, expands tests, and updates documentation.
- Introduce
frontmatterHasTitle
inutil.js
and use it inheading-increment
- Expand
heading-increment
rule with schema, default options, and frontmatter listeners - Add tests covering YAML/TOML/JSON frontmatter variations and update docs
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
tests/rules/heading-increment.test.js | Added valid/invalid cases for frontmatter title handling |
src/util.js | Added frontmatterHasTitle helper |
src/rules/no-multiple-h1.js | Imported helper and updated JSDoc typedefs (unused import) |
src/rules/heading-increment.js | Added schema, defaultOptions, and YAML/TOML/JSON handlers |
docs/rules/heading-increment.md | Documented new frontmatterTitle option |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Would like another review before merging.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The rest looks good to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, Would like @nzakas to verify the changes before merging.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks.
Prerequisites checklist
What is the purpose of this pull request?
This pull request adds a new frontmatterTitle option to the heading-increment rule. The rule will treat a frontmatter title as a level 1 heading for the purpose of heading increment checks, ensuring that heading levels are not skipped after a frontmatter title.
What changes did you make? (Give an overview)
Related Issues
Fixes #443
Is there anything you'd like reviewers to focus on?