{"id":29530102,"url":"https://github.com/remcohaszing/mdxlint","last_synced_at":"2025-07-20T02:03:10.596Z","repository":{"id":304502162,"uuid":"1018969423","full_name":"remcohaszing/mdxlint","owner":"remcohaszing","description":"A CLI to lint and format MDX content.","archived":false,"fork":false,"pushed_at":"2025-07-13T13:08:24.000Z","size":65,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-13T15:23:08.022Z","etag":null,"topics":["cli","format","formatter","lint","linter","mdast","mdx","remark","unified"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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,"zenodo":null},"funding":{"github":"remcohaszing"}},"created_at":"2025-07-13T13:06:01.000Z","updated_at":"2025-07-13T14:22:47.000Z","dependencies_parsed_at":"2025-07-13T15:23:59.934Z","dependency_job_id":"10bd3ab0-f79a-4aa4-a3ee-a99edf1d274a","html_url":"https://github.com/remcohaszing/mdxlint","commit_stats":null,"previous_names":["remcohaszing/mdxlint"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/remcohaszing/mdxlint","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remcohaszing%2Fmdxlint","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remcohaszing%2Fmdxlint/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remcohaszing%2Fmdxlint/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remcohaszing%2Fmdxlint/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/remcohaszing","download_url":"https://codeload.github.com/remcohaszing/mdxlint/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remcohaszing%2Fmdxlint/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265543778,"owners_count":23785494,"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":["cli","format","formatter","lint","linter","mdast","mdx","remark","unified"],"created_at":"2025-07-16T22:02:20.011Z","updated_at":"2025-07-16T22:06:53.746Z","avatar_url":"https://github.com/remcohaszing.png","language":"JavaScript","funding_links":["https://github.com/sponsors/remcohaszing"],"categories":[],"sub_categories":[],"readme":"# mdxlint\n\n[![github actions](https://github.com/remcohaszing/mdxlint/actions/workflows/ci.yaml/badge.svg)](https://github.com/remcohaszing/mdxlint/actions/workflows/ci.yaml)\n[![codecov](https://codecov.io/gh/remcohaszing/mdxlint/branch/main/graph/badge.svg)](https://codecov.io/gh/remcohaszing/mdxlint)\n[![npm version](https://img.shields.io/npm/v/mdxlint)](https://www.npmjs.com/package/mdxlint)\n[![npm downloads](https://img.shields.io/npm/dm/mdxlint)](https://www.npmjs.com/package/mdxlint)\n\n\u003cimg alt=\"\" src=\"./logo.svg\"\u003e\n\nA CLI to lint and format [MDX](https://mdxjs.com) content.\n\n## Table of Contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n- [Configuration file](#configuration-file)\n  - [Plugins](#plugins)\n  - [Settings](#settings)\n- [API](#api)\n  - [`defineConfig(config)`](#defineconfigconfig)\n  - [`mdxlint`](#mdxlint-1)\n- [Examples](#examples)\n  - [Syntax extensions](#syntax-extensions)\n  - [Linting](#linting)\n  - [Spell checking](#spell-checking)\n  - [Consistent formatting](#consistent-formatting)\n- [Prettier](#prettier)\n- [Compatibility](#compatibility)\n- [Related projects](#related-projects)\n- [Sponsoring](#sponsoring)\n- [License](#license)\n\n## Installation\n\n```sh\nnpm install mdxlint\n```\n\n## Usage\n\nCheck all `.mdx` files for lint violations:\n\n```sh\nmdxlint . --frail\n```\n\nTransform and format all `.mdx` files:\n\n```sh\nmdxlint . --output\n```\n\nFor more options, see:\n\n```sh\nmdxlint --help\n```\n\n## Configuration file\n\nThe mdxlint CLI loads one the following configuration files:\n\n- The `mdxlint` key in `package.json`\n- `.mdxlintrc`\n- `.mdxlintrc.json`\n- `.mdxlintrc.js`\n- `.mdxlintrc.cjs`\n- `.mdxlintrc.mjs`\n- `.mdxlintrc.yml`\n- `.mdxlintrc.yaml`\n\nIgnore patterns can be specified in `.mdxlintignore`.\n\n### Plugins\n\nThe `plugins` property specifies which plugins or presets to load. All\n[remark plugins](https://github.com/remarkjs/remark/blob/main/doc/plugins.md) and\n[remark-lint rules](https://github.com/remarkjs/remark-lint#rules) are supported.\n\n### Settings\n\nThe `settings` property specifies how content is formatted. It accepts the same fields as the\n[options](https://github.com/remarkjs/remark/tree/main/packages/remark-stringify#options) from\n`remark-stringify`.\n\n## API\n\n### `defineConfig(config)`\n\nA type-safe way to define a mdxlint configuration.\n\n#### Arguments\n\n- `config` (`Config`) — The configuration.\n\n#### Returns\n\nThe configuration.\n\n### `mdxlint`\n\nA unified [processor](https://github.com/unifiedjs/unified#processor) which can process MDX content.\n\n## Examples\n\n### Syntax extensions\n\nThe following `.mdxlintrc.json` file adds support for [GFM](https://github.com/remarkjs/remark-gfm)\nand [frontmatter](https://github.com/remarkjs/remark-frontmatter) with TOML and YAML syntax.\n\n```json\n{\n  \"plugins\": [\"remark-gfm\", [\"remark-frontmatter\", [\"toml\", \"yaml\"]]]\n}\n```\n\n### Linting\n\nThe following `.mdxlintrc.js` file reports errors if link definitions or JSX attributes are not\nsorted.\n\n```js\nimport { defineConfig } from 'mdxlint'\n\nexport default defineConfig({\n  plugins: ['remark-lint-definition-sort', 'remark-lint-mdx-jsx-attribute-sort']\n})\n```\n\n### Spell checking\n\nThe following `.mdxlintrc.mjs` file does spell checking based on\n[retext plugins](https://github.com/retextjs/retext/blob/main/doc/plugins.md).\n\n```js\n/**\n * @import { Config } from 'mdxlint'\n */\n\nimport dictionary from 'dictionary-en'\nimport remarkRetext from 'remark-retext'\nimport retextEnglish from 'retext-english'\nimport retextSpell from 'retext-spell'\nimport retextSyntaxURLs from 'retext-syntax-urls'\nimport { unified } from 'unified'\n\n/** @type {Config} */\nexport default {\n  plugins: [\n    [\n      remarkRetext,\n      unified().use(retextEnglish).use(retextSyntaxURLs).use(retextSpell, { dictionary })\n    ]\n  ]\n}\n```\n\n### Consistent formatting\n\nThe following `.mdxlintrc.yaml` file ensures the file is always formatted, where a hyphen (`-`) is\nused for bullet lists. It also makes sure the table of contents is always up-to-date.\n\n```yaml\nsettings:\n  bullet: '-'\nplugins:\n  - remark-toc\n  - unified-consistency\n```\n\n## Prettier\n\nUnfortunately Prettier doesn’t support MDX 3. If you use Prettier, add the following to your\n`.prettierignore`:\n\n```ignore\n*.mdx\n```\n\n## Compatibility\n\nThis project is compatible with Node.js 20 or greater.\n\n## Related projects\n\n- [`remark-cli`](https://github.com/remarkjs/remark/tree/main/packages/remark-cli) can lint and\n  format markdown content.\n- [`eslint-plugin-mdx`](https://github.com/mdx-js/eslint-mdx) can check MDX files using ESLint. It\n  can also apply remark rules via the [`mdx/remark`](https://github.com/mdx-js/eslint-mdx#mdxremark)\n  rule.\n\n## Sponsoring\n\nIf you like this project, consider sponsoring me via\n[GitHub Sponsors](https://github.com/sponsors/remcohaszing).\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%2Fmdxlint","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fremcohaszing%2Fmdxlint","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fremcohaszing%2Fmdxlint/lists"}