Skip to content

Commit 51121a3

Browse files
committed
Add linters
1 parent 2009cb4 commit 51121a3

4 files changed

Lines changed: 15 additions & 3 deletions

File tree

.github/workflows/test.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ concurrency:
1616
cancel-in-progress: true
1717

1818
jobs:
19+
lint:
20+
uses: 'google-github-actions/.github/.github/workflows/lint.yml@sethvargo/lint' # ratchet:exclude
21+
1922
unit:
2023
strategy:
2124
fail-fast: false
@@ -31,15 +34,16 @@ jobs:
3134

3235
- uses: 'actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a' # ratchet:actions/setup-node@v4
3336
with:
34-
node-version: '20.x'
37+
node-version-file: 'package.json'
3538

3639
- name: 'npm build'
3740
run: 'npm ci && npm run build'
3841

3942
- name: 'npm lint'
4043
# There's no need to run the linter for each operating system, since it
4144
# will find the same thing 3x and clog up the PR review.
42-
if: ${{ matrix.os == 'ubuntu-latest' }}
45+
if: |-
46+
${{ matrix.os == 'ubuntu-latest' }}
4347
run: 'npm run lint'
4448

4549
- name: 'npm test'

bin/runTests.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ set -eEuo pipefail
1616
FILES="$(node -e "process.stdout.write(require('node:fs').readdirSync('./', { recursive: true }).filter((e) => {return e.endsWith('.test.ts') && !e.startsWith('node_modules');}).sort().join(' '));")"
1717

1818
set -x
19-
exec node --require ts-node/register --test-reporter spec --test ${FILES}
19+
exec node --require ts-node/register --test-reporter spec --test "${FILES}"

package-lock.json

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
"description": "Helpers and utilities that are shared among Google GitHub Actions",
55
"author": "Google LLC",
66
"license": "Apache-2.0",
7+
"engines": {
8+
"node": ">= 20.x",
9+
"npm": ">= 11.x"
10+
},
711
"scripts": {
812
"build": "rm -rf dist/ && ncc build --source-map --no-source-map-register src/index.ts",
913
"lint": "eslint .",

0 commit comments

Comments
 (0)