Removes leading, trailing and free-standing comments that live inside function/method/arrow/constructor/accessor bodies, while preserving comments that document declarations and any directive comments needed by the tooling chain (ESLint, TypeScript, coverage, bundlers, license headers).
Rules:
Strip block and line comments whose range falls inside any function/method/constructor/get/set/arrow body block.
With no paths, defaults to src/browser and scripts (recursively), skipping tests, generated artefacts, vendor js/lib, dashboard stubs and declaration files.
Description
Removes leading, trailing and free-standing comments that live inside function/method/arrow/constructor/accessor bodies, while preserving comments that document declarations and any directive comments needed by the tooling chain (ESLint, TypeScript, coverage, bundlers, license headers).
Rules:
eslint-,@ts-,prettier-ignore,c8 ignore,istanbul ignore,webpackIgnore,vite-ignore,__PURE__,@vite-,@license,@preserve,@copyright,@cc_on.Usage: npx tsx scripts/strip-in-method-comments.ts [--check] [--quiet] [pathsโฆ]
With no paths, defaults to
src/browserandscripts(recursively), skipping tests, generated artefacts, vendorjs/lib, dashboard stubs and declaration files.