{"_id":"mdxlint","name":"mdxlint","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"mdxlint","version":"1.0.0","description":"A unified-engine base CLI for MDX","keywords":["cli","format","formatter","lint","linter","mdast","mdx","remark","unified"],"homepage":"https://github.com/remcohaszing/mdxlint#readme","bugs":{"url":"https://github.com/remcohaszing/mdxlint/issues"},"repository":{"type":"git","url":"git+https://github.com/remcohaszing/mdxlint.git"},"funding":"https://github.com/sponsors/remcohaszing","license":"MIT","author":{"name":"Remco Haszing","email":"remcohaszing@gmail.com"},"sideEffects":false,"type":"module","exports":"./lib/mdxlint.js","bin":{"mdxlint":"lib/bin.js"},"scripts":{"test":"c8 node --test"},"dependencies":{"@types/mdast":"^4.0.0","remark-mdx":"^3.0.0","remark-parse":"^11.0.0","remark-stringify":"^11.0.0","unified":"^11.0.0","unified-args":"^11.0.0"},"devDependencies":{"@remcohaszing/eslint":"^11.0.0","@types/node":"^24.0.0","c8":"^10.0.0","mdxlint":".","prettier":"^3.0.0","remark-cli":"^12.0.0","remark-preset-remcohaszing":"^3.0.0","typescript":"^5.0.0"},"_id":"mdxlint@1.0.0","gitHead":"ecaf5d56dc16aa9542129eb06c143e60862e8142","_nodeVersion":"22.18.0","_npmVersion":"10.9.3","dist":{"integrity":"sha512-EEOFUOYM1VPPqW/l1WyTxEiL8N1+LBNSBpzPk/Aq4z8UkfA19Abo75pK3qRZAi3MEW9NHK49+Fz0BdRrwLVzaQ==","shasum":"21fba2e8d38e6df22055ff13b73ea221fd03d0d8","tarball":"https://registry.npmjs.org/mdxlint/-/mdxlint-1.0.0.tgz","fileCount":7,"unpackedSize":9590,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCDxEMJy2Ee9Hx4J2Ffq2vqDpY++ad6W75Jagqy0bKu0wIhAIcscOqZrvUkBhFUKD6bnrbwUtrYBg0HsuIQFVbcDBht"}]},"_npmUser":{"name":"remcohaszing","email":"remcohaszing@gmail.com"},"directories":{},"maintainers":[{"name":"remcohaszing","email":"remcohaszing@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/mdxlint_1.0.0_1755513934557_0.04791888897442109"},"_hasShrinkwrap":false}},"time":{"created":"2025-08-18T10:45:34.556Z","1.0.0":"2025-08-18T10:45:34.759Z","modified":"2025-08-18T10:45:34.992Z"},"maintainers":[{"name":"remcohaszing","email":"remcohaszing@gmail.com"}],"description":"A unified-engine base CLI for MDX","homepage":"https://github.com/remcohaszing/mdxlint#readme","keywords":["cli","format","formatter","lint","linter","mdast","mdx","remark","unified"],"repository":{"type":"git","url":"git+https://github.com/remcohaszing/mdxlint.git"},"author":{"name":"Remco Haszing","email":"remcohaszing@gmail.com"},"bugs":{"url":"https://github.com/remcohaszing/mdxlint/issues"},"license":"MIT","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<img alt=\"\" src=\"./logo.svg\">\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","readmeFilename":"README.md","_rev":"1-039b8455e221e1c2653438d8930269ce"}