unified

Project:remarkjs/remark-lint

Package:unified-lint-rule@1.0.4

  1. Dependencies:1·Dependents:104
  2. unified plugin to make it a bit easier to create linting rules
  1. unified 132
  2. plugin 88
  3. lint 70
  4. rule 64

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, pref) {
  var ext = file.extname

  pref = typeof pref === 'string' ? pref : 'md'

  if (ext && ext.slice(1) !== pref) {
    file.message('Invalid extension: use `' + pref + '`')
  }
}

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, organisation, or community you agree to abide by its terms.

License

MIT © Titus Wormer