markdownlint-cli
Advanced tools
Comparing version 0.4.1 to 0.5.0
@@ -64,14 +64,24 @@ #!/usr/bin/env node | ||
if (hasErrors) { | ||
process.stderr.write(lintResult.toString(), process.exit.bind(process, 1)); | ||
} else { | ||
console.log(lintResult.toString()); | ||
console.error(lintResult.toString()); | ||
// Note: process.exit(1) will end abruptly, interrupting asynchronous IO | ||
// streams (e.g., when the output is being piped). Just set the exit code | ||
// and let the program terminate normally. | ||
// @see {@link https://nodejs.org/dist/latest-v8.x/docs/api/process.html#process_process_exit_code} | ||
// @see {@link https://github.com/igorshubovych/markdownlint-cli/pull/29#issuecomment-343535291} | ||
process.exitCode = 1; | ||
return; | ||
} | ||
var result = lintResult.toString(); | ||
if (result) { | ||
console.log(result); | ||
} | ||
} | ||
function notEmptyObject(item) { | ||
return Object.keys(item).length > 0; | ||
} | ||
function hasResultErrors(lintResult) { | ||
function notEmptyObject(item) { | ||
return Object.keys(item).length > 0; | ||
} | ||
return values(lintResult) | ||
.some(notEmptyObject); | ||
return values(lintResult).some(notEmptyObject); | ||
} | ||
@@ -78,0 +88,0 @@ |
{ | ||
"name": "markdownlint-cli", | ||
"version": "0.4.1", | ||
"version": "0.5.0", | ||
"description": "MarkdownLint Command Line Interface", | ||
@@ -13,2 +13,3 @@ "main": "markdownlint.js", | ||
"scripts": { | ||
"invalid": "node ./markdownlint.js --config test/test-config.json -- test/incorrect.md", | ||
"test": "ava test/", | ||
@@ -15,0 +16,0 @@ "watch": "npm test -- --watch --tap | tap-growl", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8012
91