3.0.2 ⢠Published 7 years ago
textlint-formatter v3.0.2
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
- azu/textlint-formatter-codecov: textlint formatter for codecov json.
- azu/textlint-formatter-lcov: textlint formatter for lcov format
Contributing
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :D
License
MIT
3.0.2
7 years ago
3.0.1
7 years ago
3.0.0
8 years ago
2.0.0
8 years ago
2.0.0-next.1
8 years ago
2.0.0-next.0
8 years ago
1.8.0
9 years ago
1.7.5
9 years ago
1.7.4
9 years ago
1.7.3
9 years ago
1.7.2
9 years ago
1.7.1
9 years ago
1.7.0
9 years ago
1.5.2
9 years ago
1.5.1
9 years ago
1.5.0
9 years ago
1.4.1
10 years ago
1.4.0
10 years ago
1.3.2
10 years ago
1.3.1
10 years ago
1.3.0
10 years ago
1.2.0
10 years ago
1.1.5
10 years ago
1.1.4
10 years ago
1.1.3
10 years ago
1.1.2
10 years ago
1.1.1
10 years ago
1.1.0
10 years ago
1.0.1
10 years ago