Configuration
What should I configure?
If you're using the VS Code extension with plain HTML, you don't need a configuration file — the recommended preset is applied by default.
You need a configuration file when you want to:
- Use a framework (React, Vue, Svelte, etc.) — set up
parserandspecs - Choose a different preset — set
extends - Customize rules — override rules in the
rulesproperty - Apply rules to specific elements — use
nodeRulesorchildNodeRules
A minimal configuration file looks like this:
{
"extends": ["markuplint:recommended"]
}
For a framework project (e.g., React):
{
"extends": ["markuplint:recommended-react"],
"parser": {
"\\.jsx$": "@markuplint/jsx-parser"
},
"specs": {
"\\.jsx$": "@markuplint/react-spec"
}
}
See Usecases for more real-world examples, or the Properties reference for all available options.
Configuration file
Markuplint automatically searches for a configuration file by recursively looking upward from the directory of the target file. It applies the configuration file closest to each target.
Markuplint stops searching when it finds the closest configuration file. This differs from ESLint's default behavior — it works as if { "root": true } were set.
Use the extends field if you want to inherit from configuration files in parent directories.
Format and filename
The following filenames are recognized, listed by priority:
markuplintfield inpackage.json.markuplintrc.json.markuplintrc.jsonc.markuplintrc.yaml.markuplintrc.yml.markuplintrc.js.markuplintrc.cjs.markuplintrc.mjs.markuplintrc.tsmarkuplint.config.jsmarkuplint.config.cjsmarkuplint.config.mjsmarkuplint.config.tsmarkuplint.config.jsonc
.markuplintrc (without extension) supports JSON (with comments) and YAML formats.
JSON
{
"extends": ["markuplint:recommended"]
}
YAML
extends:
- markuplint:recommended
JavaScript
module.exports = {
extends: ['markuplint:recommended'],
};
TypeScript
import type { Config } from '@markuplint/ml-config';
const config: Config = {
extends: ['markuplint:recommended'],
};
export default config;
Next steps
- Properties — Full reference for all configuration properties
- Usecases — Real-world configuration examples
- Using Presets — Choose the right preset for your project