Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate Prettier into workflows and commands (sync w/ upstream) #14195

Merged
merged 2 commits into from
Jul 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would run on everything now, as the old way would use the glob, but the script target will not

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, right -- would you be down to submit a PR to fix that up? I'm currently in the middle of another project that I can't exactly git stash at the moment!


- 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