Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (result[error.fileName]) {
result[error.fileName].push(error);
} else {
result[error.fileName] = [error];
}
});
return result;
}
function reduceErrors (files) {
return files.reduce((errors, file) => (
errors.concat(file.report.errors)
), []).filter(Boolean);
}
if (ci.isCI && (ci.APPVEYOR || ci.CIRCLE || ci.JENKINS)) {
appveyorApiUrl = process.env.APPVEYOR_API_URL;
if (appveyorApiUrl) {
// eslint-disable-next-line node/no-deprecated-api
appveyorApiUrl = url.resolve(appveyorApiUrl, 'api/build/compilationmessages');
}
module.exports = function (files) {
const errors = reduceErrors(files);
if (!errors.length) {
return noop();
}
let result;
if (appveyorApiUrl) {
result = appveyor(errors);
} else {
const errorSet = getErrorsByFile(errors);
if (ci.CIRCLE) {
function getOptions (file) {
if (typeof options === 'function') {
options = options(file);
}
options = Object.assign({
maxLineLength: 512,
browser: false,
output: !(ci.isCI && (ci.APPVEYOR || ci.CIRCLE || (ci.JENKINS && hasCheckstyle))),
blame: true,
fail: true,
sort: true,
}, options);
return Promise.resolve(options.blame && getAuthor(file.cwd)).then(author => {
options = Object.assign({
author,
}, options);
if (typeof options.author === 'string') {
if (/@/.test(options.author)) {
options.author = {
email: options.author,
};
} else {
options.author = {