Skip to content

chore(protocol-core): declare lint dependencies and typecheck scripts/ - #31

Merged
henrypalacios merged 1 commit into
mainfrom
chore/protocol-core-lint-config
Aug 28, 2026
Merged

chore(protocol-core): declare lint dependencies and typecheck scripts/#31
henrypalacios merged 1 commit into
mainfrom
chore/protocol-core-lint-config

Conversation

@henrypalacios

@henrypalacios henrypalacios commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Declare the dependencies the root ESLint flat config imports, so pnpm -r lint runs across the workspace.
  • Bring packages/protocol-core/scripts/ under both lint and typecheck.
  • Add a typecheck script, a root typecheck that recurses like lint, and a CI step so it runs alongside Lint and Build.

Changes

File Change
package.json Declare @eslint/js, typescript-eslint, and typescript. The flat config at the repo root imports the first two, and Node resolves a config file's imports relative to that file, so they belong in the root manifest; typescript is a non-optional peer of typescript-eslint. Add the recursive typecheck script.
packages/protocol-core/package.json Declare eslint so the package's lint script resolves its own binary, and @types/node so the validation script's Node globals come from a stated dependency. Widen lint to src/ scripts/; add typecheck (tsc --noEmit -p tsconfig.json).
packages/protocol-core/tsconfig.json include now covers scripts alongside src, so the address validation script is type-checked and reachable by the type-aware lint rules.
packages/protocol-core/tsup.config.ts Point the build at the existing tsconfig.build.json, so it keeps its own input list rather than following the tsconfig the typecheck widens.
.github/workflows/CI.yml Add a blocking Typecheck step between Lint and Build.
pnpm-lock.yaml Records the new declarations and moves eslint to the newest 9.x.

Build output

dist/ is unchanged — same six files, same byte sizes, identical SHA-256:

4832   dist/index.d.mts     caaa6690f13752877e70ba2d749459d74c97e3b92ba8ba811f9329ff070b95c2
4832   dist/index.d.ts      caaa6690f13752877e70ba2d749459d74c97e3b92ba8ba811f9329ff070b95c2
11345  dist/index.js        3dde65b56386a643d3284b6ca45915dabb6d77061b48f375a84e9263368482aa
25451  dist/index.js.map    62a88339e904832a7799ad03e4ceab4ffb020a91f98b899439e304113d86eeba
10691  dist/index.mjs       ce5d74e01c7347c58888f2261421f23520bf24207d95be5daf76dc336fb15f6a
25450  dist/index.mjs.map   f888fd19d9cc836b56df0be406173503aea981d037a12e2883083907a1645b9f

The tsup tsconfig pin is deliberately a no-op for output: the bundle is defined by entry: ['src/index.ts'], and a build with the pin removed produces the same six checksums. npm pack --dry-run still lists only README.md, package.json, and the six dist/ files.

Test plan

Run from packages/protocol-core unless noted.

  • pnpm lint — exit 0
  • pnpm typecheck — exit 0; --listFiles confirms scripts/validate-addresses.ts is in the program
  • pnpm test — 9 files, 154 tests passed
  • pnpm build — exit 0; dist/ checksums unchanged
  • pnpm validate:addresses — 44 addresses validated across 11 chains
  • Root pnpm -r lint — exit 0, both packages
  • Root pnpm -r typecheck — exit 0; packages/sdk has no typecheck script and is skipped
  • pnpm install --frozen-lockfile — exit 0

Scope

Configuration and dependency declarations only. No src/ logic and no version change. The only CI.yml edit is the added Typecheck step.

The shared ESLint flat config lives at the repo root and imports
`@eslint/js` and `typescript-eslint`, which Node resolves relative to the
config file. Declare those in the root manifest, together with the
`typescript` peer that `typescript-eslint` requires, and declare `eslint`
in protocol-core so its lint script resolves its own binary. `pnpm -r lint`
runs across the workspace.

Extend the package tsconfig to cover `scripts/` so the address validation
script is type-checked and reachable by the type-aware lint rules, and
declare `@types/node` so its Node globals come from a stated dependency
rather than one inherited through the dev dependency graph. Add a
`typecheck` script, a root `typecheck` that recurses like `lint`, and a CI
step so it runs alongside the other checks.

Point tsup at the existing `tsconfig.build.json` so the build keeps its own
input list instead of following the tsconfig that the typecheck widens. The
bundle is defined by `entry`, so this changes no output: `dist/` is
byte-for-byte identical.

Move eslint to the newest 9.x.
@henrypalacios
henrypalacios force-pushed the chore/protocol-core-lint-config branch from c0188b6 to 6772f3f Compare August 28, 2026 01:58
@henrypalacios
henrypalacios merged commit 61a516d into main Aug 28, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant