14.0.4 ā€¢ Published 2 months ago

@textlint/linter-formatter v14.0.4

Weekly downloads
17,822
License
MIT
Repository
github
Last release
2 months ago

@textlint/linter-formatter

textlint output formatter.

Installation

npm install @textlint/linter-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/linter-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

14.0.4

2 months ago

14.0.3

2 months ago

14.0.2

3 months ago

14.0.1

3 months ago

14.0.0

3 months ago

13.4.2-next.0

3 months ago

13.4.1

5 months ago

13.3.3

10 months ago

13.4.0

6 months ago

13.3.2

1 year ago

13.3.1

1 year ago

13.1.3

1 year ago

13.1.4

1 year ago

13.1.1

1 year ago

13.3.0

1 year ago

13.1.2

1 year ago

13.1.0

1 year ago

13.0.5

1 year ago

13.2.0

1 year ago

12.6.1

1 year ago

12.6.0

1 year ago

12.2.4

1 year ago

13.0.4

1 year ago

13.0.2

1 year ago

13.0.3

1 year ago

13.0.0

1 year ago

13.0.1

1 year ago

12.5.2

1 year ago

12.3.0

1 year ago

12.3.1

1 year ago

12.5.0

1 year ago

12.2.3

1 year ago

12.2.2

2 years ago

12.2.1

2 years ago

12.2.0

2 years ago

12.1.1

2 years ago

12.1.0

2 years ago

12.0.2

3 years ago

12.0.0-beta.2

3 years ago

12.0.0-beta.3

3 years ago

12.0.0-beta.0

3 years ago

12.0.0-beta.1

3 years ago

12.0.0

3 years ago

3.3.5

3 years ago

3.3.4

3 years ago

3.3.3

3 years ago

3.3.2

3 years ago

3.3.1

3 years ago

3.3.0

3 years ago

3.2.6

3 years ago

3.2.2

4 years ago

3.2.5

4 years ago

3.2.4

4 years ago

3.2.3

4 years ago

3.2.1

4 years ago

3.2.0

4 years ago

3.1.12

4 years ago

3.1.11

4 years ago

3.1.10

4 years ago

3.1.9

4 years ago

3.1.8

5 years ago

3.1.7

5 years ago

3.1.6

5 years ago

3.1.5

5 years ago

3.1.4

5 years ago

3.1.3

5 years ago

3.1.2

5 years ago

3.1.1

5 years ago

3.1.0

5 years ago

3.0.9

5 years ago

3.0.8

6 years ago

3.0.7

6 years ago

3.0.6

6 years ago

3.0.5

6 years ago

3.0.4

6 years ago

3.0.3

6 years ago

3.0.2

6 years ago