How to allow specific comments (parsing hints) with tsconfig?

38 Views Asked by At

Is there a way to allow specific comments in the compiled js files with tsconfig while using the --removeComments: true flag in compilerOptions?

I use istanbul for unit test coverage and it allows skipping coverage tracking for specific lines/method by using the /* istanbul ignore next */ parsing hint. Now when I am using this in my current setup, this comment gets removed during compile time and the method isnt skipped in coverage.

Is this possible to achieve?

I have tried setting removeComments to false and verified that my coverage does increase after this. This verifies that the /* istanbul ignore next */ parsing hint is indeed being removed because of the above flag.

I have tried using // @ts-ignore before the parsing hint but that also didn't help.

0

There are 0 best solutions below