@xsynaptic/mdxlint-config
v2.0.0
Published
Shared mdxlint config and a conditional-write CLI for formatting and linting MDX content
Maintainers
Readme
@xsynaptic/mdxlint-config
Shared mdxlint configuration and a small CLI for formatting and linting MDX content across projects. The config provides healthy remark defaults; the mdxlint-content CLI runs mdxlint over a content package, writing back only the files that actually change.
Note: this package is ESM-only.
Install
npm install -D @xsynaptic/mdxlint-configUse
Config
Re-export the shared config from a project's .mdxlintrc.mjs so both the CLI and the mdxlint VS Code extension read the same rules:
// packages/content/.mdxlintrc.mjs
export { default } from '@xsynaptic/mdxlint-config';Override by spreading it:
import base from '@xsynaptic/mdxlint-config';
export default {
...base,
settings: { ...base.settings, emphasis: '_' },
};CLI
The mdxlint-content bin globs collections/**/*.mdx under the target package, formats each file through mdxlint, and writes back only changed files.
// package.json
{
"scripts": {
"check-content": "mdxlint-content packages/content --root-path=$PWD",
"fix-content": "mdxlint-content packages/content --fix --root-path=$PWD",
},
}Without --fix it reports and exits non-zero on warnings or formatting drift (a quality gate). With --fix it rewrites changed files, and sets editorialFixes on the processor for @xsynaptic/remark-prose-rules if a project uses it. --root-path defaults to the current working directory.
