Notable Pseudocode Mashups
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

This package has been deprecated

Author message:

See https://github.com/textlint/textlint/issues/455

textlint-formatter

3.0.2 • Public • Published

textlint-formatter

textlint output formatter.

Installation

npm install textlint-formatter

Usage

See formatters/.

Currently, you can use "stylish" (defaults), "checkstyle", "compact", "jslint-xml", "json", "junit", "pretty-error", "table", "tap", and "unix".

const createFormatter = require("textlint-formatter").createFormatter;
const formatter = createFormatter({
    formatterName: "stylish"
});
const output = formatter([
    {
        filePath: "./README.md",
        messages: [
            {
                ruleId: "semi",
                line: 1,
                column: 23,
                message: "Expected a semicolon."
            }
        ]
    }
]);
console.log(output);
/*
./README.md
  1:23  warning  Expected a semicolon  semi
 
✖ 1 problem (0 errors, 1 warning)
*/

API

export declare type FormatterConfig = {
    color?: boolean;
    formatterName: string;
};
export declare function createFormatter(formatterConfig: FormatterConfig): (results: TextlintResult[]) => string;
export interface FormatterDetail {
    name: string;
}
export declare function getFormatterList(): FormatterDetail[];

CLI

$ textlint -f json README.md --rule no-todo | textlint-formatter -f pretty-error --stdin

Other formatter

Contributing

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D

License

MIT

Keywords

none

install

npm i textlint-formatter

Downloadsweekly downloads

923

version

3.0.2

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
  • avatar
  • avatar