This is useful when using code-generation tools or while migrating to a strict tsconfig.json
, allowing a smother and incremental transition.
- Ignore files based on relative path or regular expression
- Ignore specific TS errors
The exclude
option in tsconfig.json
makes tsc not directly check the file. Unfortunately, if the file is used from another checked file, it will report an error. This way, it will not solve some use cases.
To install:
npm i @pixelmatters/ts-check-filter
To use the filter pipe the results into ts-check-filter
:
tsc --noEmit | npx ts-check-filter
To define the paths to be ignored create a new ts-check-filter.js
file on the project root:
module.exports = {
pathFilterRules: [/src\/__generated__\/.*/],
}
The pathFilterRules
is an array of string
s or RegExp
. In the example above, we use a regular expression to ignore all the files under the __generated__
directory.
Note: If you don't pep anything into the filter it will be waiting for ever for an input.
Display the list of options by executing:
npx ts-check-filter --help
For the development is recommended to use PNPM, since is the tool that is being used to manage dependencies. So to install just run:
pnpm install
To test implementation and check if the code follows the right guidelines, please run:
pnpm test
Whether you're helping us fix bugs, improve the docs, or spread the word, thank you! 💪 🧡
Check out our Contributing Guide for ideas on contributing and setup steps.
Licensed under the BSD-2 License.