openapi-typescript-fetch
openapi-typescript-fetch copied to clipboard
Improve strictness + add CI through GitHub Actions
This PR contains a couple of changes to make the TS setup more strict + some other minor things:
- Turned up the strictness settings of TypeScript a notch + updated to a slightly newer TypeScript:
- Moves the type checks into the
lint
script + adds a type check for the tests.- Uses
npm-run-all2
to break the lint scripts into individual parts + to run them in parallel - Also uses
npm-run-all2
to break apart thebuild
script and make it clearer
- Uses
- Adds in
type-coverage
to thelint
checks, sets a target for95%
strictness. Allany
andas
are considered to not be strictly typed. Hence replaced mostany
withunknown
to signify that we in fact do not know the type (unknown
) rather than opting out of the typing (any
). - Removes the
.vscode/settings.json
(sorry for this additional change!) as I for a long time was confused why nodist/
appeared in my VSCode. Those files are better kept locally and ignored through.gitignore
(though I didn't add such an ignore now) - Adds in a GitHub Actions workflow with two jobs:
test
andlint
- The
test
runsnpm test
on Node.js 14, 16, 18 and 19 - The
lint
runsnpm run lint
on the latest Node.js LTS (no need to run linting across multiple different versions)
- The
- Updates the
package-lock.json
tolockfileVersion: 2
as this happens automatically when one uses the latest npm and there is no need to use anything but the latest npm nowadays
That's it, I hope I didn't touch on too many things for your liking and/or that I missed explaining any of my changes.