broccoli-standard
Advanced tools
Comparing version 0.1.2 to 0.1.3
@@ -5,2 +5,4 @@ const Filter = require('broccoli-persistent-filter') | ||
const path = require('path') | ||
const md5Hex = require('md5-hex') | ||
const stringify = require('json-stable-stringify') | ||
const escapeStringRegexp = require('escape-string-regexp') | ||
@@ -142,26 +144,25 @@ const BUILD_DIR_REGEXP = new RegExp('(' + escapeStringRegexp(path.sep) + ')?build(' + escapeStringRegexp(path.sep) + ')?$') | ||
StandardValidationFilter.prototype.postProcess = function postProcess({ report, output } /* , relativePath */) { | ||
// if verification has result | ||
if (report.results.length && | ||
report.results[0].messages.length) { | ||
StandardValidationFilter.prototype.postProcess = function postProcess ({ report, output } /* , relativePath */) { | ||
// if verification has result | ||
if (report.results.length && | ||
report.results[0].messages.length) { | ||
const throwOnWarn = !!this.internalOptions.throwOnWarn | ||
const throwOnError = !!this.internalOptions.throwOnError | ||
const throwOnWarn = !!this.internalOptions.throwOnWarn; | ||
const throwOnError = !!this.internalOptions.throwOnError; | ||
if (throwOnWarn || throwOnError) { | ||
const resultSeverity = getResultSeverity(report.results[0].messages) | ||
if (throwOnWarn || throwOnError) { | ||
const resultSeverity = getResultSeverity(report.results[0].messages); | ||
if (resultSeverity === 1 && throwOnWarn) { | ||
throw new Error('rules violation with `warn` severity level') | ||
} | ||
if (resultSeverity === 1 && throwOnWarn) { | ||
throw new Error('rules violation with `warn` severity level'); | ||
} | ||
if (resultSeverity >= 2 && (throwOnWarn || throwOnError)) { | ||
throw new Error('rules violation with `error` severity level') | ||
} | ||
} | ||
} | ||
if (resultSeverity >= 2 && (throwOnWarn || throwOnError)) { | ||
throw new Error('rules violation with `error` severity level'); | ||
} | ||
} | ||
} | ||
return { | ||
output | ||
}; | ||
}; | ||
return { | ||
output | ||
} | ||
} |
{ | ||
"name": "broccoli-standard", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"description": "broccoli filter for standard formatting", | ||
@@ -40,5 +40,6 @@ "main": "lib/index.js", | ||
"broccoli-persistent-filter": "^1.2.11", | ||
"escape-string-regexp": "^1.0.5", | ||
"eslint": "^3.0.0", | ||
"escape-string-regexp": "^1.0.5", | ||
"js-string-escape": "^1.0.1", | ||
"json-stable-stringify": "^1.0.1", | ||
"md5-hex": "^1.3.0", | ||
@@ -45,0 +46,0 @@ "standard": "^8.4.0", |
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
16398
369
8
+ Addedjson-stable-stringify@^1.0.1