Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ lint.report = async options => {

if (messages.length === 0) {
spinner.succeed();
if (options.customReporter) {
console.log(options.customReporter([]));
}

return;
}

Expand All @@ -69,7 +73,11 @@ lint.report = async options => {
process.exitCode = 1;

file.path = path.basename(file.path);
console.log(vfileReporterPretty([file]));
if (options.customReporter) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The option name can simply be named reporter.

console.log(options.customReporter([file]));
} else {
console.log(vfileReporterPretty([file]));
}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can be simplified to:

const reporter = options.reporter || vfileReporterPretty;
console.log(reporter([file]));

};

module.exports = lint;
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "awesome-lint",
"version": "0.8.0",
"version": "0.9.0",
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't bump version in a pull request. It's up to the maintainers when, how, and what version to bump :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, my apologies, that makes sense.

"description": "Linter for Awesome lists",
"license": "MIT",
"repository": "sindresorhus/awesome-lint",
Expand Down