Comparing version 2.0.2 to 2.1.0
@@ -6,2 +6,13 @@ # Change Log | ||
# [2.1.0](https://github.com/4Catalyzer/cli/compare/pedantic@2.0.2...pedantic@2.1.0) (2019-03-06) | ||
### Features | ||
* add with-warnings ([999917f](https://github.com/4Catalyzer/cli/commit/999917f)) | ||
## [2.0.2](https://github.com/4Catalyzer/cli/compare/pedantic@2.0.1...pedantic@2.0.2) (2019-03-06) | ||
@@ -8,0 +19,0 @@ |
15
lib.js
@@ -27,3 +27,10 @@ const path = require('path'); | ||
filePatterns, | ||
{ cwd = process.cwd(), ignorePath, ignoreNodeModules, fix, check }, | ||
{ | ||
cwd = process.cwd(), | ||
withWarnings, | ||
ignorePath, | ||
ignoreNodeModules, | ||
fix, | ||
check, | ||
}, | ||
) => { | ||
@@ -119,3 +126,7 @@ debug('patterns:', filePatterns, 'fix:', fix, 'cwd', cwd); | ||
if (numDifferent || linter.errorCount) { | ||
if ( | ||
numDifferent || | ||
linter.errorCount || | ||
(withWarnings && linter.warningCount) | ||
) { | ||
process.exitCode = 1; | ||
@@ -122,0 +133,0 @@ } |
21
lint.js
@@ -12,11 +12,17 @@ const format = require('./lib'); | ||
describe: 'Automatically fix any fixable errors', | ||
}).option('with-node-modules', { | ||
type: 'boolean', | ||
default: false, | ||
describe: | ||
'By default node_modules is ignored, to opt out of this behavior pass this flag', | ||
}); | ||
}) | ||
.option('with-warnings', { | ||
type: 'boolean', | ||
default: false, | ||
describe: 'Include warnings when triggering a nonzero exit code', | ||
}) | ||
.option('with-node-modules', { | ||
type: 'boolean', | ||
default: false, | ||
describe: | ||
'By default node_modules is ignored, to opt out of this behavior pass this flag', | ||
}); | ||
exports.handler = async argv => { | ||
const { _, patterns, fix, withNodeModules, ...options } = argv; | ||
const { _, patterns, fix, withWarnings, withNodeModules, ...options } = argv; | ||
@@ -26,2 +32,3 @@ await format(patterns, { | ||
check: true, | ||
withWarnings, | ||
ignoreNodeModules: !withNodeModules, | ||
@@ -28,0 +35,0 @@ ...options, |
{ | ||
"name": "pedantic", | ||
"version": "2.0.2", | ||
"version": "2.1.0", | ||
"main": "lib.js", | ||
@@ -40,3 +40,3 @@ "repository": { | ||
}, | ||
"gitHead": "6e68fc579605f9827d6c4046098d25ea4b05a7fc" | ||
"gitHead": "4fa68b40afaac649e42109e7a871775cb0899b97" | ||
} |
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
344475
334