prettier-plugin-uncomment weekly downloads statistics
By lassekt · npm · Prettier plugins
Prettier plugin that strips comments from JS/TS/JSX/Flow files, keeping tooling directives and developer-flagged comments.
prettier-plugin-uncomment has 1 recorded weekly downloads on npm, a decrease of 98.8% over the past 30 days.
It ranks #2183 of 2,256 tracked npm listings by weekly downloads.
PluginStats has 543 daily observations since Apr 23, 2025; the latest is from Oct 17, 2026.
About prettier-plugin-uncomment
prettier-plugin-uncomment
A Prettier plugin that strips comments from JavaScript, TypeScript, JSX and Flow files — every // and /* … */ — except comments that mean something to tooling, JSDoc that documents your code, or comments a developer has explicitly flagged to keep.
Install
Usage
On-demand, without installing (recommended)
Stripping comments is destructive, so you usually want to run it deliberately — not on every format. Use Prettier's --plugin flag, which applies the plugin only for that one command and never persists to your config. npx fetches Prettier and the plugin transiently (nothing is added to package.json):
If Prettier and the plugin are already installed in the project, the same run is just:
Your existing Prettier config (print width, semicolons, …) is still read and applied — --plugin only adds this plugin on top for that run.
If you run it often, wrap it in a package.json script. This lives in scripts (not in your Prettier config), so it never triggers on a normal format — only when you invoke it:
Pass the files to strip when you run it: npm run uncomment -- "src/**/*.ts".
Always-on, via config
If you really do want comments stripped on every format, add it to your Prettier config instead:
Then run Prettier as usual (npx prettier --write .). As with any Prettier run, list the folders you never want touched in .prettierignore; see also uncommentIgnorePaths below.
What is kept
Everything else is removed. Comments matching any of the following survive:
Tooling / linter / type-checker directives
• eslint-disable*, eslint-enable, eslint-env • @ts-ignore, @ts-expect-error, @ts-nocheck, @ts-check • /// (triple-slash directives) • prettier-ignore, biome-ignore, deno-lint-ignore, stylelint-ignore, oxlint-ignore, rome-ignore • coverage pragmas: v8 ignore, c8 ignore, istanbul ignore, node:coverage ignore
Build-tool "magic" comments (removing these changes runtime behaviour)
• webpack magic comments (webpackChunkName, webpackPrefetch, webpackIgnore, …) • @vite-ignore • //# sourceMappingURL= / //# sourceURL= • /*#PURE*/, /*#NO_SIDE_EFFECTS*/
Compiler / runtime pragmas & legal banners
• @jsx, @jsxRuntime, @jsxImportSource, @jsxFrag • @flow, @noflow • @license, @preserve, @copyright, and /*! … */ banner comments
JSDoc that documents your code (the docs that feed TS/editor hover info)
• /** … */ blocks containing a recognized JSDoc tag — @param, @returns, @type, @typedef, @template, @satisfies, @callback, @enum, @deprecated, @see, @example, and the like. • Detection uses the same /**-prefix rule TypeScript and editors use to identify a doc comment — no substring guessing. Prose-only /** … */ blocks (doc-comment delimiters with no tag) are still stripped by default; tune this with uncommentJsdoc.
Developer-flagged comments (case-insensitive)
• @hc, @hn, @Hacker Note, @Hacker Comment • TODO, FIXME
Options
| Option | Type | Default | Description |
| uncommentIgnorePaths | string[] | node_modules, dist, build, out, .next, .nuxt, .svelte-kit, coverage, vendor | Path segments whose files are left untouched. Setting this replaces the default list. | | uncommentKeep | string[] | [] | Extra case-insensitive substrings; any comment containing one is kept (extends the keep-list). | | uncommentJsdoc | "tagged" \| "all" \| "off" | "tagged" | How to treat /** … */ blocks. tagged: keep only blocks with a recognized JSDoc tag. all: keep every doc block. off: strip them unless another rule keeps them. |
How it works
Prettier reads the top-level ast.comments array to attach and print comments. The plugin wraps the built-in babel, babel-ts, babel-flow, typescript and flow parsers and filters that array after parsing — dropping every comment except the ones on the keep-list, so the rest are simply never printed. Node locations are left untouched, so the AST stays valid.
Scope & caveats
• Covers the JS/TS parser family (.js, .jsx, .ts, .tsx, Flow). CSS, HTML, Markdown, YAML, GraphQL and other languages are not touched. • Removing a comment that sat alone on its own line can leave the blank line it occupied — the same blank-line behaviour Prettier applies to any gap.
License
ISC
Description from the npm listing.
- prettier
- prettier-plugin
- comments
- uncomment
- strip-comments
- remove-comments
Where prettier-plugin-uncomment sits in the listing
Each band is one page of 20. Weekly downloads on a log scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.
Charts
Images: 30d · 1y · all time · 1600×900 dark
Adoption over time
7/30/90-day growth
Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.
Recent observations
Full history (543)Similar npm Prettier plugins plugins
Data source
Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.
Listing: https://www.npmjs.com/package/prettier-plugin-uncomment. First seen Oct 16, 2026; last successful collection Oct 19, 2026. See the methodology.