Thanks for your interest in contributing! This project uses standard GitHub flow: open an issue or pull request from a fork.
npm installRun the Makefile targets below so your PR stays green.
These targets mirror the GitHub Actions workflows. Run them locally before pushing.
-
Lints
markdownlint-rules/*.jswith ESLint (recommended + complexity/max-lines). -
Same as the JS Lint workflow.
make lint-js
Optional: limit to specific paths:
make lint-js PATHS="markdownlint-rules/heading-title-case.js,markdownlint-rules/utils.js"
-
Positive test:
md_test_files/positive_general.md(and otherpositive_*.md) must pass markdownlint (0 errors). -
Negative tests: each
md_test_files/negative_*.mdfile must fail markdownlint; the test suite fails if any negative file passes. -
Same behavior as the Markdownlint tests workflow.
make test-markdownlint
When adding or changing a custom rule, add or update a
negative_*.mdfixture so the intended violation is covered. See md_test_files/README.md for which file exercises which rule.
-
Unit tests for each custom rule in
test/markdownlint-rules/*.test.js(Node built-in test runner). -
Same as the Rule unit tests workflow.
make test-rules
- Security tests (
test/markdownlint-rules/security.test.js): assert that invalid or malformed regex in rule config does not throw (defensive parsing). A skipped test documents ReDoS risk when rules use user-controlled regex; enable it after adding mitigation (e.g. safe-regex or timeout). - Security lint:
eslint-plugin-securityis enabled formarkdownlint-rules(viamake lint-js) and forbidseval,new Function,child_process, non-literalrequire/fs/Buffer, and similar.
These execute as part of make test-rules and make lint-js respectively.
make ci includes these in all the checks it executes.
-
Unit tests for
test-scripts/intest-scripts/test_*.py(unittest). -
Same as the Python tests workflow.
make test-python
-
Lints all
**/README.mdfiles with markdownlint (including custom rules). -
Same as the Lint READMEs workflow.
make lint-readmes
Requires
markdownlint-cli2on your path (e.g. fromnpm installin this repo, or install globally).
Run all CI checks (same as GitHub Actions):
make ciOr run individual targets: make lint-js && make test-rules && make test-markdownlint && make lint-python && make test-python && make lint-readmes
- Rule code lives in markdownlint-rules/.
Do not register
utils.jsas a rule; it is a shared helper. - Config for custom rules is in .markdownlint.yml.
Rule docs and reuse instructions are in markdownlint-rules/README.md.
For ascii-only path options, the README lists current keys with
(formerly "oldName")for each renamed option.
The Makefile comments state that lint-js, test-markdownlint, test-rules, test-python, and lint-readmes must be kept in sync with their respective workflows.
If you change what gets run in CI, update the corresponding Makefile target and the ci target so local make ci matches.