From 27c0afba36b225594fd1142973c58b031cb01238 Mon Sep 17 00:00:00 2001 From: wysiwys Date: Wed, 2 Apr 2025 17:47:53 +0200 Subject: [PATCH 1/3] ignore scripts folder and non-formattable file types --- .prettierignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.prettierignore b/.prettierignore index bed904a..23a8cb5 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,5 +1,8 @@ test/data coverage dist +scripts/ **/*.md **/*.txt +**/*.sh +**/*.yml From 51fa55e03ff4c3600f40ce841937abe8b518ca85 Mon Sep 17 00:00:00 2001 From: wysiwys Date: Wed, 2 Apr 2025 17:48:27 +0200 Subject: [PATCH 2/3] run in current directory to make use of the `.prettierignore` --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index e7c5c9d..f513994 100644 --- a/package.json +++ b/package.json @@ -8,8 +8,8 @@ "build": "tsc -p tsconfig.build.json", "lint": "eslint '**/*.{ts,js}'", "fix": "eslint --fix '**/*.{ts,js}'", - "format": "prettier -w **", - "format:check": "prettier -c **", + "format": "prettier -w .", + "format:check": "prettier -c .", "test": "jest", "test:watch": "jest --watch", "coverage": "jest --coverage", From 985a33af072729a4d79b19bdc410bf56810221aa Mon Sep 17 00:00:00 2001 From: wysiwys Date: Wed, 2 Apr 2025 17:51:04 +0200 Subject: [PATCH 3/3] add workflow for formatting and lint checks --- .github/workflows/format-and-lint.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 .github/workflows/format-and-lint.yml diff --git a/.github/workflows/format-and-lint.yml b/.github/workflows/format-and-lint.yml new file mode 100644 index 0000000..ce67376 --- /dev/null +++ b/.github/workflows/format-and-lint.yml @@ -0,0 +1,23 @@ +name: Format and lint + +on: + workflow_dispatch: + pull_request: + +jobs: + format: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: "install and check format" + run: | + npm install + npm run format:check + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: "install and lint" + run: | + npm install + npm run lint