Skip to content

Commit

Permalink
Merge 633e1db into 999b552
Browse files Browse the repository at this point in the history
  • Loading branch information
vsiakka committed Nov 8, 2019
2 parents 999b552 + 633e1db commit 0aa5848
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 18 deletions.
12 changes: 0 additions & 12 deletions .babelrc

This file was deleted.

23 changes: 23 additions & 0 deletions babel.config.js
@@ -0,0 +1,23 @@
module.exports = function (api) {
api.cache(true);

const presets = [
[
'@babel/preset-env',
{
targets: {
node: 4
},
useBuiltIns: 'entry',
corejs: { version: 3 }
}
]
];
const plugins = [];

return {
presets,
plugins
};
}

7 changes: 4 additions & 3 deletions package.json
Expand Up @@ -76,14 +76,15 @@
],
"dependencies": {
"commander": "2.18.0",
"core-js": "3.4.0",
"gherkin": "5.1.0",
"glob": "7.1.3",
"lodash": "4.17.14"
},
"devDependencies": {
"@babel/cli": "7.4.4",
"@babel/core": "7.4.4",
"@babel/preset-env": "7.4.4",
"@babel/cli": "7.7.0",
"@babel/core": "7.7.2",
"@babel/preset-env": "7.7.1",
"chai": "4.1.2",
"coveralls": "3.0.3",
"eslint": "5.14.1",
Expand Down
7 changes: 4 additions & 3 deletions src/formatters/stylish.js
@@ -1,4 +1,5 @@
/*eslint no-console: "off"*/
import 'core-js/stable/string';

var style = {
gray: function(text) {
Expand All @@ -20,7 +21,7 @@ function stylizeError(error, maxLineLength, maxMessageLength, addColors) {
var padding = ' '; //padding of 4 spaces, will be used between line numbers, error msgs and rule names, for readability
var errorLinePadded = error.line.toString().padEnd(maxLineLength);
var errorLineStylized = addColors ? style.gray(errorLinePadded) : errorLinePadded;

var errorRuleStylized = addColors ? style.gray(error.rule) : error.rule;
return indent + errorLineStylized + padding + error.message.padEnd(maxMessageLength) + padding + errorRuleStylized;
}
Expand All @@ -40,7 +41,7 @@ function getMaxMessageLength(result, maxLineLength, consoleWidth) {
var length = 0;
result.errors.forEach(function(error) {
var errorStr = error.message.toString();

// Get the length of the formatted error message when no extra padding is applied
// If the formatted message is longer than the console width, we will ignore its length
var expandedErrorStrLength = stylizeError(error, maxLineLength, 0, false).length;
Expand All @@ -54,7 +55,7 @@ function getMaxMessageLength(result, maxLineLength, consoleWidth) {
}

function printResults(results) {
// If the console is tty, get its width and use it to ensure we don't try to write messages longer
// If the console is tty, get its width and use it to ensure we don't try to write messages longer
// than the console width when possible
var consoleWidth = Infinity;
if (process.stdout.isTTY) {
Expand Down

0 comments on commit 0aa5848

Please sign in to comment.