UNPKG

textlint

Version:

The pluggable linting tool for natural language.

33 lines 1.24 kB
import { CliOptions } from "./options.js"; type StdinExecuteOption = { cliOptions: CliOptions; text: string; stdinFilename: string; }; type ExecuteOptions = { cliOptions: CliOptions; files: string[]; } | StdinExecuteOption; /** * Encapsulates all CLI behavior for eslint. Makes it easier to test as well as * for other Node.js programs to effectively run the CLI. */ export declare const cli: { /** * Executes the CLI based on an array of arguments that is passed in. * @param {string|string[]} args The arguments to process. * @param {string} [text] The text to lint (used for TTY). * @returns {Promise<number>} The exit code for the operation. */ execute(args: string | Array<string>, text?: string): Promise<number>; /** * execute with cli options * @returns {Promise<number>} exit status * - 0: Success (no lint errors, or files ignored/not found when mixed with existing files) * - 1: Lint errors found or unexpected errors * - 2: File search errors (no files found matching the specified patterns) or fatal errors */ executeWithOptions(executeOptions: ExecuteOptions): Promise<number>; }; export {}; //# sourceMappingURL=cli.d.ts.map