Skip to content

Instantly share code, notes, and snippets.

@nakajmg
Created October 5, 2016 08:31
Show Gist options
  • Save nakajmg/ed284ae4d3be5ab1a1683580e03927e7 to your computer and use it in GitHub Desktop.
Save nakajmg/ed284ae4d3be5ab1a1683580e03927e7 to your computer and use it in GitHub Desktop.
textlint with prh plugin, execute to dynamically
const TextLintCore = require('textlint').TextLintCore
const prh = require('textlint-rule-prh')
function linter(filePath, rulePaths) {
const core = new TextLintCore()
core.setupRules({prh: prh}, {
prh: {rulePaths, rulePaths}
})
core.lintFile(filePath).then((results) => {
console.log(results)
})
}
linter('/path/to/file.md', ['/path/to/dictionary.yml'])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment