remark-lint-appropriate-heading

2.0.4 • Public • Published

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

Package Sidebar

Install

npm i remark-lint-appropriate-heading

Weekly Downloads

58

Version

2.0.4

License

MIT

Unpacked Size

12.1 kB

Total Files

7

Last publish

Collaborators

  • richardlitt