From e8d8fa79a63fcce4f507b8fca0e015d6625a8baa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rouven=20We=C3=9Fling?= Date: Wed, 10 Jan 2018 10:44:12 +0100 Subject: [PATCH 1/2] Drop the dependency on path-is-absolute. Node.js 0.11 has a built-in method for the same purpose. --- lib/config-helpers.js | 5 ++--- lib/config.js | 5 ++--- package.json | 3 +-- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/lib/config-helpers.js b/lib/config-helpers.js index 6ef11aab..ac47f179 100644 --- a/lib/config-helpers.js +++ b/lib/config-helpers.js @@ -1,8 +1,7 @@ var yaml = require('js-yaml'), fs = require('fs'), path = require('path'), - merge = require('merge'), - pathIsAbsolute = require('path-is-absolute'); + merge = require('merge'); /** * Loads the default sass-lint configuration file @@ -80,7 +79,7 @@ var checkForConfigExtend = function (config, curConfPath) { resolvedSubConfig; if (subConfig) { - if (!pathIsAbsolute(subConfig)) { + if (!path.isAbsolute(subConfig)) { // Process.cwd() in most IDE's will be / so therefore we need to pass the current directory // of the config from which you are 'extending' or we resort to process.cwd() which on the CLI // will be correct diff --git a/lib/config.js b/lib/config.js index 3d79ccc1..e63a2da8 100644 --- a/lib/config.js +++ b/lib/config.js @@ -2,8 +2,7 @@ var path = require('path'), merge = require('merge'), - confHelpers = require('./config-helpers'), - pathIsAbsolute = require('path-is-absolute'); + confHelpers = require('./config-helpers'); var cacheConfig = {}, cacheEnabled = false; @@ -58,7 +57,7 @@ module.exports = function (options, configPath) { } } } - else if (!pathIsAbsolute(configPath)) { + else if (!path.isAbsolute(configPath)) { configPath = path.resolve(process.cwd(), configPath); } diff --git a/package.json b/package.json index 01f6972c..d0b95ab8 100644 --- a/package.json +++ b/package.json @@ -28,8 +28,8 @@ }, "homepage": "https://github.com/sasstools/sass-lint", "dependencies": { - "chalk": "^2.1.0", "autoprefixer": "^7.1.3", + "chalk": "^2.1.0", "commander": "^2.8.1", "fs-extra": "^5.0.0", "glob": "^7.0.0", @@ -43,7 +43,6 @@ "lodash.map": "^4.6.0", "lodash.template": "^4.4.0", "merge": "^1.2.0", - "path-is-absolute": "^1.0.0", "text-table": "^0.2.0", "util": "^0.10.3" }, From 11070f87be224d881065cced374546da13f6b500 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rouven=20We=C3=9Fling?= Date: Wed, 10 Jan 2018 10:51:11 +0100 Subject: [PATCH 2/2] Drop the dependency on lodash.map --- lib/format/formatters/html.js | 5 ++--- package.json | 1 - 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/format/formatters/html.js b/lib/format/formatters/html.js index ed30fa7f..f704840d 100644 --- a/lib/format/formatters/html.js +++ b/lib/format/formatters/html.js @@ -9,7 +9,6 @@ 'use strict'; const lodashTemplate = require('lodash.template'); -const lodashMap = require('lodash.map'); const fs = require('fs'); const path = require('path'); @@ -76,7 +75,7 @@ const renderMessages = function (messages, parentIndex) { * @param {Object} message Message. * @returns {string} HTML (table row) describing a message. */ - return lodashMap(messages, message => { + return messages.map(message => { const lineNumber = message.line || 0; const columnNumber = message.column || 0; @@ -97,7 +96,7 @@ const renderMessages = function (messages, parentIndex) { * @returns {string} HTML string describing the results. */ const renderResults = function (results) { - return lodashMap(results, (result, index) => resultTemplate({ + return results.map((result, index) => resultTemplate({ index, color: renderColor(result.errorCount, result.warningCount), filePath: result.filePath, diff --git a/package.json b/package.json index d0b95ab8..4f67df91 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,6 @@ "known-css-properties": "^0.5.0", "lodash.capitalize": "^4.1.0", "lodash.kebabcase": "^4.0.0", - "lodash.map": "^4.6.0", "lodash.template": "^4.4.0", "merge": "^1.2.0", "text-table": "^0.2.0",