{"id":15155403,"url":"https://github.com/remcohaszing/remark-prettier","last_synced_at":"2025-09-30T03:31:06.874Z","repository":{"id":57353005,"uuid":"346466610","full_name":"remcohaszing/remark-prettier","owner":"remcohaszing","description":"Check and format markdown or MDX using Prettier as a remark plugin","archived":true,"fork":false,"pushed_at":"2023-07-16T10:49:17.000Z","size":306,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-09-26T18:21:42.703Z","etag":null,"topics":["markdown","prettier","remark","remark-plugin","unified"],"latest_commit_sha":null,"homepage":"","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/remcohaszing.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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}},"created_at":"2021-03-10T19:20:40.000Z","updated_at":"2024-01-30T22:53:19.000Z","dependencies_parsed_at":"2024-09-26T18:21:44.258Z","dependency_job_id":"ccf8da6e-274c-4c9d-8250-45b11a158d68","html_url":"https://github.com/remcohaszing/remark-prettier","commit_stats":{"total_commits":23,"total_committers":1,"mean_commits":23.0,"dds":0.0,"last_synced_commit":"891b1ecfd2da48d52d6e4ed6253eeb89cfb27bee"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remcohaszing%2Fremark-prettier","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remcohaszing%2Fremark-prettier/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remcohaszing%2Fremark-prettier/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remcohaszing%2Fremark-prettier/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/remcohaszing","download_url":"https://codeload.github.com/remcohaszing/remark-prettier/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234695724,"owners_count":18873024,"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":["markdown","prettier","remark","remark-plugin","unified"],"created_at":"2024-09-26T18:21:22.865Z","updated_at":"2025-09-30T03:31:01.610Z","avatar_url":"https://github.com/remcohaszing.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Remark Prettier\n\n[![github actions](https://github.com/remcohaszing/remark-prettier/actions/workflows/ci.yml/badge.svg)](https://github.com/remcohaszing/remark-prettier/actions/workflows/ci.yml)\n[![codecov](https://codecov.io/gh/remcohaszing/remark-prettier/branch/master/graph/badge.svg)](https://codecov.io/gh/remcohaszing/remark-prettier)\n[![npm](https://img.shields.io/npm/v/remark-prettier)](https://www.npmjs.com/package/remark-prettier)\n[![prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://prettier.io)\n\nCheck and format markdown using Prettier as a [remark](https://github.com/remarkjs/remark) plugin\n\n\u003e **Warning** This project has been deprecated in favor of\n\u003e [`unified-consistency`](https://github.com/remcohaszing/unified-consistency) and\n\u003e [`unified-prettier`](https://github.com/remcohaszing/unified-prettier).\n\n## Installation\n\n`remark-prettier` has a peer dependency on [prettier](https://prettier.io)\n\n```sh\nnpm install prettier remark-prettier\n```\n\n## Usage\n\nBy default this plugin does 2 things:\n\n- Report differences from the Prettier formatting.\n- Format the document using Prettier.\n\nIt has support for Prettier configuration files: `.editorconfig`, `.prettierrc*`, and\n`.prettierignore`.\n\nFor example, running `remark --use remark-prettier .` may yield:\n\n```sh\nREADME.md\n  18:30-19:1  warning  Replace `⏎` with `·`  replace  prettier\n        38:1  warning  Insert `⏎`            insert   prettier\n  40:32-41:1  warning  Delete `⏎`            delete   prettier\n```\n\nThis can also be spcified in a `.remarkrc` file:\n\n```json\n{\n  \"plugins\": [\"remark-prettier\"]\n}\n```\n\nThis plugin can also be used with programmatically:\n\n```js\nimport remark from 'remark';\nimport remarkPrettier from 'remark-prettier';\nimport { readSync } from 'to-vfile';\n\nremark()\n  .use(remarkPrettier)\n  .process(readSync('README.md'))\n  .then(({ messages, value }) =\u003e {\n    // Formatted content\n    console.log(value);\n\n    // Prettier formatting violations\n    console.dir(messages);\n  });\n```\n\n`remark-prettier` registers a unified compiler. This means this plugin is used for formatting the\ndocument. Usually this is done by `remark-stringify`. When building a custom unified processor,\n`remark-stringify` can be omitted. If multiple compilers are registered, the last one registered is\nused.\n\n```js\nimport remarkParse from 'remark-parse';\nimport remarkPrettier from 'remark-prettier';\nimport { readSync } from 'to-vfile';\nimport unified from 'unified';\n\nunified()\n  .use(remarkParse)\n  .use(remarkPrettier)\n  .process(readSync('README.md'))\n  .then(({ messages, value }) =\u003e {\n    // Formatted content\n    console.log(value);\n\n    // Prettier formatting violations\n    console.dir(messages);\n  });\n```\n\n### Options\n\nThe first argument may contain the options below. A second argument may specify overrides for the\nPrettier configuration, although this isn’t recommended.\n\n## `format`\n\nBy default `remark-prettier` registers a unified compiler, which formats the document using\nPrettier. This behaviour can be disabled by setting this option to `false`. (Default `true`)\n\n## `report`\n\nBy default `remark-prettier` reports differences from document as Prettier would format it. This\nbehaviour can be disabled by setting this option to `false`. (Default `true`)\n\n## See also\n\n- [eslint-plugin-prettier](https://github.com/prettier/eslint-plugin-prettier)\n- [prettier](https://prettier.io)\n- [remark](https://github.com/remarkjs/remark)\n- [stylelint-prettier](https://github.com/prettier/stylelint-prettier)\n\n## License\n\n[MIT](LICENSE.md) © [Remco Haszing](https://github.com/remcohaszing)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fremcohaszing%2Fremark-prettier","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fremcohaszing%2Fremark-prettier","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fremcohaszing%2Fremark-prettier/lists"}