Configuration can be defined in JSON, JSONC, JS, YAML, or TOML files.
Automatic Configuration Lookup:
If --config is not provided, the CLI looks for:
.markdownlint.jsonc, .markdownlint.json, .markdownlint.yaml, or .markdownlint.yml in the current folder..markdownlintrc in the current or all parent folders (supports only INI and JSON, and must not have an extension).
Manual Configuration via --config:
- JS Files: Must have
.js or .cjs extension. If your project is ESM-only ("type": "module" in package.json), use the .cjs extension. JS files must be explicitly provided via --config for security reasons. - TOML Files: Must be explicitly provided via
--config. - JSON Pointer: Use
--configPointer <pointer> to target a specific sub-object within a configuration file (e.g., nesting config inside package.json using /key/subkey).
Rule Overrides:
--enable and --disable override settings in your configuration files.
{
"default": true,
"MD003": { "style": "atx_closed" },
"MD007": { "indent": 4 },
"no-hard-tabs": false,
"whitespace": false
}