chore: split out format, add type checking#436
Conversation
riley-kohler
left a comment
There was a problem hiding this comment.
I'm ok to move forward with this but ideally would prefer type checking as part of the build workflow. In my view, tsc was built to both type check and transpile so we should retain that. While modern node tooling often leaves out typechecking, typescript code isn't correct if it isn't properly typed.
The only reason I made it a separate workflow is because we are type checking tests, which are not included in the final build. I'd be happy to move that into the build workflow though as a separate job there. It is semantics, really. |
1a26d05 to
8b695b6
Compare
8b695b6 to
acdde49
Compare
acdde49 to
4144209
Compare
That's fair. I guess ideally we would type check the src files as part of the build and tests as part of running the tests though we can implement that down the line. I believe vitest has a built in option for type checking and I would like to migrate to it eventually. |
Makes sense to me! I think Next.js already compiles code using |
- Split format using prettier into format and format:fix - Made lint only run ESLint checks - Updated lint-staged to run format then lint on staged files - Added .github/workflows/style.yml to check formatting - Added .github/workflows/type-check.yml to run TypeScript type checks Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
4144209 to
adafdf4
Compare
|
@riley-kohler I removed the type checking workflow and made type checking run as part of the |
|
I'm fine with that. Especially since vitest would do the same thing. |
|
@zkoppert could you add the |
Separate format and lint scripts and workflows, and add a type checking script and workflow, as discussed in #435
Split format using prettier into
format(check) andformat:fix(write)Made
lintonly run ESLint checks, split Prettier out to newformatscriptsAdd new script to run type checking using
tscUpdated
lint-stagedto runformatthenlinton staged files, and runtype-checkon JS/TS files; no longer fixing changes during commit, as this can lead to unintended changesAdded .github/workflows/style.yml to check formatting
Updated
testto runtype-checkprior to running tests (alternative to keepjesttests fast without usingts-jestfor transformation, can be replaced withvitesttype checking support if we swap tovitestin Switch to ESM #331)