remark-lint/packages/unified-lint-rule
2020-07-02 12:54:10 +02:00
..
index.js Refactor prose 2020-03-24 11:35:17 +01:00
package.json Publish a patch version for all packages 2020-07-02 12:54:10 +02:00
readme.md Change master in links 2020-06-23 12:00:43 +02:00

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