1
0
Fork 0
docsearch/docs/scripts/lint-md-fix
Tim Carry abbca83a12
Auto lint content (#492)
* Auto fix linting in documentation Markdown on commit

* Auto lint content
2018-10-08 13:24:06 +02:00

31 lines
816 B
Bash
Executable file

#!/usr/bin/env sh
set -e
# This will attempt to automatically fix most of the Markdown linting issues
# detected.
# We will first transform the file according to remark config. This will mostly
# convert inline links to references at the bottom of the file.
REMARK_MODE=fix \
remark \
--quiet \
./*.md \
./src/*.md \
--output
# We then check the actual natural language content of the file, to fix
# misspellings, punctuation and other fixable issues.
TEXTLINT_MODE=fix textlint \
--fix \
--cache \
./*.md \
./src/*.md \
1>/dev/null
# Finally, we'll run everything through prettier to make sure all files are
# formatted the same way. This will remove trailing spaces, fit all content
# under 80 char long lines, etc
prettier \
--loglevel error \
--write \
./*.md \
./src/*.md