Skip to content

build(npm): add ESLint, Prettier and strict TypeScript checks - #35

Closed
google-labs-stitch[bot] wants to merge 6 commits into
mainfrom
stitch/add-eslint-prettier-strict-ts-jm1-2f832837-482f-40cb-b9cb-918a7287e7f3
Closed

google-labs-stitch[bot] wants to merge 6 commits into
mainfrom
stitch/add-eslint-prettier-strict-ts-jm1-2f832837-482f-40cb-b9cb-918a7287e7f3

Conversation

@google-labs-stitch

@google-labs-stitch google-labs-stitch Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Install eslint (^10.15.0), @eslint/js (^10.0.1), typescript-eslint (^8.73.0), eslint-config-prettier (^10.1.8), globals (^17.14.0), prettier (^3.10.1), @eslint/json (^2.1.1), @eslint/markdown (^9.0.0) and eslint-plugin-yml (^3.10.0) in devDependencies.
  • Install typescript (^6.0.3) beside typescript-native (npm:typescript@^7.0.2) so typescript-eslint uses TypeScript 6.0 without peer-dependency conflicts while build:ts and typecheck run TypeScript 7.0.
  • Add eslint.config.mjs for JavaScript (globals.node), TypeScript (recommendedTypeChecked), JSON, YAML and Markdown, and ignore pkg/, dist/, target/, CHANGELOG.md and package-lock.json.
  • Add .prettierrc.json and .prettierignore so prettier --check . ignores pkg/, dist/, target/, CHANGELOG.md and package-lock.json.
  • Enable verbatimModuleSyntax, isolatedDeclarations, noUncheckedIndexedAccess, exactOptionalPropertyTypes, noUnusedLocals and noUnusedParameters in tsconfig.json.
  • Cast the dynamic import(moduleName) result in src/index.ts to satisfy @typescript-eslint/no-unsafe-assignment without a change to the emitted code or declarations.
  • Add format:check, lint and typecheck scripts in package.json, run them in .github/workflows/ci.yml, and document the npm verification sequence in AGENTS.md.

Verification

  • Ran npm ci and npm run format:check on a clean checkout without pkg/ or dist/.
  • Ran RUSTDOCFLAGS="-D warnings" npm run check:wasm, npm run verify:pack, npm run lint and npm run typecheck.
  • Checked that an untyped import of InitInput in src/index.ts fails npm run typecheck with TS1484.
  • Ran cargo fmt --check, cargo clippy --locked --lib -- -D warnings, cargo build --locked --release, RUSTDOCFLAGS="-D warnings" cargo doc --locked --no-deps and cargo package --list --locked.

Automated PR initiated by user @byteland-app via Stitch Loop.

- Install ESLint, Prettier and the JSON, YAML and Markdown plugins.
- Install TypeScript 6.0 beside TypeScript 7.0 in devDependencies.
- Add eslint.config.mjs, .prettierrc.json and .prettierignore.
- Enable the strict compiler flags in tsconfig.json.
- Add format:check, lint and typecheck scripts in package.json.
- Cast the dynamic fs import in src/index.ts.
- Document the npm verification steps in AGENTS.md.
- Keep the build:wasm script without --no-opt from main.
- Keep the build:ts, format:check, lint and typecheck scripts.
- Keep the build:wasm and verify:pack scripts from main.
- Keep the build:ts, format:check, lint and typecheck scripts.
- Add globals to devDependencies for the Node.js scripts.
- Enable globals.node for JavaScript files in eslint.config.mjs.
- Keep the typed fs import in src/index.ts.
- Keep the asynchronous init call from main in src/index.ts.
- Keep the 0.3.0 version from main.
- Keep the 0.3.1 version from main in package.json.
- Keep check:wasm beside the lint and typecheck scripts.
- Update the npm verification commands in AGENTS.md.
- Add format:check, lint and typecheck to .github/workflows/ci.yml.
- Update the npm verification commands in AGENTS.md.
@byteland-app

Copy link
Copy Markdown
Contributor

Closing as superseded by #11. ESLint + Prettier adds 11 devDependencies (+3,235 lockfile lines) and downgrades typescript to 6.0 with an alias hack that causes scripts/verify-pack.mjs to silently type-check against TS 6.0 instead of TS 7.0. Biome in #11 is much lighter and keeps TS 7.0 intact.

@byteland-app
byteland-app deleted the stitch/add-eslint-prettier-strict-ts-jm1-2f832837-482f-40cb-b9cb-918a7287e7f3 branch November 25, 2026 08:07
@google-labs-stitch

Copy link
Copy Markdown
Contributor Author

Acknowledged — leaving #35 closed as superseded by #11, where Biome and the strict TypeScript 7.0 checks are wired into CI and passing.

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