diff --git a/.github/workflows/markdown-lint-fix.yml b/.github/workflows/markdown-lint-fix.yml index 43189db8695ee1..d838fde14aef05 100644 --- a/.github/workflows/markdown-lint-fix.yml +++ b/.github/workflows/markdown-lint-fix.yml @@ -40,7 +40,7 @@ jobs: - name: Lint markdown files run: | - yarn markdownlint-cli2-fix "**/${{ matrix.lang }}/**/*.md" + yarn fix:md "**/${{ matrix.lang }}/**/*.md" - name: Create PR with only fixable issues if: success() diff --git a/.github/workflows/pr-check_markdownlint.yml b/.github/workflows/pr-check_markdownlint.yml index cd292eb4bfde1c..dae6a3fd05506a 100644 --- a/.github/workflows/pr-check_markdownlint.yml +++ b/.github/workflows/pr-check_markdownlint.yml @@ -47,3 +47,8 @@ jobs: echo "::add-matcher::.github/workflows/markdownlint-problem-matcher.json" files_to_lint="${{ env.DIFF_DOCUMENTS }}" yarn markdownlint-cli2 ${files_to_lint} + + - name: Prettier markdown files + run: | + files_to_lint="${{ env.DIFF_DOCUMENTS }}" + yarn prettier -c ${files_to_lint} diff --git a/.lintstagedrc.json b/.lintstagedrc.json index 1cc8e9cd49c3e8..fc5bcf3c97909a 100644 --- a/.lintstagedrc.json +++ b/.lintstagedrc.json @@ -1,3 +1,4 @@ { + "*": "prettier --ignore-unknown --write", "*.md": "markdownlint-cli2-fix" } diff --git a/package.json b/package.json index 635fa84f21beab..b30f0225dd8255 100644 --- a/package.json +++ b/package.json @@ -15,10 +15,10 @@ }, "scripts": { "fix:json": "prettier -w \"**/*.json\"", - "fix:md": "markdownlint-cli2-fix \"**/*.md\"", + "fix:md": "markdownlint-cli2-fix \"**/*.md\" && prettier -w \"**/*.md\"", "fix:yml": "prettier -w \"**/*.yml\"", "lint:json": "prettier -c \"**/*.json\"", - "lint:md": "markdownlint-cli2 \"**/*.md\"", + "lint:md": "markdownlint-cli2 \"**/*.md\" && prettier -c \"**/*.md\"", "lint:yml": "prettier -c \"**/*.yml\"", "prepare": "husky install" },