Skip to content

RichardLitt/remark-lint-appropriate-heading

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

remark-lint-appropriate-heading

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

# Example

Invalid, ~/example/b.md:

Paragraph

Invalid, ~/example/c.md:

# Not “Example”

Valid, ~/example/d.md:

# Example

Valid, ~/some-example/e.md, with option slug:

# Some Example
# Some-Example

Using the rule

Via .remarkrc

npm install -g remark-cli
npm install remark-lint remark-lint-appropriate-heading

Then, set up your .remarkrc:

{
  "plugins": [
    "lint",
    "lint-appropriate-heading"
  ]
}

Now you can use the following command to run the lint:

remark readme.md

Via CLI

npm install -g remark-cli
npm install remark-lint remark-lint-appropriate-heading
remark -u lint -u lint-appropriate-heading readme.md

About

Check that the top-level heading matches the directory name

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published