From 2da871c888e3652dd2eff0a71d3d211085423ffa Mon Sep 17 00:00:00 2001 From: Kai Koenig Date: Wed, 22 Jul 2026 10:56:13 +1200 Subject: [PATCH 1/2] chore(ci): make quality checks non-mutating --- .github/workflows/node.js.yml | 23 +++++++---------------- package.json | 6 ++++-- 2 files changed, 11 insertions(+), 18 deletions(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 9fe0eba..70606dd 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -31,26 +31,17 @@ jobs: - run: npm run eslint - run: npm run tseslint - # Checks code formatting, fails if there are changes after applying prettier. - # Based on this example here: - # https://github.com/creyD/prettier_action?tab=readme-ov-file#example-4-dry-run + # Checks code formatting using the version pinned in package-lock.json. prettier: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v7 + - name: Use Node.js 24.x + uses: actions/setup-node@v6 with: - # Make sure the actual branch is checked out when running on pull requests - ref: ${{ github.head_ref }} - # Make sure the value of GITHUB_TOKEN will not be persisted in repo's config - persist-credentials: false - - - name: Prettify code - uses: creyD/prettier_action@v4.6 - with: - # "dry" causes that if any file is modified, the job fails - dry: True - # "write" performs changes in place - prettier_options: --write lib/*.ts test/*.js example/*.js - github_token: ${{ secrets.PERSONAL_GITHUB_TOKEN }} + node-version: 24.x + cache: 'npm' + - run: npm ci + - run: npm exec -- prettier --check "lib/*.ts" "test/*.js" "example/*.js" diff --git a/package.json b/package.json index 27c688c..732c962 100644 --- a/package.json +++ b/package.json @@ -6,9 +6,11 @@ "types": "build/raygun.aws.d.ts", "scripts": { "//eslint": "performs static analysis over JS files and examples", - "eslint": "eslint --config eslint.config.mjs --fix test/*.js example/*.js", + "eslint": "eslint --config eslint.config.mjs test/*.js example/*.js", + "eslint:fix": "eslint --config eslint.config.mjs --fix test/*.js example/*.js", "//tseslint": "performs static analysis over TS files and examples", - "tseslint": "eslint --config tseslint.config.mjs --fix lib/*.ts", + "tseslint": "eslint --config tseslint.config.mjs lib/*.ts", + "tseslint:fix": "eslint --config tseslint.config.mjs --fix lib/*.ts", "//prettier": "performs code formatting over project files", "prettier": "prettier --write lib/*.ts test/*.js", "//prepare": "prepare project for distribution", From 4a75061de373f58c973e6f43ada735b8251471f6 Mon Sep 17 00:00:00 2001 From: Kai Koenig Date: Thu, 23 Jul 2026 08:19:30 +1200 Subject: [PATCH 2/2] chore(ci): align local and CI formatting commands --- .github/workflows/node.js.yml | 2 +- package.json | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 70606dd..daa04ae 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -44,4 +44,4 @@ jobs: node-version: 24.x cache: 'npm' - run: npm ci - - run: npm exec -- prettier --check "lib/*.ts" "test/*.js" "example/*.js" + - run: npm run prettier:check diff --git a/package.json b/package.json index 732c962..d7fc80e 100644 --- a/package.json +++ b/package.json @@ -11,8 +11,9 @@ "//tseslint": "performs static analysis over TS files and examples", "tseslint": "eslint --config tseslint.config.mjs lib/*.ts", "tseslint:fix": "eslint --config tseslint.config.mjs --fix lib/*.ts", - "//prettier": "performs code formatting over project files", - "prettier": "prettier --write lib/*.ts test/*.js", + "//prettier": "performs code formatting over project files and examples", + "prettier": "prettier --write lib/*.ts test/*.js example/*.js", + "prettier:check": "prettier --check lib/*.ts test/*.js example/*.js", "//prepare": "prepare project for distribution", "prepare": "tsc", "//test": "runs tests on main project",