Skip to content

Commit 827b4b4

Browse files
feat: always run build || exit 0 before lint in CI (#936)
## PR Checklist - [x] Addresses an existing open issue: fixes #935 - [x] That issue was marked as [`status: accepting prs`](https://github.com/JoshuaKGoldberg/create-typescript-app/issues?q=is%3Aopen+is%3Aissue+label%3A%22status%3A+accepting+prs%22) - [x] Steps in [CONTRIBUTING.md](https://github.com/JoshuaKGoldberg/create-typescript-app/blob/main/.github/CONTRIBUTING.md) were taken ## Overview Adds `pnpm build || true` before `pnpm lint` in the templated `lint.yml`. That's what this repo already does, so this essentially makes templated repos more like this one.
1 parent 67a61bb commit 827b4b4

File tree

6 files changed

+11
-2
lines changed

6 files changed

+11
-2
lines changed

.github/DEVELOPMENT.md

+2
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ For example, ESLint can be run with `--fix` to auto-fix some lint rule complaint
5656
pnpm run lint --fix
5757
```
5858

59+
Note that you'll likely need to run `pnpm build` before `pnpm lint` so that lint rules which check the file system can pick up on any built files.
60+
5961
## Testing
6062

6163
[Vitest](https://vitest.dev) is used for tests.

script/migrate-test-e2e.js

-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ const filesExpectedToBeChanged = new Set([
3535
".eslintignore",
3636
".eslintrc.cjs",
3737
".github/DEVELOPMENT.md",
38-
".github/workflows/lint.yml",
3938
".github/workflows/lint-knip.yml",
4039
".github/workflows/test.yml",
4140
".gitignore",

src/steps/writing/creation/dotGitHub/createDevelopment.test.ts

+4
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,8 @@ describe("createDevelopment", () => {
109109
pnpm run lint --fix
110110
\`\`\`
111111
112+
Note that you'll likely need to run \`pnpm build\` before \`pnpm lint\` so that lint rules which check the file system can pick up on any built files.
113+
112114
## Testing
113115
114116
[Vitest](https://vitest.dev) is used for tests.
@@ -215,6 +217,8 @@ describe("createDevelopment", () => {
215217
pnpm run lint --fix
216218
\`\`\`
217219
220+
Note that you'll likely need to run \`pnpm build\` before \`pnpm lint\` so that lint rules which check the file system can pick up on any built files.
221+
218222
## Testing
219223
220224
[Vitest](https://vitest.dev) is used for tests.

src/steps/writing/creation/dotGitHub/createDevelopment.ts

+2
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ ESLint can be run with \`--fix\` to auto-fix some lint rule complaints:`
8181
pnpm run lint --fix
8282
\`\`\`
8383
84+
Note that you'll likely need to run \`pnpm build\` before \`pnpm lint\` so that lint rules which check the file system can pick up on any built files.
85+
8486
${
8587
!options.excludeTests &&
8688
`## Testing

src/steps/writing/creation/dotGitHub/createWorkflows.test.ts

+2
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@ describe("createWorkflows", () => {
192192
steps:
193193
- uses: actions/checkout@v4
194194
- uses: ./.github/actions/prepare
195+
- run: pnpm build || true
195196
- run: pnpm lint
196197
197198
name: Lint
@@ -363,6 +364,7 @@ describe("createWorkflows", () => {
363364
steps:
364365
- uses: actions/checkout@v4
365366
- uses: ./.github/actions/prepare
367+
- run: pnpm build || true
366368
- run: pnpm lint
367369
368370
name: Lint

src/steps/writing/creation/dotGitHub/createWorkflows.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ export function createWorkflows(options: Options) {
9191
}),
9292
"lint.yml": createWorkflowFile({
9393
name: "Lint",
94-
runs: ["pnpm lint"],
94+
runs: ["pnpm build || true", "pnpm lint"],
9595
}),
9696
...(!options.excludeLintKnip && {
9797
"lint-knip.yml": createWorkflowFile({

0 commit comments

Comments
 (0)