unified-lint-rule
unified plugin to make it a bit easier to create linting rules.
Each rule in remark-lint
uses this project, so see that for examples!
Install
npm:
npm install unified-lint-rule
Use
var rule = require('unified-lint-rule')
module.exports = rule('remark-lint:file-extension', fileExtension)
function fileExtension(tree, file, option) {
var ext = file.extname
var preferred = typeof option === 'string' ? option : 'md'
if (ext && ext.slice(1) !== preferred) {
file.message('Incorrect extension: use `' + preferred + '`')
}
}
Contribute
See contributing.md
in remarkjs/.github
for ways
to get started.
See support.md
for ways to get help.
This project has a code of conduct.
By interacting with this repository, organization, or community you agree to
abide by its terms.
License
MIT © Titus Wormer