UNPKG

textlint

Version:

The pluggable linting tool for text and markdown.

45 lines (32 loc) 1.16 kB
// LICENSE : MIT "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.textlint = void 0; /* Api is an implemented of linting text. # Usage First, register rules by `api.setupRules`. Second, lint text and get `TextlintResult` by `api.lint*`. Finally, cleanup by `api.resetRules`. ## Concept `textlint.js` intended to lint for a single file. `textlint.js` is Core API. So, carefully use it. You should manage `setupRules` and `resetRules` by the hand. ## FAQ? Q. How to handle multiple files? A. Use `cli-engine` which is wrapped `textlint.js`. ## More detail workflow - load rules - addEventLister each **event** of rule {@link api.setupRules} - parse text to AST(TxtNode) - traverse ast -> emit **event** - report(push message) - display messages with formatter */ const textlint_core_1 = require("./DEPRECATED/textlint-core"); /** * singleton instance * @deprecated use new APIs https://textlint.github.io/docs/use-as-modules.html#new-apis */ exports.textlint = new textlint_core_1.TextLintCore(); //# sourceMappingURL=textlint.js.map