Skip to content

Commit

Permalink
Merge pull request #785 from per1234/prettier-npm
Browse files Browse the repository at this point in the history
Use npm to manage Prettier tool dependency
  • Loading branch information
per1234 authored Oct 16, 2024
2 parents 39f8784 + cf933a8 commit 21d7df9
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 2 deletions.
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"
}

0 comments on commit 21d7df9

Please sign in to comment.