Skip to content

Commit 7dd76e6

Browse files
authored
Merge pull request #3572 from github/mbg/pr-checks/eslint
Add eslint for `pr-checks`
2 parents e3200e3 + 136b8ab commit 7dd76e6

File tree

9 files changed

+138
-659
lines changed

9 files changed

+138
-659
lines changed

.github/workflows/pr-checks.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,14 +92,17 @@ jobs:
9292
node-version: 24
9393
cache: 'npm'
9494

95+
- name: Install dependencies
96+
run: npm ci
97+
9598
- name: Verify PR checks up to date
9699
if: always()
97100
run: .github/workflows/script/verify-pr-checks.sh
98101

99102
- name: Run pr-checks tests
100103
if: always()
101104
working-directory: pr-checks
102-
run: npm ci && npx tsx --test
105+
run: npx tsx --test
103106

104107
check-node-version:
105108
if: github.triggering_actor != 'dependabot[bot]'

.github/workflows/rebuild.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,6 @@ jobs:
3434
with:
3535
node-version: 24
3636
cache: 'npm'
37-
cache-dependency-path: |
38-
package-lock.json
39-
pr-checks/package-lock.json
4037

4138
- name: Remove label
4239
if: github.event_name == 'pull_request'
@@ -97,7 +94,7 @@ jobs:
9794
working-directory: pr-checks
9895
run: |
9996
npm ci
100-
npx tsx sync_back.ts --verbose
97+
npx tsx sync-back.ts --verbose
10198
10299
- name: Generate workflows
103100
working-directory: pr-checks

eslint.config.mjs

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ export default [
2323
"ava.setup.mjs",
2424
"eslint.config.mjs",
2525
".github/**/*",
26-
"pr-checks/**/*",
2726
],
2827
},
2928
// eslint recommended config
@@ -170,4 +169,29 @@ export default [
170169
"func-style": "off",
171170
},
172171
},
172+
{
173+
files: ["pr-checks/**/*.ts"],
174+
175+
languageOptions: {
176+
parserOptions: {
177+
// Use the correct `tsconfig.json` for `pr-checks`.
178+
project: "./pr-checks/tsconfig.json",
179+
},
180+
},
181+
182+
rules: {
183+
// The scripts in `pr-checks` are expected to output to the console.
184+
"no-console": "off",
185+
186+
"@typescript-eslint/no-floating-promises": [
187+
"error",
188+
{
189+
allowForKnownSafeCalls: [
190+
// Avoid needing explicit `void` in front of `describe` calls in test files.
191+
{ from: "package", name: ["describe"], package: "node:test" },
192+
],
193+
},
194+
],
195+
},
196+
},
173197
];

package-lock.json

Lines changed: 67 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: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
"transpile": "tsc --build --verbose"
1616
},
1717
"license": "MIT",
18+
"workspaces": [
19+
"pr-checks"
20+
],
1821
"dependencies": {
1922
"@actions/artifact": "^5.0.3",
2023
"@actions/artifact-legacy": "npm:@actions/artifact@^1.1.2",

0 commit comments

Comments
 (0)