Documentation Index
Fetch the complete documentation index at: https://mintlify.com/remarkjs/remark/llms.txt
Use this file to discover all available pages before exploring further.
remark-cli automatically searches for configuration files as it processes each markdown file, walking up the file system from the file’s directory until it either finds a config file or reaches the filesystem root. This means you can scope configuration to a sub-tree of your project without any extra flags — just drop a .remarkrc.json (or any supported format) into the relevant directory.
Configuration file formats
Eight file names are recognised, checked in the order listed below. The first match wins, so a.remarkrc in the same directory always takes precedence over a package.json further up the tree.
| Priority | File | Format |
|---|---|---|
| 1 | .remarkrc | JSON |
| 2 | .remarkrc.cjs | CommonJS |
| 3 | .remarkrc.json | JSON |
| 4 | .remarkrc.js | CJS or ESM (follows "type" in package.json) |
| 5 | .remarkrc.mjs | ESM |
| 6 | .remarkrc.yaml | YAML |
| 7 | .remarkrc.yml | YAML |
| 8 | package.json (remarkConfig field) | JSON |
JSON config files (
package.json, .remarkrc, .remarkrc.json) do not support comments. If you want to annotate your configuration with explanations, use .remarkrc.js or .remarkrc.yml instead.Config in package.json
Adding a remarkConfig field to your existing package.json is the quickest way to get started — no extra file needed.
Config in .remarkrc.js (ESM)
A JavaScript config file unlocks the full expressiveness of ESM imports, dynamic values, and inline comments. When your package.json sets "type": "module", .remarkrc.js is treated as ESM.
Config in .remarkrc.yml
YAML is a compact, human-readable format that also supports comments. It is a good middle ground between the terseness of JSON and the flexibility of JavaScript.
How config resolution works
Whenremark-cli is about to process a file it climbs the directory tree looking for the nearest config file. Consider this project layout:
folder/subfolder/file.mdis processed usingfolder/subfolder/.remarkrc.json— the closest match.folder/readme.mdis processed usingfolder/.remarkrc.js— the closest match at thefolder/level.
folder/package.json is not used for either file because .remarkrc.js appears earlier in the precedence order and sits at the same level.
Ignoring files with .remarkignore
Place a .remarkignore file anywhere in your project to tell remark-cli which files to skip. Each line is a glob pattern, interpreted the same way as .gitignore entries.
remark-cli discovers .remarkignore files by walking upwards from each processed file, so scoped ignore rules work the same way as scoped config files. You can also point to a custom ignore file with the --ignore-path flag.
The settings field
The settings key in any config file is passed directly to remark-stringify and controls how the markdown serialiser formats output. Common options include:
| Option | Type | Description |
|---|---|---|
bullet | "*" | "+" | "-" | Character used for unordered list items |
emphasis | "*" | "_" | Character used for emphasis (italic) |
strong | "*" | "_" | Character used for strong (bold) |
fence | "`" | "~" | Character used for fenced code blocks |
setext | boolean | Use setext-style headings (=== / ---) |