Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
@papb this is a pattern I've found useful in a few projects now.
tsconfig.json
which includes all source code but hasnoEmit: true
so is only used for checkingtsconfig.lib.json
which only includessrc
, and extendstsconfig.json
withnoEmit: false
. This is used to produce the actual library output.tsc -p tsconfig.json
is part of the lint step. It makes sure all the code in the project is ok.src
,test
,examples
etc.tsc -p tsconfig.lib.json
is the build step.The benefits are:
npm run lint
. Here's an example from another PR of a change I had to just remember about since it wasn't flagged by CI (the file is underexamples/*
, which wasn't included intsconfig.json
: 435f968tsconfig.json
for settings for typescript hints/red squigglies. One example: this project hasstrictNullChecks: true
, but since tsconfig.json was ignoringtest
, VSCode wasn't showing null errors. ts-jest still caught them, but it's better DX if the IDE knows what's going on.