Skip to content

Use npm to manage Prettier tool dependency #785

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

Merged
merged 1 commit into from
Oct 16, 2024
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
9 changes: 9 additions & 0 deletions .github/workflows/check-prettier-formatting-task.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/check-prettier-formatting-task.md
name: Check Prettier Formatting

env:
# See: https://github.com/actions/setup-node/#readme
NODE_VERSION: 20.x

# See: https://docs.github.com/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows
on:
create:
Expand Down Expand Up @@ -238,6 +242,11 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}

- name: Install Task
uses: arduino/setup-task@v2
with:
Expand Down
2 changes: 2 additions & 0 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,8 @@ tasks:
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-prettier-formatting-task/Taskfile.yml
general:format-prettier:
desc: Format all supported files with Prettier
deps:
- task: npm:install-deps
cmds:
- npx prettier --write .

Expand Down
19 changes: 18 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"devDependencies": {
"markdown-link-check": "3.11.2",
"markdownlint-cli": "0.37.0"
"markdownlint-cli": "0.37.0",
"prettier": "3.3.3"
},
"type": "module"
}
Loading