CLI tool to add @ts-expect-errors to typescript type errors
See the codeCli tool to add comments to suppress typescript type errors.
Add @ts-expect-error or @ts-ignore comments to all locations where errors are occurring.
Support for .ts, .tsx, .vue.

.ts and .tsxRun the script in the directory where tsconfig.json is located.
$ npx suppress-ts-errors
.vueWhen targeting vue sfc, the path of the vue component must be specified with the glob pattern.
Notice: It does not support commenting out type errors in the <template> section of vue, only the <script> section.
$ npx suppress-ts-errors vue src/**/*.vue
| option | default | description |
|---|---|---|
| -t, --tsconfig-path | ./tsconfig.json | Path to tsconfig.json. |
| -c, --comment-type | 1 | Choice of inserted comment type. 1 is @ts-expect-error, 2 is @ts-ignore. |
| -e, --error-code | true | Add error code to comment. e.g. TS2345. |
| -g, --glob | undefined | Add a specific glob for error suppression (prevents script from processing all files and their dependencies) |
| -m, --message | undefined | Add a custom message to the comment. |
Contributions are welcome π
We accept contributions via Pull Requests. See this guide on how to make a contribution.
suppress-ts-errors is available under the MIT License.
573 followers Β· starred Mar 2025
290 followers Β· starred Dec 2024
122 followers Β· starred Aug 2023
176 followers Β· starred Feb 2023
CLI tool to add @ts-expect-errors to typescript type errors
See the codeCli tool to add comments to suppress typescript type errors.
Add @ts-expect-error or @ts-ignore comments to all locations where errors are occurring.
Support for .ts, .tsx, .vue.

.ts and .tsxRun the script in the directory where tsconfig.json is located.
$ npx suppress-ts-errors
.vueWhen targeting vue sfc, the path of the vue component must be specified with the glob pattern.
Notice: It does not support commenting out type errors in the <template> section of vue, only the <script> section.
$ npx suppress-ts-errors vue src/**/*.vue
| option | default | description |
|---|---|---|
| -t, --tsconfig-path | ./tsconfig.json | Path to tsconfig.json. |
| -c, --comment-type | 1 | Choice of inserted comment type. 1 is @ts-expect-error, 2 is @ts-ignore. |
| -e, --error-code | true | Add error code to comment. e.g. TS2345. |
| -g, --glob | undefined | Add a specific glob for error suppression (prevents script from processing all files and their dependencies) |
| -m, --message | undefined | Add a custom message to the comment. |
Contributions are welcome π
We accept contributions via Pull Requests. See this guide on how to make a contribution.
suppress-ts-errors is available under the MIT License.
573 followers Β· starred Mar 2025
290 followers Β· starred Dec 2024
122 followers Β· starred Aug 2023
176 followers Β· starred Feb 2023