ESLint plugin that does nothing by default but provides comment-driven micro-codemod transformations. Current stable version is 3.5.2. It is actively maintained by Anthony Fu with regular releases. Key differentiators: unlike traditional ESLint rules that enforce code style, this plugin triggers on-demand transforms via special comments (e.g., `/// to-function`, `/// to-promise-all`, `/// reverse-if-else`), leveraging ESLint's fix infrastructure. It is ESM-only since v3, requires ESLint 9+ flat config, and ships TypeScript types. Peer dependencies include @typescript-eslint/utils and eslint.
npm install eslint-plugin-commandVerified import paths — ran on the pinned version, not inferred.
Shows how to set up the plugin using ESLint flat config with two commands enabled.
Use ESM imports (e.g., `import command from 'eslint-plugin-command'`). If you need CJS, stick to v2.x or use dynamic import().
Add rule configurations like `'command/to-function': 'warn'` to your ESLint config.
Add the comment exactly as documented. Ensure the comment is at the top of the code block.
Use `command/keep-sorted-by-keys` instead.
Use `import command from 'eslint-plugin-command'` and ensure your project is ESM (e.g., set `"type": "module"` in package.json).
Run `npm install eslint-plugin-command` and add `import command from 'eslint-plugin-command'` to your flat config.
Add `plugins: { command }` and use `'command/to-function': 'warn'`.