Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pixelmatters/ts-check-filter
Filter TS type-check errors based on rules.
https://github.com/pixelmatters/ts-check-filter
Last synced: about 1 month ago
JSON representation
Filter TS type-check errors based on rules.
- Host: GitHub
- URL: https://github.com/pixelmatters/ts-check-filter
- Owner: Pixelmatters
- License: bsd-2-clause
- Created: 2021-10-12T10:48:41.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-03-04T16:13:59.000Z (11 months ago)
- Last Synced: 2024-03-04T18:07:17.672Z (11 months ago)
- Language: TypeScript
- Size: 391 KB
- Stars: 2
- Watchers: 18
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
TS Check Filter
A filter for TypeScript errors.
This is useful when using code-generation tools or while migrating to a stricttsconfig.json
, allowing a smother and incremental transition.## Features
* Ignore files based on relative path or regular expression
* Ignore specific TS errors## Why can not be excluded on TypeScript?
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.
## Usage
To install:
```bash
npm i @pixelmatters/ts-check-filter
```To use the filter pipe the results into `ts-check-filter`:
```bash
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:
```js
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.
### Options
Display the list of options by executing:
```
npx ts-check-filter --help
```## Development
For the development is recommended to use [PNPM](https://pnpm.io/), since is the tool that is being used to manage dependencies. So to install just run:
```bash
pnpm install
```To test implementation and check if the code follows the right guidelines, please run:
```bash
pnpm test
```## ๐ค How to Contribute
Whether you're helping us fix bugs, improve the docs, or spread the word, thank you! ๐ช ๐งก
Check out our [**Contributing Guide**](https://github.com/Pixelmatters/tes-check-filter/blob/main/CONTRIBUTING.md) for ideas on contributing and setup steps.
## ๐ License
Licensed under the [BSD-2 License](./LICENSE).