Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

coffeelint-reporter

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

coffeelint-reporter - npm Package Compare versions

Comparing version 2.0.0 to 2.0.1

7

CHANGELOG.md

@@ -13,4 +13,11 @@ # CHANGELOG

> - Documentation
> - Enhancements
> - Internal
## v2.0.1 (2019-12-13)
#### Enhancements
- Remove errors and warnings count in log ([30f418f](https://github.com/sibiraj-s/coffeelint-reporter/commit/30f418f))
## v2.0.0 (2019-12-12)

@@ -17,0 +24,0 @@

2

package.json
{
"name": "coffeelint-reporter",
"version": "2.0.0",
"version": "2.0.1",
"description": "A Reporter for Coffeelint",

@@ -5,0 +5,0 @@ "author": "sibiraj-s",

@@ -34,15 +34,14 @@ const chalk = require('chalk');

const isWin = process.platform === 'win32';
const warnSign = '' + (isWin ? '' : '⚠');
const errSign = '' + (isWin ? '' : '✖');
const tickSign = '' + (isWin ? '' : '✔');
const warnSign = isWin ? '' : '⚠';
const errSign = isWin ? '' : '✖';
const tickSign = isWin ? '' : '✔';
let report;
let errors = 0;
let warnings = 0;
let formattedReport;
if (fileName) {
formattedReport = '\n' + chalk.green(chalk.underline(fileName)) + '\n';
report = '\n' + chalk.green(chalk.underline(fileName)) + '\n';
} else {
formattedReport = '\n';
report = '\n';
}

@@ -52,13 +51,5 @@

results.forEach(function (result) {
let hasError = false;
const hasError = result.level === 'error';
hasError ? errors++ : warnings++;
if (result.level === 'error') {
hasError = true;
errors++;
}
if (result.level === 'warn') {
warnings++;
}
table.push([

@@ -72,32 +63,18 @@ chalk[hasError ? 'red' : 'yellow'](hasError ? errSign : warnSign),

formattedReport += table.toString();
report += table.toString();
}
if (warnings || errors) {
formattedReport += '\n\n Completd with ';
if (warnings) {
formattedReport += chalk.yellow(warnings + ' warning' + (warnings === 1 ? '' : 's'));
}
if (warnings && errors) {
formattedReport += ', ';
}
if (errors) {
formattedReport += chalk.red(errors + ' error' + (errors === 1 ? '' : 's'));
}
} else {
formattedReport += chalk.green(tickSign + ' No Problem');
if (!warnings && !errors) {
report += chalk.green(` ${tickSign} No Problems`);
}
formattedReport = formattedReport.replace(/(\r\n|\r|\n){2,}/g, '$1\n');
report = report.replace(/(\r\n|\r|\n){2,}/g, '$1\n');
if (options.log) {
console.log(formattedReport);
console.log(report);
}
return formattedReport;
return report;
};
module.exports = reporter;
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc