Skip to content

Commit

Permalink
Integrate Prettier into workflows and commands (sync w/ upstream) (#1…
Browse files Browse the repository at this point in the history
  • Loading branch information
queengooborg authored Jul 14, 2023
1 parent 58bf1ef commit a82f094
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/markdown-lint-fix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/pr-check_markdownlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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}
1 change: 1 addition & 0 deletions .lintstagedrc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"*": "prettier --ignore-unknown --write",
"*.md": "markdownlint-cli2-fix"
}
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down

0 comments on commit a82f094

Please sign in to comment.