In addition to its built-in rules, `markdownlint` lets you enhance the linting experience by passing a list of custom rules using the [`options.customRules` property](../README.md#optionscustomrules).
Custom rules can do everything the built-in rules can and are defined inline or imported from another package ([keyword `markdownlint-rule` on npm](https://www.npmjs.com/search?q=keywords:markdownlint-rule)).
Rules are defined by a name (or multiple names), a description, an optional link to more information, one or more tags, and a function that implements the rule's behavior.
-`tokens` is an `Array` of [`markdown-it` `Token` objects](https://markdown-it.github.io/markdown-it/#Token) with added `line` and `lineNumber` properties.
-`lines` is an `Array` of `String` values corresponding to the lines of the input file/string.
-`frontMatterLines` is an `Array` of `String` values corresponding to any front matter (not present in `lines`).
-`config` is an `Object` corresponding to the rule's entry in `options.config` (if present).
-`onError` is a function that takes a single `Object` parameter with one required and three optional properties:
-`lineNumber` is a required `Number` specifying the 1-based line number of the error.
-`details` is an optional `String` with information about what caused the error.
-`context` is an optional `String` with relevant text surrounding the error location.
-`range` is an optional `Array` with two `Number` values identifying the 1-based column and length of the error.
## Examples
- [Simple rules used by the project's test cases](../test/rules)
- [Code for all `markdownlint` built-in rules](../lib)
- Packages should export a single rule object or an `Array` of rule objects
- [Custom rules from the Microsoft/vscode-docs-authoring repository](https://github.com/Microsoft/vscode-docs-authoring/tree/master/docs-markdown/markdownlint-custom-rules)
- [Custom rules from the axibase/docs-util repository](https://github.com/axibase/docs-util/tree/master/linting-rules)
- [Custom rules from the webhintio/hint repository](https://github.com/webhintio/hint/blob/master/scripts/lint-markdown.js)