- Install & spellchecker-cli, as well as retext plugins used:
npm install -g markdownlint-cli spellchecker-cli retext-spell retext-indefinite-article retext-repeated-words retext-syntax-mentions retext-syntax-urls
2.Check spelling and generate a dictionary of words
spellchecker --files '**/*.md' -p spell indefinite-article repeated-words syntax-mentions syntax-urls --generate-dictionary
- Check the generated dictionary.txt and ensure that these words are to be ignored
- Check spelling and ignore words in dictionary.txt
spellchecker --files '**/*.md' -p spell indefinite-article repeated-words syntax-mentions syntax-urls -d dictionary.txt
- Install markdownlint-cli:
npm install -g markdownlint-cli spellchecker-cli retext-spell retext-indefinite-article retext-repeated-words retext-syntax-mentions retext-syntax-urls
- Check and fix linting
- Detect errors
markdownlint '**/*.md' --ignore node_modules
- Fix errors (Note: line-length is not fixed automatically):
markdownlint --fix '**/*.md' --ignore node_modules
- Additionally, spellchecker-cli can be used with the remark-frontmatter plugin to fix additional problems:
spellchecker --files '**/*.md' -p frontmatter -d dictionary.txt