mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-22 09:21:57 -05:00
Meta: Enforce Prettier formatting of Markdown files
We already use the opinionated Prettier formatter for JavaScript (with appropriate configuration), and in general it seems to be one of the best Markdown auto-formatters. Therefore, the choice seems natural to finally enforce Markdown formatting.
This commit is contained in:
parent
19163e79a3
commit
f0ba4d9037
1 changed files with 4 additions and 4 deletions
|
@ -10,12 +10,12 @@ if [ "$#" -eq "0" ]; then
|
|||
git ls-files \
|
||||
--exclude-from .prettierignore \
|
||||
-- \
|
||||
'*.js' '*.mjs'
|
||||
'*.js' '*.mjs' '*.md'
|
||||
)
|
||||
else
|
||||
files=()
|
||||
for file in "$@"; do
|
||||
if [[ "${file}" == *".js" ]] || [[ "${file}" == *".mjs" ]]; then
|
||||
if [[ "${file}" == *".js" || "${file}" == *".mjs" || "${file}" == *".md" ]]; then
|
||||
files+=("${file}")
|
||||
fi
|
||||
done
|
||||
|
@ -23,7 +23,7 @@ fi
|
|||
|
||||
if (( ${#files[@]} )); then
|
||||
if ! command -v prettier >/dev/null 2>&1 ; then
|
||||
echo "prettier is not available, but JS files need linting! Either skip this script, or install prettier."
|
||||
echo "prettier is not available, but JS or Markdown files need linting! Either skip this script, or install prettier."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
@ -34,5 +34,5 @@ if (( ${#files[@]} )); then
|
|||
|
||||
prettier --check "${files[@]}"
|
||||
else
|
||||
echo "No .js or .mjs files to check."
|
||||
echo "No .js, .mjs, or .md files to check."
|
||||
fi
|
||||
|
|
Loading…
Reference in a new issue