Skip to content

Commit b52fa0f

Browse files
committed
Build lib before linting
1 parent 3ef1907 commit b52fa0f

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

.github/workflows/build-test.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@ jobs:
1818
cache: 'yarn'
1919
- run: yarn
2020
- run: yarn prettier-check
21-
- run: yarn lint-check
21+
# Need to build before linting because of linting rules that use type information.
2222
- run: yarn build-lib
23+
- run: yarn lint-check
2324
- run: yarn type-check-app
2425
- run: yarn test-lib
2526
- run: yarn test-app

eslint.config.mjs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ export default typescriptEslint.config([
4848
//
4949
// TypeScript
5050
//
51+
// NOTE: 'recommendedTypeChecked' requires a build step before linting. Unfortunately there is no clear error if
52+
// packages/react-hook-tracer/dist is missing, just lots of @typescript-eslint/no-unsafe-.. errors.
5153
typescriptEslint.configs.recommendedTypeChecked,
5254
{
5355
name: 'typescript-rules',

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"login": "yarn workspace react-hook-tracer npm login --publish",
3232
"pack-lib": "yarn pre-pack-publish && yarn workspace react-hook-tracer pack -o 'dist/%s@%v.tgz'",
3333
"pack-lib-no-test": "yarn clean && yarn build-lib && yarn workspace react-hook-tracer pack -o 'dist/%s@%v.tgz'",
34-
"pre-pack-publish": "yarn prettier-check && yarn lint-check && yarn clean && yarn build",
34+
"pre-pack-publish": "yarn prettier-check && yarn clean && yarn build && yarn lint-check",
3535
"publish-lib": "yarn pre-pack-publish && yarn workspace react-hook-tracer npm publish",
3636
"tag-release": "bash-scripts/tag-release.sh",
3737
"test-lib": "yarn workspace react-hook-tracer test",

0 commit comments

Comments
 (0)