Check that the top-level heading matches the directory name
This remark-lint rule was created for standard-readme.
This rule checks that the top title is in the right position, and that it references the current directory name.
Options: exact, slug, default: exact
With default options, exact, checks that the exact lowercase title matches the directory name.
With options slug, checks that the slugified title matches the directory name.
Invalid, ~/example/a.md:
Paragraph
# ExampleInvalid, ~/example/b.md:
ParagraphInvalid, ~/example/c.md:
# Not “Example”Valid, ~/example/d.md:
# ExampleValid, ~/some-example/e.md, with option slug:
# Some Example# Some-Examplenpm install -g remark-cli
npm install remark-lint remark-lint-appropriate-headingThen, set up your .remarkrc:
{
"plugins": [
"lint",
"lint-appropriate-heading"
]
}Now you can use the following command to run the lint:
remark readme.mdnpm install -g remark-cli
npm install remark-lint remark-lint-appropriate-heading
remark -u lint -u lint-appropriate-heading readme.md