typescript-strict-plugin icon indicating copy to clipboard operation
typescript-strict-plugin copied to clipboard

ts-expect-error always causes lint error in ts-strict files

Open sudall opened this issue 3 years ago • 1 comments

I'm setting up build-time linting for a project (ie. tsc && tsc-strict) and noticed that ts-expect-error will always fail linting if the expected error is due to strict typing because tsc will think that there's no expected error (and say that the ts-expect-error should be removed) while tsc-strict will see the error. Any ideas for how to fix this? Perhaps tsc-strict could do the linting for all files or maybe there's a way to have tsc skip strict files?

For now, the best solution I can think of is to just use ts-ignore instead.

sudall avatar Jan 22 '22 00:01 sudall

Hi, currently tsc alone doesn't have any option to filter or select files from the CLI. In tsc-strict we filter errors produced by strict files in our code. What we could do in the future would be creating a script tsc-no-strict, which would run tsc and filter out every strict file.

kamkry avatar Jan 24 '22 08:01 kamkry