unified

Project: remarkjs/remark-lint

Package: unified-lint-rule@1.0.6

  1. Dependencies: 1·Dependents: 111
  2. unified plugin to make it a bit easier to create linting rules
  1. unified 146
  2. plugin 130
  3. lint 68
  4. rule 64
  5. unified-plugin 3

unified-lint-rule

Build Coverage Downloads Size Sponsors Backers Chat

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