How to use the textlint.TextFixEngine function in textlint

To help you get started, we’ve selected a few textlint examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github andrepolischuk / docslint / lib / lintFiles.js View on Github external
module.exports = function lintFiles (input, options) {
  const config = createConfig(options)
  const patterns = input.length === 0 ? ['**/*.md'] : input

  const engine = options.fix
    ? new textlint.TextFixEngine(config)
    : new textlint.TextLintEngine(config)

  return globby(patterns, {gitignore: true})
    .then(paths => engine.executeOnFiles(paths))
    .then(results => {
      if (!options.fix) {
        return results
      }

      const fixer = new TextLintFixer()

      return fixer.write(results).then(() => results)
    })
}
github andrepolischuk / docslint / lib / fixFiles.js View on Github external
module.exports = function fixFiles (paths, options) {
  const engine = new TextFixEngine(options)

  return engine.executeOnFiles(paths).then(results => {
    const fixer = new TextLintFixer()
    return fixer.write(results).then(() => results)
  })
}
github textlint / textlint-app / src / node / infra / textlint / TextlintAPIServer.js View on Github external
get fixEngine() {
        if (this._textFixEngine) {
            return this._textFixEngine;
        }
        const textFixEngine = new textlint.TextFixEngine({
            configFile: this.configFile,
            rulesBaseDirectory: this.rulesBaseDirectory
        });
        this._textFixEngine = textFixEngine;
        return textFixEngine;
    }

textlint

The pluggable linting tool for text and markdown.

MIT
Latest version published 2 months ago

Package Health Score

83 / 100
Full package analysis