perf: speed up monorepo linting and formatting - #792
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
3db9d33 to
7a99f83
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3db9d3376c
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| format: "prettier . --write --cache --cache-location .cache/prettier", | ||
| "format:check": "prettier . --check --cache --cache-location .cache/prettier", |
There was a problem hiding this comment.
Add formatting commands to standalone scaffolds
When singleApp or onlyApi is generated without --monorepo, createPackageJSON never uses rootScripts; it writes singleAppScripts or apiScripts, which only receive the new ESLint-only scripts. Because the shared ESLint configuration no longer invokes Prettier, these generated projects now have neither a formatting command nor a formatting check, and their former lint:fix workflow no longer formats files. Add the explicit Prettier scripts to the standalone script sets as well.
Useful? React with 👍 / 👎.
| # Tool caches | ||
| .cache |
There was a problem hiding this comment.
Ignore tool caches in generated projects
Mirror this ignore in the scaffold templates. The checked root, api, and monorepo .gitignore_template files contain no .cache pattern, while the newly generated lint and format scripts write under .cache/eslint and .cache/prettier (ESLint's --help defines --cache-location as the cache file or directory path). Consequently, running either command in a newly scaffolded project immediately leaves generated cache artifacts in git status.
Useful? React with 👍 / 👎.
Summary
eslint-plugin-prettierin every ESLint processeslint-config-prettier/flatso ESLint rules do not conflict with PrettierlintTurbo task; leavelint:fixuncached because it mutates source filesValidation
pnpm --filter api lint: the updated ESLint command starts and loads the shared config; it then reports 5 existing type-aware errors inapps/api/src/index.tspnpm format:check: the repository already has existing Prettier differences, so it is not yet suitable as a CI gateThe new root
format/format:checkcommands are explicit;lint:fixremains lint-only and no longer triggers a repository-wide formatting rewrite.