.github | ||
.husky | ||
.vscode | ||
src | ||
test | ||
.commitlintrc.json | ||
.editorconfig | ||
.eslintrc.json | ||
.gitattributes | ||
.gitignore | ||
.lintstagedrc.json | ||
.markdownlint-cli2.jsonc | ||
.markdownlint.json | ||
.npmrc | ||
.prettierrc.json | ||
.releaserc.json | ||
.taprc | ||
CODE_OF_CONDUCT.md | ||
CONTRIBUTING.md | ||
LICENSE | ||
package-lock.json | ||
package.json | ||
README.md |
markdownlint-rule-relative-links
Custom rule for markdownlint to validate relative links.
📜 About
markdownlint-rule-relative-links is a markdownlint custom rule to validate relative links.
It ensures that relative links that start with ./
or ../
(or not starting with external protocols like http://
or https://
) are working and not "dead" which means that it exists in the file system of the project that uses markdownlint
.
Related links:
Prerequisites
- Node.js >= 16.0.0
Installation
npm install --save-dev markdownlint-rule-relative-links
Configuration
There are various ways markdownlint
can be configured using objects, config files etc. For more information on markdownlint
configuration refer options.config.
We recommend configuring markdownlint-cli2
over markdownlint-cli
for compatibility with the vscode-markdownlint
plugin.
.markdownlint-cli2.jsonc
{
"config": {
"default": true,
"relative-links": true
},
"globs": ["**/*.{md,mdx}"],
"ignores": ["**/node_modules"],
"customRules": ["markdownlint-rule-relative-links"]
}
package.json
{
"scripts": {
"lint:markdown": "markdownlint-cli2"
}
}
Usage
npm run lint:markdown
💡 Contributing
Anyone can help to improve the project, submit a Feature Request, a bug report or even correct a simple spelling mistake.
The steps to contribute can be found in the CONTRIBUTING.md file.