{"id":14155874,"url":"https://github.com/antfu/eslint-plugin-command","last_synced_at":"2025-05-15T00:13:38.480Z","repository":{"id":235944328,"uuid":"791334382","full_name":"antfu/eslint-plugin-command","owner":"antfu","description":"Comment-as-command for one-off codemod with ESLint.","archived":false,"fork":false,"pushed_at":"2025-03-21T02:32:50.000Z","size":1004,"stargazers_count":248,"open_issues_count":4,"forks_count":14,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-13T23:53:32.347Z","etag":null,"topics":["codemod","eslint-plugin"],"latest_commit_sha":null,"homepage":"https://eslint-plugin-command.antfu.me/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/antfu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":["antfu"],"open_collective":"antfu"}},"created_at":"2024-04-24T14:28:41.000Z","updated_at":"2025-04-10T17:17:08.000Z","dependencies_parsed_at":"2024-05-02T09:46:54.731Z","dependency_job_id":"48589dbb-84e1-4254-85d3-8da6d71defb9","html_url":"https://github.com/antfu/eslint-plugin-command","commit_stats":{"total_commits":92,"total_committers":11,"mean_commits":8.363636363636363,"dds":0.2065217391304348,"last_synced_commit":"d416fe5def6e5e48e88870e5bcdf08099ae1b6b8"},"previous_names":["antfu/eslint-plugin-command"],"tags_count":25,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antfu%2Feslint-plugin-command","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antfu%2Feslint-plugin-command/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antfu%2Feslint-plugin-command/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antfu%2Feslint-plugin-command/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/antfu","download_url":"https://codeload.github.com/antfu/eslint-plugin-command/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254249206,"owners_count":22039029,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["codemod","eslint-plugin"],"created_at":"2024-08-17T08:05:03.624Z","updated_at":"2025-05-15T00:13:33.452Z","avatar_url":"https://github.com/antfu.png","language":"TypeScript","readme":"# eslint-plugin-command\n\n[![npm version][npm-version-src]][npm-version-href]\n[![npm downloads][npm-downloads-src]][npm-downloads-href]\n\n[**Documentations**](https://eslint-plugin-command.antfu.me/)\n\nComment-as-command for one-off codemod with ESLint.\n\nhttps://github.com/antfu/eslint-plugin-command/assets/11247099/ec401a21-4081-42d0-8748-9d0376b7d501\n\n## Introduction\n\n**ESLint Plugin Command** is a special kind of ESLint plugin, that by default, **does nothing**. Instead of checking for code quality, it serves as a micro-codemod tool triggers by special comments on-demand, resuse the infrastructure of ESLint.\n\nFor example, one of the built-in commands, `/// to-function` allows you to convert a single arrow function expression to a function declaration.\n\n\u003c!-- eslint-skip --\u003e\n\n```ts\n/// to-function\nconst foo = async \u003cT\u003e(msg: T): void =\u003e {\n  console.log(msg)\n}\n```\n\nWill be transformed to this when you hit save with your editor or run `eslint . --fix`. After executing the command, the comment will also be removed along with the transformation:\n\n```ts\nasync function foo\u003cT\u003e(msg: T): void {\n  console.log(msg)\n}\n```\n\nOne more example that `/// to-promise-all` converts a sequence of `await` expressions to `await Promise.all()`:\n\n\u003c!-- eslint-skip --\u003e\n\n```ts\n/// to-promise-all\nconst foo = await bar().then\nconst { get } = await import('lodash-es')\n```\n\nWill be transformed to:\n\n```ts\nconst [\n  foo,\n  { get },\n] = await Promise.all([\n  bar(),\n  import('lodash-es'),\n] as const)\n```\n\nRefer to the [documentation](https://eslint-plugin-command.antfu.me/) for more details.\n\n## Sponsors\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://cdn.jsdelivr.net/gh/antfu/static/sponsors.circles.svg\"\u003e\n    \u003cimg src='https://cdn.jsdelivr.net/gh/antfu/static/sponsors.circles.svg'/\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n## License\n\nMIT License © 2024-PRESENT [Anthony Fu](https://github.com/antfu)\n\n\u003c!-- Badges --\u003e\n\n[npm-version-src]: https://img.shields.io/npm/v/eslint-plugin-command?style=flat\u0026colorA=080f12\u0026colorB=1fa669\n[npm-version-href]: https://npmjs.com/package/eslint-plugin-command\n[npm-downloads-src]: https://img.shields.io/npm/dm/eslint-plugin-command?style=flat\u0026colorA=080f12\u0026colorB=1fa669\n[npm-downloads-href]: https://npmjs.com/package/eslint-plugin-command\n","funding_links":["https://github.com/sponsors/antfu","https://opencollective.com/antfu"],"categories":["others","TypeScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fantfu%2Feslint-plugin-command","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fantfu%2Feslint-plugin-command","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fantfu%2Feslint-plugin-command/lists"}