Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support /*! istanbul ignore ... */ comments #658

Open
nujarum opened this issue Dec 13, 2021 · 3 comments · May be fixed by #693
Open

Support /*! istanbul ignore ... */ comments #658

nujarum opened this issue Dec 13, 2021 · 3 comments · May be fixed by #693

Comments

@nujarum
Copy link

nujarum commented Dec 13, 2021

Some of the bundlers/transpilers used in the world drop /* ... */ comments (e.g., esbuild).
However, such tools seem to preserve comments starting with /*! or //! intact.

So it would be very helpful if you would consider supporting /*! istanbul ignore XXX */ comments.

Best regards,

@bcoe
Copy link
Member

bcoe commented Dec 20, 2021

@nujarum this seems like a great feature request.

@AriPerkkio
Copy link
Contributor

I guess this feature request is coming from esbuild's and terser's behavior. With those two you could just use /* istanbul ignore -- @preserve */.

-/* istanbul ignore if */
+/* istanbul ignore if -- @preserve */
if (condition) {

(Also cc @kindoflew for the linked PR)

@kindoflew
Copy link

@AriPerkkio oh cool, thanks!

I had previously tested with both @license and @preserve and it didn't seem to be working, but I just tried again and it totally does.

it was probably just something weird with how my project was set up (we had just updated to a monorepo structure and there were a handful of hiccups with some configs).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants