chore: add git hooks, ESLint/Prettier, and commitlint#57
chore: add git hooks, ESLint/Prettier, and commitlint#57andrefelizardo wants to merge 28 commits intodevelopfrom
Conversation
…tions for improved pre-commit linting
…ged configurations for improved code quality
… formatting and typecheck scripts for improved code quality
…es from ESLint checks
…ries from Prettier formatting
…nhance Git hooks description
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: eb94e420cc
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| root: true, | ||
| parser: "@typescript-eslint/parser", | ||
| parserOptions: { | ||
| project: ["./packages/api/tsconfig.build.json"], |
There was a problem hiding this comment.
Include test files in typed ESLint project
The ESLint config restricts parserOptions.project to packages/api/tsconfig.build.json, but that tsconfig excludes __tests__ while packages/api/package.json now lints __tests__/**/*.{ts,tsx}. Because plugin:@typescript-eslint/recommended-requiring-type-checking is enabled, ESLint will raise parsing errors for those test files not being in the configured TS project, so pnpm lint and the CI lint step will fail until tests are covered by a referenced tsconfig (or removed from the lint target).
Useful? React with 👍 / 👎.
| "packages/contracts/**/*.{ts,tsx,js,jsx}": [ | ||
| "eslint --fix", | ||
| "prettier --write" |
There was a problem hiding this comment.
Stop lint-staged from ESLinting contracts with API tsconfig
This pre-commit rule runs eslint --fix for staged files under packages/contracts, but the only configured TypeScript project for ESLint is ./packages/api/tsconfig.build.json in .eslintrc.cjs. Staging any contracts .ts file will therefore trigger the TypeScript-ESLint "file was not found in any of the provided projects" parsing failure, blocking commits that modify the contracts package.
Useful? React with 👍 / 👎.
…tlint, ESLint, and Prettier
…I and test directories
…ependency at 17.4.0
…e in ESLint config
…y' to 'unknown' for type safety
Test plan