rollup-plugin-cleanup icon indicating copy to clipboard operation
rollup-plugin-cleanup copied to clipboard

Oddly formatted Turf.js jsDoc comments not removed

Open backspaces opened this issue 4 years ago • 2 comments

I have no idea why, but Turf.js's jsDoc comments have multiple initial spaces after the initial /**:

/**
     * Earth Radius used with the Harvesine formula and approximates using a spherical (non-ellipsoid) Earth.
     *
     * @memberof helpers
     * @type {number}
     */

This causes cleanup({ comments: 'none' }), to not remove them.

Is there a reasonable way for cleanup() to handle this?

Or could you post a regex that just might work? I tried it but my regex fu is lacking! :)

backspaces avatar Jul 18 '21 23:07 backspaces

Oh, forgot: I get the Turf modules from unpkg using the urlResolve plugin, like this:

https://unpkg.com/@turf/[email protected]/dist/es/index.js?module
https://unpkg.com/@turf/boolean-point-in-polygon?module
...and so on

backspaces avatar Jul 18 '21 23:07 backspaces

Note: I just did the same thing with skypack and it apparently did not have the odd format, so cleanup worked like a charm!

backspaces avatar Jul 19 '21 22:07 backspaces