unified

Project: remarkjs/remark-lint

Package: unified-lint-rule@2.1.0

  1. Dependents: 124
  2. unified plugin to make it a bit easier to create linting rules
  1. unified 173
  2. plugin 137
  3. lint 77
  4. rule 72
  5. unified-plugin 6

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

This package is ESM only: Node 12+ is needed to use it and it must be imported instead of required.

npm:

npm install unified-lint-rule

Use

import {lintRule} from 'unified-lint-rule'

const remarkLintFileExtension = lintRule(
  'remark-lint:file-extension',
  (tree, file, option = 'md') => {
    var ext = file.extname

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

export default remarkLintFileExtension

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