Skip to content

Remark rule plugin to ensure that all list items of a markdown file are in alphabetical order

Notifications You must be signed in to change notification settings

davorpa/remark-lint-alphabetize-lists

 
 

Repository files navigation

remark-lint-alphabetize-lists Build Status

This remark-lint rule was created for free-programming-books-lint to enforce free-programming-books formatting guidelines.

This rule ensures that all list items are in alphabetical order

<!-- Invalid -->

# Section
- B
- [A](#C)

<!-- Valid -->

# Section
- [A](#C)
- B

Using the rule

Via .remarkrc

npm install -g remark-cli
npm install remark-lint remark-lint-alphabetize-lists

Then, set up your .remarkrc:

{
  "plugins": [
    "lint",
    "lint-alphabetize-lists"
  ]
}

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

remark xxx.md

Via CLI

npm install -g remark-cli
npm install remark-lint remark-lint-alphabetize-lists
remark -u lint -u lint-alphabetize-lists xxx.md