From e1442b401f935e25b6eb4e0bb8c957efd25cf87d Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Thu, 5 Sep 2019 19:32:25 +0000 Subject: [PATCH 01/20] Update globby requirement from ^9.2.0 to ^10.0.1 Updates the requirements on [globby](https://github.com/sindresorhus/globby) to permit the latest version. - [Release notes](https://github.com/sindresorhus/globby/releases) - [Commits](https://github.com/sindresorhus/globby/compare/v9.2.0...v10.0.1) Signed-off-by: dependabot-preview[bot] --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 66cfb6bbfa..7e0dcfe7b3 100644 --- a/package.json +++ b/package.json @@ -48,7 +48,7 @@ "file-entry-cache": "^5.0.1", "get-stdin": "^7.0.0", "global-modules": "^2.0.0", - "globby": "^9.2.0", + "globby": "^10.0.1", "globjoin": "^0.1.4", "html-tags": "^3.0.0", "ignore": "^5.0.6", From c5dc10dacba7c0a99cb39406345a185102fd476f Mon Sep 17 00:00:00 2001 From: Ivan Kopeykin Date: Mon, 9 Sep 2019 19:27:30 +0300 Subject: [PATCH 02/20] test that replacing backslashes works --- lib/__tests__/ignore.test.js | 7 ++++--- lib/__tests__/replaceBackslashes.js | 5 +++++ lib/__tests__/standalone-syntax.test.js | 3 ++- lib/__tests__/standalone.test.js | 7 +++++-- 4 files changed, 16 insertions(+), 6 deletions(-) create mode 100644 lib/__tests__/replaceBackslashes.js diff --git a/lib/__tests__/ignore.test.js b/lib/__tests__/ignore.test.js index f6f68aa66c..8c850cbb7e 100644 --- a/lib/__tests__/ignore.test.js +++ b/lib/__tests__/ignore.test.js @@ -2,9 +2,10 @@ const NoFilesFoundError = require("../utils/noFilesFoundError"); const path = require("path"); +const replaceBackslashes = require("./replaceBackslashes"); const standalone = require("../standalone"); -const fixturesPath = path.join(__dirname, "fixtures"); +const fixturesPath = replaceBackslashes(path.join(__dirname, "fixtures")); describe("extending config and ignoreFiles glob ignoring single glob", () => { let results; @@ -387,7 +388,7 @@ describe("using codeFilename and ignoreFiles together", () => { beforeEach(() => { return standalone({ code: "a {}", - codeFilename: path.join(__dirname, "foo.css"), + codeFilename: replaceBackslashes(path.join(__dirname, "foo.css")), config: { ignoreFiles: ["**/foo.css"], rules: { "block-no-empty": true } @@ -410,7 +411,7 @@ describe("using codeFilename and ignoreFiles with configBasedir", () => { beforeEach(() => { return standalone({ code: "a {}", - codeFilename: path.join(__dirname, "foo.css"), + codeFilename: replaceBackslashes(path.join(__dirname, "foo.css")), config: { ignoreFiles: ["foo.css"], rules: { "block-no-empty": true } diff --git a/lib/__tests__/replaceBackslashes.js b/lib/__tests__/replaceBackslashes.js new file mode 100644 index 0000000000..7f81d4b218 --- /dev/null +++ b/lib/__tests__/replaceBackslashes.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = function replaceBackslashes(str) { + return str.replace(/\\/g, "/"); +}; diff --git a/lib/__tests__/standalone-syntax.test.js b/lib/__tests__/standalone-syntax.test.js index 325dd6d0f0..8d8361757c 100644 --- a/lib/__tests__/standalone-syntax.test.js +++ b/lib/__tests__/standalone-syntax.test.js @@ -2,12 +2,13 @@ const fs = require("fs"); const path = require("path"); +const replaceBackslashes = require("./replaceBackslashes"); const standalone = require("../standalone"); const stringFormatter = require("../formatters/stringFormatter"); const stripAnsi = require("strip-ansi"); const { promisify } = require("util"); -const fixturesPath = path.join(__dirname, "fixtures"); +const fixturesPath = replaceBackslashes(path.join(__dirname, "fixtures")); it("standalone with scss syntax", () => { const config = { diff --git a/lib/__tests__/standalone.test.js b/lib/__tests__/standalone.test.js index 94adbc4792..26ebad3e69 100644 --- a/lib/__tests__/standalone.test.js +++ b/lib/__tests__/standalone.test.js @@ -3,9 +3,10 @@ const configBlockNoEmpty = require("./fixtures/config-block-no-empty"); const NoFilesFoundError = require("../utils/noFilesFoundError"); const path = require("path"); +const replaceBackslashes = require("./replaceBackslashes"); const standalone = require("../standalone"); -const fixturesPath = path.join(__dirname, "fixtures"); +const fixturesPath = replaceBackslashes(path.join(__dirname, "fixtures")); describe("standalone with one input file", () => { let output; @@ -338,7 +339,9 @@ describe("standalone with config locatable from process.cwd not file", () => { beforeEach(() => { return standalone({ - files: [path.join(__dirname, "./fixtures/empty-block.css")] + files: [ + replaceBackslashes(path.join(__dirname, "./fixtures/empty-block.css")) + ] }).then(data => (results = data.results)); }); From 6ea214cbf657495c8b21cf6b247365f209c1d006 Mon Sep 17 00:00:00 2001 From: Ivan Kopeykin Date: Mon, 9 Sep 2019 19:50:12 +0300 Subject: [PATCH 03/20] fix standalone-cache tests --- lib/__tests__/standalone-cache.test.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/__tests__/standalone-cache.test.js b/lib/__tests__/standalone-cache.test.js index 10bd009b18..01f3391dc4 100644 --- a/lib/__tests__/standalone-cache.test.js +++ b/lib/__tests__/standalone-cache.test.js @@ -7,6 +7,7 @@ const fixturesPath = path.join(__dirname, "fixtures"); const cpFile = require("cp-file"); const fileExists = require("file-exists-promise"); const fs = require("fs"); +const replaceBackslashes = require("./replaceBackslashes"); const { promisify } = require("util"); const unlink = promisify(fs.unlink); const fCache = require("file-entry-cache"); @@ -22,7 +23,7 @@ const newFileDest = path.join(fixturesPath, "cache", "newFile.css"); // make sure config doesn't change between runs. function getConfig() { return { - files: path.join(fixturesPath, "cache", "*.css"), + files: replaceBackslashes(path.join(fixturesPath, "cache", "*.css")), config: { rules: { "block-no-empty": true, "color-no-invalid-hex": true } }, From 41e186d4af040ba41f7a532bd1575f26c44bab6c Mon Sep 17 00:00:00 2001 From: Ivan Kopeykin Date: Mon, 9 Sep 2019 20:05:42 +0300 Subject: [PATCH 04/20] Revert "fix standalone-cache tests" This reverts commit 6ea214cb --- lib/__tests__/standalone-cache.test.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/__tests__/standalone-cache.test.js b/lib/__tests__/standalone-cache.test.js index 01f3391dc4..10bd009b18 100644 --- a/lib/__tests__/standalone-cache.test.js +++ b/lib/__tests__/standalone-cache.test.js @@ -7,7 +7,6 @@ const fixturesPath = path.join(__dirname, "fixtures"); const cpFile = require("cp-file"); const fileExists = require("file-exists-promise"); const fs = require("fs"); -const replaceBackslashes = require("./replaceBackslashes"); const { promisify } = require("util"); const unlink = promisify(fs.unlink); const fCache = require("file-entry-cache"); @@ -23,7 +22,7 @@ const newFileDest = path.join(fixturesPath, "cache", "newFile.css"); // make sure config doesn't change between runs. function getConfig() { return { - files: replaceBackslashes(path.join(fixturesPath, "cache", "*.css")), + files: path.join(fixturesPath, "cache", "*.css"), config: { rules: { "block-no-empty": true, "color-no-invalid-hex": true } }, From 357773bf144f8587ee874de3c9a5a7a692178d58 Mon Sep 17 00:00:00 2001 From: Ivan Kopeykin Date: Mon, 9 Sep 2019 20:05:55 +0300 Subject: [PATCH 05/20] Revert "test that replacing backslashes works" This reverts commit c5dc10da --- lib/__tests__/ignore.test.js | 7 +++---- lib/__tests__/replaceBackslashes.js | 5 ----- lib/__tests__/standalone-syntax.test.js | 3 +-- lib/__tests__/standalone.test.js | 7 ++----- 4 files changed, 6 insertions(+), 16 deletions(-) delete mode 100644 lib/__tests__/replaceBackslashes.js diff --git a/lib/__tests__/ignore.test.js b/lib/__tests__/ignore.test.js index 8c850cbb7e..f6f68aa66c 100644 --- a/lib/__tests__/ignore.test.js +++ b/lib/__tests__/ignore.test.js @@ -2,10 +2,9 @@ const NoFilesFoundError = require("../utils/noFilesFoundError"); const path = require("path"); -const replaceBackslashes = require("./replaceBackslashes"); const standalone = require("../standalone"); -const fixturesPath = replaceBackslashes(path.join(__dirname, "fixtures")); +const fixturesPath = path.join(__dirname, "fixtures"); describe("extending config and ignoreFiles glob ignoring single glob", () => { let results; @@ -388,7 +387,7 @@ describe("using codeFilename and ignoreFiles together", () => { beforeEach(() => { return standalone({ code: "a {}", - codeFilename: replaceBackslashes(path.join(__dirname, "foo.css")), + codeFilename: path.join(__dirname, "foo.css"), config: { ignoreFiles: ["**/foo.css"], rules: { "block-no-empty": true } @@ -411,7 +410,7 @@ describe("using codeFilename and ignoreFiles with configBasedir", () => { beforeEach(() => { return standalone({ code: "a {}", - codeFilename: replaceBackslashes(path.join(__dirname, "foo.css")), + codeFilename: path.join(__dirname, "foo.css"), config: { ignoreFiles: ["foo.css"], rules: { "block-no-empty": true } diff --git a/lib/__tests__/replaceBackslashes.js b/lib/__tests__/replaceBackslashes.js deleted file mode 100644 index 7f81d4b218..0000000000 --- a/lib/__tests__/replaceBackslashes.js +++ /dev/null @@ -1,5 +0,0 @@ -"use strict"; - -module.exports = function replaceBackslashes(str) { - return str.replace(/\\/g, "/"); -}; diff --git a/lib/__tests__/standalone-syntax.test.js b/lib/__tests__/standalone-syntax.test.js index 8d8361757c..325dd6d0f0 100644 --- a/lib/__tests__/standalone-syntax.test.js +++ b/lib/__tests__/standalone-syntax.test.js @@ -2,13 +2,12 @@ const fs = require("fs"); const path = require("path"); -const replaceBackslashes = require("./replaceBackslashes"); const standalone = require("../standalone"); const stringFormatter = require("../formatters/stringFormatter"); const stripAnsi = require("strip-ansi"); const { promisify } = require("util"); -const fixturesPath = replaceBackslashes(path.join(__dirname, "fixtures")); +const fixturesPath = path.join(__dirname, "fixtures"); it("standalone with scss syntax", () => { const config = { diff --git a/lib/__tests__/standalone.test.js b/lib/__tests__/standalone.test.js index 26ebad3e69..94adbc4792 100644 --- a/lib/__tests__/standalone.test.js +++ b/lib/__tests__/standalone.test.js @@ -3,10 +3,9 @@ const configBlockNoEmpty = require("./fixtures/config-block-no-empty"); const NoFilesFoundError = require("../utils/noFilesFoundError"); const path = require("path"); -const replaceBackslashes = require("./replaceBackslashes"); const standalone = require("../standalone"); -const fixturesPath = replaceBackslashes(path.join(__dirname, "fixtures")); +const fixturesPath = path.join(__dirname, "fixtures"); describe("standalone with one input file", () => { let output; @@ -339,9 +338,7 @@ describe("standalone with config locatable from process.cwd not file", () => { beforeEach(() => { return standalone({ - files: [ - replaceBackslashes(path.join(__dirname, "./fixtures/empty-block.css")) - ] + files: [path.join(__dirname, "./fixtures/empty-block.css")] }).then(data => (results = data.results)); }); From 76ae0674e7cf59137c32c3699f8dbd9886de24cb Mon Sep 17 00:00:00 2001 From: Ivan Kopeykin Date: Mon, 9 Sep 2019 20:11:23 +0300 Subject: [PATCH 06/20] apply string replacement in stylelint instead of test cases --- lib/printConfig.js | 2 +- lib/standalone.js | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/lib/printConfig.js b/lib/printConfig.js index ca0fde865f..f76504f4bb 100644 --- a/lib/printConfig.js +++ b/lib/printConfig.js @@ -29,7 +29,7 @@ module.exports = function( const filePath = files[0]; - if (globby.hasMagic(filePath)) { + if (globby.hasMagic(filePath.replace(/\\/g, "/"))) { return Promise.reject( new Error("The --print-config option does not support globs.") ); diff --git a/lib/standalone.js b/lib/standalone.js index 1115ffa176..19a5d0e419 100644 --- a/lib/standalone.js +++ b/lib/standalone.js @@ -170,11 +170,7 @@ module.exports = function( }); } - let fileList = files; - - if (typeof fileList === "string") { - fileList = [fileList]; - } + let fileList = [].concat(files).map(file => file.replace(/\\/g, "/")); if (!options.disableDefaultIgnores) { fileList = fileList.concat(ALWAYS_IGNORED_GLOBS.map(glob => "!" + glob)); From 6eb31ba7c30f52d0e859dcab93e9b06a56a47d8a Mon Sep 17 00:00:00 2001 From: Ivan Kopeykin Date: Mon, 9 Sep 2019 20:22:30 +0300 Subject: [PATCH 07/20] fix errors --- lib/utils/noFilesFoundError.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/utils/noFilesFoundError.js b/lib/utils/noFilesFoundError.js index a91eb26515..b95c68cace 100644 --- a/lib/utils/noFilesFoundError.js +++ b/lib/utils/noFilesFoundError.js @@ -1,5 +1,7 @@ "use strict"; +const isWin = process.platform === "win32"; + class NoFilesFoundError extends Error { constructor(fileList) { super(); @@ -8,7 +10,10 @@ class NoFilesFoundError extends Error { fileList = [fileList]; } - const pattern = fileList.filter(i => !i.startsWith("!")).join(", "); + const pattern = fileList + .filter(i => !i.startsWith("!")) + .map(file => (isWin ? file.replace(/\//g, "\\") : file)) + .join(", "); this.message = `No files matching the pattern "${pattern}" were found.`; } From 884cda9bdc17f4e443c243bd9830d37049233ef3 Mon Sep 17 00:00:00 2001 From: Ivan Kopeykin Date: Tue, 10 Sep 2019 12:01:36 +0300 Subject: [PATCH 08/20] feat: add convertToGlobbyPath --- lib/printConfig.js | 3 ++- lib/standalone.js | 5 +++-- lib/utils/convertToGlobbyPath.js | 17 +++++++++++++++++ lib/utils/noFilesFoundError.js | 7 +------ 4 files changed, 23 insertions(+), 9 deletions(-) create mode 100644 lib/utils/convertToGlobbyPath.js diff --git a/lib/printConfig.js b/lib/printConfig.js index f76504f4bb..82d3ae74b7 100644 --- a/lib/printConfig.js +++ b/lib/printConfig.js @@ -2,6 +2,7 @@ "use strict"; const _ = require("lodash"); +const convertToGlobbyPath = require("./utils/convertToGlobbyPath"); const createStylelint = require("./createStylelint"); const globby /*: Function*/ = require("globby"); const path = require("path"); @@ -29,7 +30,7 @@ module.exports = function( const filePath = files[0]; - if (globby.hasMagic(filePath.replace(/\\/g, "/"))) { + if (globby.hasMagic(convertToGlobbyPath(filePath))) { return Promise.reject( new Error("The --print-config option does not support globs.") ); diff --git a/lib/standalone.js b/lib/standalone.js index 19a5d0e419..4a0ebea8c4 100644 --- a/lib/standalone.js +++ b/lib/standalone.js @@ -2,6 +2,7 @@ "use strict"; const _ = require("lodash"); +const convertToGlobbyPath = require("./utils/convertToGlobbyPath"); const createStylelint = require("./createStylelint"); const createStylelintResult = require("./createStylelintResult"); const debug = require("debug")("stylelint:standalone"); @@ -170,7 +171,7 @@ module.exports = function( }); } - let fileList = [].concat(files).map(file => file.replace(/\\/g, "/")); + let fileList = [].concat(files).map(convertToGlobbyPath); if (!options.disableDefaultIgnores) { fileList = fileList.concat(ALWAYS_IGNORED_GLOBS.map(glob => "!" + glob)); @@ -200,7 +201,7 @@ module.exports = function( if (!filePaths.length) { if (!allowEmptyInput) { - throw new NoFilesFoundError(fileList); + throw new NoFilesFoundError([].concat(files)); } return Promise.all([]); diff --git a/lib/utils/convertToGlobbyPath.js b/lib/utils/convertToGlobbyPath.js new file mode 100644 index 0000000000..9e6fff24fb --- /dev/null +++ b/lib/utils/convertToGlobbyPath.js @@ -0,0 +1,17 @@ +"use strict"; + +const isWin = process.platform === "win32"; + +/** + * Convert file path to globby paths + * If you want escape any symbol use double backslashes, this way we can correctly support windows-like paths + * @param {string} path + * @return {string} result of conversion + */ +module.exports = function convertToGlobbyPath(path) { + if (!isWin) { + return path.replace(/\\\\/g, "\\"); + } + + return path.replace(/\\/g, "/").replace(/\/\//g, "\\"); +}; diff --git a/lib/utils/noFilesFoundError.js b/lib/utils/noFilesFoundError.js index b95c68cace..a91eb26515 100644 --- a/lib/utils/noFilesFoundError.js +++ b/lib/utils/noFilesFoundError.js @@ -1,7 +1,5 @@ "use strict"; -const isWin = process.platform === "win32"; - class NoFilesFoundError extends Error { constructor(fileList) { super(); @@ -10,10 +8,7 @@ class NoFilesFoundError extends Error { fileList = [fileList]; } - const pattern = fileList - .filter(i => !i.startsWith("!")) - .map(file => (isWin ? file.replace(/\//g, "\\") : file)) - .join(", "); + const pattern = fileList.filter(i => !i.startsWith("!")).join(", "); this.message = `No files matching the pattern "${pattern}" were found.`; } From c1dd1811c828da79d44bab2814148edf176e1b82 Mon Sep 17 00:00:00 2001 From: Ivan Kopeykin Date: Tue, 10 Sep 2019 23:35:39 +0300 Subject: [PATCH 09/20] Revert "feat: add convertToGlobbyPath" This reverts commit 884cda9b --- lib/printConfig.js | 3 +-- lib/standalone.js | 5 ++--- lib/utils/convertToGlobbyPath.js | 17 ----------------- lib/utils/noFilesFoundError.js | 7 ++++++- 4 files changed, 9 insertions(+), 23 deletions(-) delete mode 100644 lib/utils/convertToGlobbyPath.js diff --git a/lib/printConfig.js b/lib/printConfig.js index 82d3ae74b7..f76504f4bb 100644 --- a/lib/printConfig.js +++ b/lib/printConfig.js @@ -2,7 +2,6 @@ "use strict"; const _ = require("lodash"); -const convertToGlobbyPath = require("./utils/convertToGlobbyPath"); const createStylelint = require("./createStylelint"); const globby /*: Function*/ = require("globby"); const path = require("path"); @@ -30,7 +29,7 @@ module.exports = function( const filePath = files[0]; - if (globby.hasMagic(convertToGlobbyPath(filePath))) { + if (globby.hasMagic(filePath.replace(/\\/g, "/"))) { return Promise.reject( new Error("The --print-config option does not support globs.") ); diff --git a/lib/standalone.js b/lib/standalone.js index 4a0ebea8c4..19a5d0e419 100644 --- a/lib/standalone.js +++ b/lib/standalone.js @@ -2,7 +2,6 @@ "use strict"; const _ = require("lodash"); -const convertToGlobbyPath = require("./utils/convertToGlobbyPath"); const createStylelint = require("./createStylelint"); const createStylelintResult = require("./createStylelintResult"); const debug = require("debug")("stylelint:standalone"); @@ -171,7 +170,7 @@ module.exports = function( }); } - let fileList = [].concat(files).map(convertToGlobbyPath); + let fileList = [].concat(files).map(file => file.replace(/\\/g, "/")); if (!options.disableDefaultIgnores) { fileList = fileList.concat(ALWAYS_IGNORED_GLOBS.map(glob => "!" + glob)); @@ -201,7 +200,7 @@ module.exports = function( if (!filePaths.length) { if (!allowEmptyInput) { - throw new NoFilesFoundError([].concat(files)); + throw new NoFilesFoundError(fileList); } return Promise.all([]); diff --git a/lib/utils/convertToGlobbyPath.js b/lib/utils/convertToGlobbyPath.js deleted file mode 100644 index 9e6fff24fb..0000000000 --- a/lib/utils/convertToGlobbyPath.js +++ /dev/null @@ -1,17 +0,0 @@ -"use strict"; - -const isWin = process.platform === "win32"; - -/** - * Convert file path to globby paths - * If you want escape any symbol use double backslashes, this way we can correctly support windows-like paths - * @param {string} path - * @return {string} result of conversion - */ -module.exports = function convertToGlobbyPath(path) { - if (!isWin) { - return path.replace(/\\\\/g, "\\"); - } - - return path.replace(/\\/g, "/").replace(/\/\//g, "\\"); -}; diff --git a/lib/utils/noFilesFoundError.js b/lib/utils/noFilesFoundError.js index a91eb26515..b95c68cace 100644 --- a/lib/utils/noFilesFoundError.js +++ b/lib/utils/noFilesFoundError.js @@ -1,5 +1,7 @@ "use strict"; +const isWin = process.platform === "win32"; + class NoFilesFoundError extends Error { constructor(fileList) { super(); @@ -8,7 +10,10 @@ class NoFilesFoundError extends Error { fileList = [fileList]; } - const pattern = fileList.filter(i => !i.startsWith("!")).join(", "); + const pattern = fileList + .filter(i => !i.startsWith("!")) + .map(file => (isWin ? file.replace(/\//g, "\\") : file)) + .join(", "); this.message = `No files matching the pattern "${pattern}" were found.`; } From c96e7bc8152f5ac9b27ba8b5fae8bfd8c769e85e Mon Sep 17 00:00:00 2001 From: Ivan Kopeykin Date: Tue, 10 Sep 2019 23:35:53 +0300 Subject: [PATCH 10/20] Revert "fix errors" This reverts commit 6eb31ba7 --- lib/utils/noFilesFoundError.js | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/lib/utils/noFilesFoundError.js b/lib/utils/noFilesFoundError.js index b95c68cace..a91eb26515 100644 --- a/lib/utils/noFilesFoundError.js +++ b/lib/utils/noFilesFoundError.js @@ -1,7 +1,5 @@ "use strict"; -const isWin = process.platform === "win32"; - class NoFilesFoundError extends Error { constructor(fileList) { super(); @@ -10,10 +8,7 @@ class NoFilesFoundError extends Error { fileList = [fileList]; } - const pattern = fileList - .filter(i => !i.startsWith("!")) - .map(file => (isWin ? file.replace(/\//g, "\\") : file)) - .join(", "); + const pattern = fileList.filter(i => !i.startsWith("!")).join(", "); this.message = `No files matching the pattern "${pattern}" were found.`; } From 80359235d2071277cd6e3fddbd79b340b64e1a7a Mon Sep 17 00:00:00 2001 From: Ivan Kopeykin Date: Tue, 10 Sep 2019 23:36:09 +0300 Subject: [PATCH 11/20] Revert "apply string replacement in stylelint instead of test cases" This reverts commit 76ae0674 --- lib/printConfig.js | 2 +- lib/standalone.js | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/printConfig.js b/lib/printConfig.js index f76504f4bb..ca0fde865f 100644 --- a/lib/printConfig.js +++ b/lib/printConfig.js @@ -29,7 +29,7 @@ module.exports = function( const filePath = files[0]; - if (globby.hasMagic(filePath.replace(/\\/g, "/"))) { + if (globby.hasMagic(filePath)) { return Promise.reject( new Error("The --print-config option does not support globs.") ); diff --git a/lib/standalone.js b/lib/standalone.js index 19a5d0e419..1115ffa176 100644 --- a/lib/standalone.js +++ b/lib/standalone.js @@ -170,7 +170,11 @@ module.exports = function( }); } - let fileList = [].concat(files).map(file => file.replace(/\\/g, "/")); + let fileList = files; + + if (typeof fileList === "string") { + fileList = [fileList]; + } if (!options.disableDefaultIgnores) { fileList = fileList.concat(ALWAYS_IGNORED_GLOBS.map(glob => "!" + glob)); From 4e36ae6c583c9c380955fec6ea27b9b445d71952 Mon Sep 17 00:00:00 2001 From: Ivan Kopeykin Date: Tue, 10 Sep 2019 23:36:54 +0300 Subject: [PATCH 12/20] Revert "Revert "test that replacing backslashes works"" This reverts commit 357773bf --- lib/__tests__/ignore.test.js | 7 ++++--- lib/__tests__/replaceBackslashes.js | 5 +++++ lib/__tests__/standalone-syntax.test.js | 3 ++- lib/__tests__/standalone.test.js | 7 +++++-- 4 files changed, 16 insertions(+), 6 deletions(-) create mode 100644 lib/__tests__/replaceBackslashes.js diff --git a/lib/__tests__/ignore.test.js b/lib/__tests__/ignore.test.js index f6f68aa66c..8c850cbb7e 100644 --- a/lib/__tests__/ignore.test.js +++ b/lib/__tests__/ignore.test.js @@ -2,9 +2,10 @@ const NoFilesFoundError = require("../utils/noFilesFoundError"); const path = require("path"); +const replaceBackslashes = require("./replaceBackslashes"); const standalone = require("../standalone"); -const fixturesPath = path.join(__dirname, "fixtures"); +const fixturesPath = replaceBackslashes(path.join(__dirname, "fixtures")); describe("extending config and ignoreFiles glob ignoring single glob", () => { let results; @@ -387,7 +388,7 @@ describe("using codeFilename and ignoreFiles together", () => { beforeEach(() => { return standalone({ code: "a {}", - codeFilename: path.join(__dirname, "foo.css"), + codeFilename: replaceBackslashes(path.join(__dirname, "foo.css")), config: { ignoreFiles: ["**/foo.css"], rules: { "block-no-empty": true } @@ -410,7 +411,7 @@ describe("using codeFilename and ignoreFiles with configBasedir", () => { beforeEach(() => { return standalone({ code: "a {}", - codeFilename: path.join(__dirname, "foo.css"), + codeFilename: replaceBackslashes(path.join(__dirname, "foo.css")), config: { ignoreFiles: ["foo.css"], rules: { "block-no-empty": true } diff --git a/lib/__tests__/replaceBackslashes.js b/lib/__tests__/replaceBackslashes.js new file mode 100644 index 0000000000..7f81d4b218 --- /dev/null +++ b/lib/__tests__/replaceBackslashes.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = function replaceBackslashes(str) { + return str.replace(/\\/g, "/"); +}; diff --git a/lib/__tests__/standalone-syntax.test.js b/lib/__tests__/standalone-syntax.test.js index 325dd6d0f0..8d8361757c 100644 --- a/lib/__tests__/standalone-syntax.test.js +++ b/lib/__tests__/standalone-syntax.test.js @@ -2,12 +2,13 @@ const fs = require("fs"); const path = require("path"); +const replaceBackslashes = require("./replaceBackslashes"); const standalone = require("../standalone"); const stringFormatter = require("../formatters/stringFormatter"); const stripAnsi = require("strip-ansi"); const { promisify } = require("util"); -const fixturesPath = path.join(__dirname, "fixtures"); +const fixturesPath = replaceBackslashes(path.join(__dirname, "fixtures")); it("standalone with scss syntax", () => { const config = { diff --git a/lib/__tests__/standalone.test.js b/lib/__tests__/standalone.test.js index 94adbc4792..26ebad3e69 100644 --- a/lib/__tests__/standalone.test.js +++ b/lib/__tests__/standalone.test.js @@ -3,9 +3,10 @@ const configBlockNoEmpty = require("./fixtures/config-block-no-empty"); const NoFilesFoundError = require("../utils/noFilesFoundError"); const path = require("path"); +const replaceBackslashes = require("./replaceBackslashes"); const standalone = require("../standalone"); -const fixturesPath = path.join(__dirname, "fixtures"); +const fixturesPath = replaceBackslashes(path.join(__dirname, "fixtures")); describe("standalone with one input file", () => { let output; @@ -338,7 +339,9 @@ describe("standalone with config locatable from process.cwd not file", () => { beforeEach(() => { return standalone({ - files: [path.join(__dirname, "./fixtures/empty-block.css")] + files: [ + replaceBackslashes(path.join(__dirname, "./fixtures/empty-block.css")) + ] }).then(data => (results = data.results)); }); From 1fec4fefebc4ae4b87f8dbf40d0fa1a93a679a44 Mon Sep 17 00:00:00 2001 From: Ivan Kopeykin Date: Tue, 10 Sep 2019 23:37:11 +0300 Subject: [PATCH 13/20] Revert "Revert "fix standalone-cache tests"" This reverts commit 41e186d4 --- lib/__tests__/standalone-cache.test.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/__tests__/standalone-cache.test.js b/lib/__tests__/standalone-cache.test.js index 10bd009b18..01f3391dc4 100644 --- a/lib/__tests__/standalone-cache.test.js +++ b/lib/__tests__/standalone-cache.test.js @@ -7,6 +7,7 @@ const fixturesPath = path.join(__dirname, "fixtures"); const cpFile = require("cp-file"); const fileExists = require("file-exists-promise"); const fs = require("fs"); +const replaceBackslashes = require("./replaceBackslashes"); const { promisify } = require("util"); const unlink = promisify(fs.unlink); const fCache = require("file-entry-cache"); @@ -22,7 +23,7 @@ const newFileDest = path.join(fixturesPath, "cache", "newFile.css"); // make sure config doesn't change between runs. function getConfig() { return { - files: path.join(fixturesPath, "cache", "*.css"), + files: replaceBackslashes(path.join(fixturesPath, "cache", "*.css")), config: { rules: { "block-no-empty": true, "color-no-invalid-hex": true } }, From 54ff8179f400f29bcd68ac3f6d8da3ed49982bb5 Mon Sep 17 00:00:00 2001 From: Ivan Kopeykin Date: Tue, 10 Sep 2019 23:49:40 +0300 Subject: [PATCH 14/20] fix: tests --- lib/__tests__/standalone-maxWarnings.test.js | 3 ++- lib/__tests__/standalone-needlessDisables.test.js | 3 ++- system-tests/004/004.test.js | 3 ++- system-tests/cli/cli.test.js | 5 +++-- system-tests/fix/fix.test.js | 9 +++++++-- system-tests/outputFile/outputFile.test.js | 3 ++- system-tests/systemTestUtils.js | 7 ++++++- 7 files changed, 24 insertions(+), 9 deletions(-) diff --git a/lib/__tests__/standalone-maxWarnings.test.js b/lib/__tests__/standalone-maxWarnings.test.js index 5a1ac83655..34adf647c8 100644 --- a/lib/__tests__/standalone-maxWarnings.test.js +++ b/lib/__tests__/standalone-maxWarnings.test.js @@ -1,9 +1,10 @@ "use strict"; const path = require("path"); +const replaceBackslashes = require("./replaceBackslashes"); const standalone = require("../standalone"); -const fixturesPath = path.join(__dirname, "fixtures"); +const fixturesPath = replaceBackslashes(path.join(__dirname, "fixtures")); it("standalone with input css and `maxWarnings`", () => { const config = { diff --git a/lib/__tests__/standalone-needlessDisables.test.js b/lib/__tests__/standalone-needlessDisables.test.js index 9b636730c1..57f47d9808 100644 --- a/lib/__tests__/standalone-needlessDisables.test.js +++ b/lib/__tests__/standalone-needlessDisables.test.js @@ -1,9 +1,10 @@ "use strict"; const path = require("path"); +const replaceBackslashes = require("./replaceBackslashes"); const standalone = require("../standalone"); -const fixturesPath = path.join(__dirname, "fixtures"); +const fixturesPath = replaceBackslashes(path.join(__dirname, "fixtures")); it("standalone with input css and `reportNeedlessDisables`", () => { const config = { diff --git a/system-tests/004/004.test.js b/system-tests/004/004.test.js index 046b78f3d7..b249fa763e 100644 --- a/system-tests/004/004.test.js +++ b/system-tests/004/004.test.js @@ -3,13 +3,14 @@ const path = require("path"); const spawn = require("child_process").spawn; +const { replaceBackslashes } = require("../systemTestUtils"); // this test ensures that CLI returns exit code which is not 0 // when there is a runtime error in configuration javascript file // https://github.com/stylelint/stylelint/issues/2115 it("004", done => { - const localPath = path.resolve(__dirname); + const localPath = replaceBackslashes(path.resolve(__dirname)); const cliPath = path.join(localPath, "../../bin/stylelint.js"); const cliProcess = spawn("node", [cliPath, `${localPath}/*.css`], { diff --git a/system-tests/cli/cli.test.js b/system-tests/cli/cli.test.js index 4afee3b6ed..def72c0dd9 100644 --- a/system-tests/cli/cli.test.js +++ b/system-tests/cli/cli.test.js @@ -4,6 +4,7 @@ const cli = require("../../lib/cli"); const path = require("path"); const pkg = require("../../package.json"); +const { replaceBackslashes } = require("../systemTestUtils"); jest.mock("get-stdin"); @@ -74,7 +75,7 @@ describe("CLI", () => { "--print-config", "--config", path.join(__dirname, "config.json"), - path.join(__dirname, "stylesheet.css") + replaceBackslashes(path.join(__dirname, "stylesheet.css")) ]) ).then(() => { expect(process.exitCode).toBeUndefined(); @@ -99,7 +100,7 @@ describe("CLI", () => { "--report-needless-disables", "--config", path.join(__dirname, "config.json"), - path.join(__dirname, "stylesheet.css") + replaceBackslashes(path.join(__dirname, "stylesheet.css")) ]) ).then(() => { expect(process.exitCode).toBe(2); diff --git a/system-tests/fix/fix.test.js b/system-tests/fix/fix.test.js index 28e591461e..842940767d 100644 --- a/system-tests/fix/fix.test.js +++ b/system-tests/fix/fix.test.js @@ -9,6 +9,7 @@ const path = require("path"); const stylelint = require("../../lib"); const systemTestUtils = require("../systemTestUtils"); const { promisify } = require("util"); +const { replaceBackslashes } = require("../systemTestUtils"); const readFileAsync = promisify(fs.readFile); describe("fix", () => { @@ -17,7 +18,9 @@ describe("fix", () => { beforeEach(() => { tmpDir = os.tmpdir(); - stylesheetPath = path.join(tmpDir, `stylesheet-${_.uniqueId()}.css`); + stylesheetPath = replaceBackslashes( + path.join(tmpDir, `stylesheet-${_.uniqueId()}.css`) + ); return cpFile(path.join(__dirname, "stylesheet.css"), stylesheetPath); }); @@ -142,7 +145,9 @@ describe("fix with BOM", () => { beforeEach(() => { tmpDir = os.tmpdir(); - stylesheetPath = path.join(tmpDir, `stylesheet-with-bom.css`); + stylesheetPath = replaceBackslashes( + path.join(tmpDir, `stylesheet-with-bom.css`) + ); return cpFile(path.join(__dirname, "stylesheet.css"), stylesheetPath); }); diff --git a/system-tests/outputFile/outputFile.test.js b/system-tests/outputFile/outputFile.test.js index 0b369af2b2..33cb52dd35 100644 --- a/system-tests/outputFile/outputFile.test.js +++ b/system-tests/outputFile/outputFile.test.js @@ -8,6 +8,7 @@ const path = require("path"); const spawn = require("child_process").spawn; const systemTestUtils = require("../systemTestUtils"); const { promisify } = require("util"); +const { replaceBackslashes } = require("../systemTestUtils"); const readFileAsync = promisify(fs.readFile); describe("outputFile", () => { @@ -32,7 +33,7 @@ describe("outputFile", () => { "node", [ cliPath, - `${localPath}/*.css`, + replaceBackslashes(`${localPath}/*.css`), "--config=config.json", `--output-file=${directionPath}` ], diff --git a/system-tests/systemTestUtils.js b/system-tests/systemTestUtils.js index 6a74a48eab..a009e9776c 100644 --- a/system-tests/systemTestUtils.js +++ b/system-tests/systemTestUtils.js @@ -5,7 +5,7 @@ const path = require("path"); const stripAnsi = require("strip-ansi"); function caseFilePath(caseNumber, fileName) { - return path.join(__dirname, caseNumber, fileName); + return replaceBackslashes(path.join(__dirname, caseNumber, fileName)); } function caseStylesheetGlob(caseNumber) { @@ -32,12 +32,17 @@ function prepResults(results) { }); } +function replaceBackslashes(str) { + return str.replace(/\\/g, "/"); +} + function stripColors(input) { return stripAnsi(input); } module.exports = { caseFilePath, + replaceBackslashes, caseStylesheetGlob, caseConfig, prepResults, From 6b1d61ecad65db8ed8735cc3c84bd0dd4fba7151 Mon Sep 17 00:00:00 2001 From: Ivan Kopeykin Date: Wed, 11 Sep 2019 00:08:20 +0300 Subject: [PATCH 15/20] fix: tests --- lib/__tests__/needlessDisables.test.js | 5 ++++- lib/__tests__/standalone-maxWarnings.test.js | 2 +- lib/__tests__/standalone-needlessDisables.test.js | 4 +++- lib/__tests__/stylelintignore-test/stylelintignore.test.js | 5 +++-- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/lib/__tests__/needlessDisables.test.js b/lib/__tests__/needlessDisables.test.js index 59eaead81d..753c3b0d2d 100644 --- a/lib/__tests__/needlessDisables.test.js +++ b/lib/__tests__/needlessDisables.test.js @@ -2,11 +2,14 @@ const needlessDisables = require("../needlessDisables"); const path = require("path"); +const replaceBackslashes = require("./replaceBackslashes"); const standalone = require("../standalone"); const stripIndent = require("common-tags").stripIndent; function fixture(name) { - return path.join(__dirname, "./fixtures/needlessDisables", name); + return replaceBackslashes( + path.join(__dirname, "./fixtures/needlessDisables", name) + ); } it("needlessDisables simple case", () => { diff --git a/lib/__tests__/standalone-maxWarnings.test.js b/lib/__tests__/standalone-maxWarnings.test.js index 34adf647c8..b38ab53304 100644 --- a/lib/__tests__/standalone-maxWarnings.test.js +++ b/lib/__tests__/standalone-maxWarnings.test.js @@ -36,7 +36,7 @@ it("standalone with input file(s) and `maxWarnings`", () => { }; return standalone({ - files: path.join(fixturesPath, "empty-block.css"), + files: replaceBackslashes(path.join(fixturesPath, "empty-block.css")), config, maxWarnings: 0 }).then(linted => { diff --git a/lib/__tests__/standalone-needlessDisables.test.js b/lib/__tests__/standalone-needlessDisables.test.js index 57f47d9808..685f7138cc 100644 --- a/lib/__tests__/standalone-needlessDisables.test.js +++ b/lib/__tests__/standalone-needlessDisables.test.js @@ -42,7 +42,9 @@ it("standalone with input file(s) and `reportNeedlessDisables`", () => { }; return standalone({ - files: path.join(fixturesPath, "empty-block-with-disables.css"), + files: replaceBackslashes( + path.join(fixturesPath, "empty-block-with-disables.css") + ), config, reportNeedlessDisables: true }).then(linted => { diff --git a/lib/__tests__/stylelintignore-test/stylelintignore.test.js b/lib/__tests__/stylelintignore-test/stylelintignore.test.js index 54db61cd8d..8b3a481d74 100644 --- a/lib/__tests__/stylelintignore-test/stylelintignore.test.js +++ b/lib/__tests__/stylelintignore-test/stylelintignore.test.js @@ -1,6 +1,7 @@ "use strict"; const path = require("path"); +const replaceBackslashes = require("../replaceBackslashes"); const standalone = require("../../standalone"); describe("stylelintignore", () => { @@ -21,8 +22,8 @@ describe("stylelintignore", () => { beforeEach(() => { return standalone({ files: [ - `${fixturesPath}/empty-block.css`, - `${fixturesPath}/invalid-hex.css` + replaceBackslashes(`${fixturesPath}/empty-block.css`), + replaceBackslashes(`${fixturesPath}/invalid-hex.css`) ], config: { extends: [ From 4934cef1952fdddfa3f879078228d5327421b775 Mon Sep 17 00:00:00 2001 From: Ivan Kopeykin Date: Wed, 11 Sep 2019 00:14:34 +0300 Subject: [PATCH 16/20] Merge #4181 --- docs/user-guide/node-api.md | 8 + flow-typed/stylelint.js | 7 +- lib/__tests__/disableRanges.test.js | 283 +++++++++++++++--- .../.stylelintignore | 0 .../disabled-ranges-1.css | 0 .../disabled-ranges-2.css | 0 .../disabled-ranges-3.css | 0 .../fixtures/disableOptions/ignored-file.css | 6 + .../needlessDisables/ignored-file.css | 3 - lib/__tests__/invalidScopeDisables.test.js | 96 ++++++ lib/__tests__/needlessDisables.test.js | 2 +- .../standalone-invalidScopeDisables.test.js | 53 ++++ lib/assignDisabledRanges.js | 103 +++++-- lib/cli.js | 43 ++- ...sableOptionsReportStringFormatter.test.js} | 12 +- ...=> disableOptionsReportStringFormatter.js} | 2 +- lib/invalidScopeDisables.js | 67 +++++ lib/needlessDisables.js | 4 +- lib/standalone.js | 10 + 19 files changed, 615 insertions(+), 84 deletions(-) rename lib/__tests__/fixtures/{needlessDisables => disableOptions}/.stylelintignore (100%) rename lib/__tests__/fixtures/{needlessDisables => disableOptions}/disabled-ranges-1.css (100%) rename lib/__tests__/fixtures/{needlessDisables => disableOptions}/disabled-ranges-2.css (100%) rename lib/__tests__/fixtures/{needlessDisables => disableOptions}/disabled-ranges-3.css (100%) create mode 100644 lib/__tests__/fixtures/disableOptions/ignored-file.css delete mode 100644 lib/__tests__/fixtures/needlessDisables/ignored-file.css create mode 100644 lib/__tests__/invalidScopeDisables.test.js create mode 100644 lib/__tests__/standalone-invalidScopeDisables.test.js rename lib/formatters/__tests__/{needlessDisablesStringFormatter.test.js => disableOptionsReportStringFormatter.test.js} (73%) rename lib/formatters/{needlessDisablesStringFormatter.js => disableOptionsReportStringFormatter.js} (94%) create mode 100644 lib/invalidScopeDisables.js diff --git a/docs/user-guide/node-api.md b/docs/user-guide/node-api.md index 0ddcfd78e7..94f208b4c7 100644 --- a/docs/user-guide/node-api.md +++ b/docs/user-guide/node-api.md @@ -118,6 +118,14 @@ Use this report to clean up your codebase, keeping only the stylelint-disable co *The recommended way to use this option is through the CLI.* It will output a clean report to the console. +### `reportInvalidScopeDisables` + +If `true`, the returned data will contain a `invalidScopeDisables` property, whose value is an array of objects, one for each source, with tells you which rule in `stylelint-disable ` comment don't exist within the configuration object. + +Use this report to clean up your codebase, keeping only the stylelint-disable comments that serve a purpose. + +*The recommended way to use this option is through the CLI.* It will output a clean report to the console. + ### `maxWarnings` Sets a limit to the number of warnings accepted. Will add a `maxWarningsExceeded` property to the returned data if the number of found warnings exceeds the given limit. diff --git a/flow-typed/stylelint.js b/flow-typed/stylelint.js index 046f3b9866..d8f117195d 100644 --- a/flow-typed/stylelint.js +++ b/flow-typed/stylelint.js @@ -36,6 +36,7 @@ export type stylelint$options = { configOverrides?: Object, ignoreDisables?: boolean, ignorePath?: string, + reportInvalidScopeDisables?: boolean, reportNeedlessDisables?: boolean, syntax?: stylelint$syntaxes, customSyntax?: string, @@ -107,7 +108,7 @@ export type stylelint$cssSyntaxError = { source: string }; -export type stylelint$needlessDisablesReport = Array<{ +export type stylelint$disableOptionsReport = Array<{ source: string, ranges: Array<{ unusedRule: string, @@ -124,7 +125,8 @@ export type stylelint$standaloneReturnValue = { maxWarnings: number, foundWarnings: number }, - needlessDisables?: stylelint$needlessDisablesReport + needlessDisables?: stylelint$disableOptionsReport, + invalidScopeDisables?: stylelint$disableOptionsReport }; export type stylelint$standaloneOptions = { @@ -143,6 +145,7 @@ export type stylelint$standaloneOptions = { ignorePath?: string, ignorePattern?: RegExp, reportNeedlessDisables?: boolean, + reportInvalidScopeDisables?: boolean, maxWarnings?: number, syntax?: stylelint$syntaxes, customSyntax?: string, diff --git a/lib/__tests__/disableRanges.test.js b/lib/__tests__/disableRanges.test.js index cac168117e..081566a857 100644 --- a/lib/__tests__/disableRanges.test.js +++ b/lib/__tests__/disableRanges.test.js @@ -16,7 +16,8 @@ it("disable without re-enabling", () => { expect(result.stylelint.disabledRanges).toEqual({ all: [ { - start: 1 + start: 1, + strictStart: true } ] }); @@ -30,7 +31,14 @@ it("disable and re-enable", () => { /* stylelint-enable */ .foo {}`).then(result => { expect(result.stylelint.disabledRanges).toEqual({ - all: [{ start: 2, end: 4 }] + all: [ + { + start: 2, + end: 4, + strictStart: true, + strictEnd: true + } + ] }); }); }); @@ -46,7 +54,20 @@ it("disable and re-enable twice", () => { /* stylelint-enable */ .foo {}`).then(result => { expect(result.stylelint.disabledRanges).toEqual({ - all: [{ start: 2, end: 4 }, { start: 6, end: 8 }] + all: [ + { + start: 2, + end: 4, + strictStart: true, + strictEnd: true + }, + { + start: 6, + end: 8, + strictStart: true, + strictEnd: true + } + ] }); }); }); @@ -56,7 +77,14 @@ it("disable rule without re-enabling", () => { .then(result => { expect(result.stylelint.disabledRanges).toEqual({ all: [], - "foo-bar": [{ start: 1 }] + "foo-bar": [ + { + start: 1, + strictStart: true, + end: undefined, + strictEnd: undefined + } + ] }); }) .then(() => { @@ -65,7 +93,14 @@ it("disable rule without re-enabling", () => { ).then(result => { expect(result.stylelint.disabledRanges).toEqual({ all: [], - "selector-combinator-space-before": [{ start: 1 }] + "selector-combinator-space-before": [ + { + start: 1, + strictStart: true, + end: undefined, + strictEnd: undefined + } + ] }); }); }); @@ -83,8 +118,28 @@ it("mixed disabling of specific and all rules, enabling of all", () => { .foo {}`).then(result => { expect(result.stylelint.disabledRanges).toEqual({ all: [], - "foo-bar": [{ start: 2, end: 4 }, { start: 6, end: 8 }], - "baz-maz": [{ start: 6, end: 8 }] + "foo-bar": [ + { + start: 2, + end: 4, + strictStart: true, + strictEnd: false + }, + { + start: 6, + end: 8, + strictStart: true, + strictEnd: false + } + ], + "baz-maz": [ + { + start: 6, + end: 8, + strictStart: true, + strictEnd: false + } + ] }); }); }); @@ -95,9 +150,24 @@ it("disable rules with newline in rule list", () => { ).then(result => { expect(result.stylelint.disabledRanges).toEqual({ all: [], - "foo-bar": [{ start: 1 }], - "hoo-hah": [{ start: 1 }], - slime: [{ start: 1 }] + "foo-bar": [ + { + start: 1, + strictStart: true + } + ], + "hoo-hah": [ + { + start: 1, + strictStart: true + } + ], + slime: [ + { + start: 1, + strictStart: true + } + ] }); }); }); @@ -109,7 +179,9 @@ it("disable single line all rules", () => { all: [ { start: 1, - end: 1 + end: 1, + strictStart: true, + strictEnd: true } ] }, @@ -128,7 +200,9 @@ it("disable single line one rule", () => { "block-no-empty": [ { start: 1, - end: 1 + end: 1, + strictStart: true, + strictEnd: true } ] }, @@ -147,13 +221,17 @@ it("disable single line multiple rules", () => { "block-no-empty": [ { start: 3, - end: 3 + end: 3, + strictStart: true, + strictEnd: true } ], blergh: [ { start: 3, - end: 3 + end: 3, + strictStart: true, + strictEnd: true } ] }, @@ -170,7 +248,9 @@ it("disable next line all rules", () => { all: [ { start: 2, - end: 2 + end: 2, + strictStart: true, + strictEnd: true } ] }, @@ -190,7 +270,9 @@ it("disable next line one rule", () => { "block-no-empty": [ { start: 2, - end: 2 + end: 2, + strictStart: true, + strictEnd: true } ] }, @@ -213,13 +295,17 @@ it("disable next line multiple rules", () => { "block-no-empty": [ { start: 5, - end: 5 + end: 5, + strictStart: true, + strictEnd: true } ], blergh: [ { start: 5, - end: 5 + end: 5, + strictStart: true, + strictEnd: true } ] }, @@ -243,7 +329,9 @@ it("SCSS // line-disabling comment", () => { "declaration-no-important": [ { start: 2, - end: 2 + end: 2, + strictStart: true, + strictEnd: true } ] }); @@ -264,7 +352,9 @@ it("Less // line-disabling comment", () => { "declaration-no-important": [ { start: 2, - end: 2 + end: 2, + strictStart: true, + strictEnd: true } ] }); @@ -280,10 +370,38 @@ it("nested ranges all rule-specific", () => { /* stylelint-enable baz */`).then(result => { expect(result.stylelint.disabledRanges).toEqual({ all: [], - foo: [{ start: 1, end: 5 }], - bar: [{ start: 2, end: 4 }], - baz: [{ start: 3, end: 6 }], - hop: [{ start: 3, end: 5 }] + foo: [ + { + start: 1, + end: 5, + strictStart: true, + strictEnd: true + } + ], + bar: [ + { + start: 2, + end: 4, + strictStart: true, + strictEnd: true + } + ], + baz: [ + { + start: 3, + end: 6, + strictStart: true, + strictEnd: true + } + ], + hop: [ + { + start: 3, + end: 5, + strictStart: true, + strictEnd: true + } + ] }); }); }); @@ -294,8 +412,28 @@ it("nested ranges all for all rules", () => { /* stylelint-disable bar */ /* stylelint-enable */`).then(result => { expect(result.stylelint.disabledRanges).toEqual({ - all: [{ start: 1, end: 4 }], - bar: [{ start: 1, end: 2 }, { start: 3, end: 4 }] + all: [ + { + start: 1, + end: 4, + strictStart: true, + strictEnd: true + } + ], + bar: [ + { + start: 1, + end: 2, + strictStart: false, + strictEnd: true + }, + { + start: 3, + end: 4, + strictStart: true, + strictEnd: false + } + ] }); }); }); @@ -306,9 +444,30 @@ it("nested ranges disable rules enable all", () => { /* stylelint-enable */`).then(result => { expect(result.stylelint.disabledRanges).toEqual({ all: [], - foo: [{ start: 1, end: 3 }], - bar: [{ start: 2, end: 3 }], - baz: [{ start: 2, end: 3 }] + foo: [ + { + start: 1, + end: 3, + strictStart: true, + strictEnd: false + } + ], + bar: [ + { + start: 2, + end: 3, + strictStart: true, + strictEnd: false + } + ], + baz: [ + { + start: 2, + end: 3, + strictStart: true, + strictEnd: false + } + ] }); }); }); @@ -319,9 +478,36 @@ it("nested ranges mix disabling enabling all rules and specific rules", () => { /* stylelint-enable */ /* stylelint-disable bar */`).then(result => { expect(result.stylelint.disabledRanges).toEqual({ - all: [{ start: 1, end: 3 }], - foo: [{ start: 1, end: 2 }], - bar: [{ start: 1, end: 3 }, { start: 4 }] + all: [ + { + start: 1, + end: 3, + strictStart: true, + strictEnd: true + } + ], + foo: [ + { + start: 1, + end: 2, + strictStart: false, + strictEnd: true + } + ], + bar: [ + { + start: 1, + end: 3, + strictStart: false, + strictEnd: false + }, + { + start: 4, + strictStart: true, + strictEnd: undefined, + end: undefined + } + ] }); }); }); @@ -333,9 +519,36 @@ it("nested ranges another mix", () => { /* stylelint-disable foo */ /* stylelint-enable */`).then(result => { expect(result.stylelint.disabledRanges).toEqual({ - all: [{ start: 1, end: 5 }], - foo: [{ start: 1, end: 3 }, { start: 4, end: 5 }], - bar: [{ start: 1, end: 2 }] + all: [ + { + start: 1, + end: 5, + strictStart: true, + strictEnd: true + } + ], + foo: [ + { + start: 1, + end: 3, + strictStart: false, + strictEnd: true + }, + { + start: 4, + end: 5, + strictStart: true, + strictEnd: false + } + ], + bar: [ + { + start: 1, + end: 2, + strictStart: false, + strictEnd: true + } + ] }); }); }); diff --git a/lib/__tests__/fixtures/needlessDisables/.stylelintignore b/lib/__tests__/fixtures/disableOptions/.stylelintignore similarity index 100% rename from lib/__tests__/fixtures/needlessDisables/.stylelintignore rename to lib/__tests__/fixtures/disableOptions/.stylelintignore diff --git a/lib/__tests__/fixtures/needlessDisables/disabled-ranges-1.css b/lib/__tests__/fixtures/disableOptions/disabled-ranges-1.css similarity index 100% rename from lib/__tests__/fixtures/needlessDisables/disabled-ranges-1.css rename to lib/__tests__/fixtures/disableOptions/disabled-ranges-1.css diff --git a/lib/__tests__/fixtures/needlessDisables/disabled-ranges-2.css b/lib/__tests__/fixtures/disableOptions/disabled-ranges-2.css similarity index 100% rename from lib/__tests__/fixtures/needlessDisables/disabled-ranges-2.css rename to lib/__tests__/fixtures/disableOptions/disabled-ranges-2.css diff --git a/lib/__tests__/fixtures/needlessDisables/disabled-ranges-3.css b/lib/__tests__/fixtures/disableOptions/disabled-ranges-3.css similarity index 100% rename from lib/__tests__/fixtures/needlessDisables/disabled-ranges-3.css rename to lib/__tests__/fixtures/disableOptions/disabled-ranges-3.css diff --git a/lib/__tests__/fixtures/disableOptions/ignored-file.css b/lib/__tests__/fixtures/disableOptions/ignored-file.css new file mode 100644 index 0000000000..5e12653335 --- /dev/null +++ b/lib/__tests__/fixtures/disableOptions/ignored-file.css @@ -0,0 +1,6 @@ +/* stylelint-disable color-named */ +a {} +/* stylelint-enable */ +/* stylelint-disable block-no-empty */ +a {} +/* stylelint-enable */ diff --git a/lib/__tests__/fixtures/needlessDisables/ignored-file.css b/lib/__tests__/fixtures/needlessDisables/ignored-file.css deleted file mode 100644 index 47647af08b..0000000000 --- a/lib/__tests__/fixtures/needlessDisables/ignored-file.css +++ /dev/null @@ -1,3 +0,0 @@ -/* stylelint-disable color-named */ -a {} -/* stylelint-enable */ diff --git a/lib/__tests__/invalidScopeDisables.test.js b/lib/__tests__/invalidScopeDisables.test.js new file mode 100644 index 0000000000..230d24153a --- /dev/null +++ b/lib/__tests__/invalidScopeDisables.test.js @@ -0,0 +1,96 @@ +"use strict"; + +const invalidScopeDisables = require("../invalidScopeDisables"); +const path = require("path"); +const replaceBackslashes = require("./replaceBackslashes"); +const standalone = require("../standalone"); +const stripIndent = require("common-tags").stripIndent; + +function fixture(name) { + return replaceBackslashes( + path.join(__dirname, "./fixtures/disableOptions", name) + ); +} + +it("invalidScopeDisables simple case", () => { + const config = { + rules: { + "block-closing-brace-newline-after": ["always"], + "block-closing-brace-newline-before": ["always"] + } + }; + + const css = stripIndent` + /* stylelint-disable block-no-empty */ + a {} + /* stylelint-enable block-no-empty */ + a { + b {} /* stylelint-disable-line block-no-empty */ + } + `; + + return standalone({ + config, + code: css + }).then(linted => { + const report = invalidScopeDisables(linted.results, config); + + expect(report).toHaveLength(1); + expect(report[0].ranges).toHaveLength(2); + expect(report[0].ranges).toEqual([ + { end: 3, start: 1, unusedRule: "block-no-empty" }, + { end: 5, start: 5, unusedRule: "block-no-empty" } + ]); + }); +}); + +it("invalidScopeDisables complex case", () => { + const config = { + rules: { + "block-no-empty": true + } + }; + + return standalone({ + config, + files: [ + fixture("disabled-ranges-1.css"), + fixture("disabled-ranges-2.css"), + // ignore files contain `CssSyntaxError` + fixture("disabled-ranges-3.css") + ] + }).then(linted => { + expect(invalidScopeDisables(linted.results, config)).toEqual([ + { + source: fixture("disabled-ranges-1.css"), + ranges: [{ start: 1, end: 3, unusedRule: "color-named" }] + }, + { + source: fixture("disabled-ranges-2.css"), + ranges: [{ start: 5, end: 5, unusedRule: "color-named" }] + } + ]); + }); +}); + +it("invalidScopeDisables ignored case", () => { + const config = { + rules: { + "color-named": "never" + } + }; + + return standalone({ + config, + files: [fixture("disabled-ranges-1.css"), fixture("ignored-file.css")], + ignoreDisables: true, + ignorePath: fixture(".stylelintignore") + }).then(linted => { + expect(invalidScopeDisables(linted.results, config)).toEqual([ + { + source: fixture("disabled-ranges-1.css"), + ranges: [{ start: 5, end: 7, unusedRule: "block-no-empty" }] + } + ]); + }); +}); diff --git a/lib/__tests__/needlessDisables.test.js b/lib/__tests__/needlessDisables.test.js index 753c3b0d2d..1fedd105a2 100644 --- a/lib/__tests__/needlessDisables.test.js +++ b/lib/__tests__/needlessDisables.test.js @@ -8,7 +8,7 @@ const stripIndent = require("common-tags").stripIndent; function fixture(name) { return replaceBackslashes( - path.join(__dirname, "./fixtures/needlessDisables", name) + path.join(__dirname, "./fixtures/disableOptions", name) ); } diff --git a/lib/__tests__/standalone-invalidScopeDisables.test.js b/lib/__tests__/standalone-invalidScopeDisables.test.js new file mode 100644 index 0000000000..0e7bdd6b8e --- /dev/null +++ b/lib/__tests__/standalone-invalidScopeDisables.test.js @@ -0,0 +1,53 @@ +"use strict"; + +const path = require("path"); +const replaceBackslashes = require("./replaceBackslashes"); +const standalone = require("../standalone"); + +const fixturesPath = replaceBackslashes(path.join(__dirname, "fixtures")); +const config = { + quiet: true, + rules: { + "block-no-empty": true + } +}; + +it("standalone with input css and `reportInvalidScopeDisables`", () => { + return standalone({ + code: "/* stylelint-disable color-named */\na {}", + config, + reportInvalidScopeDisables: true + }).then(linted => { + const invalidScopeDisables = linted.invalidScopeDisables; + + expect(typeof invalidScopeDisables).toBe("object"); + expect(invalidScopeDisables).toHaveLength(1); + expect(invalidScopeDisables[0].ranges).toHaveLength(1); + expect(invalidScopeDisables[0].ranges[0]).toEqual({ + start: 1, + unusedRule: "color-named" + }); + }); +}); + +it("standalone with input file(s) and `reportInvalidScopeDisables`", () => { + return standalone({ + files: replaceBackslashes( + path.join(fixturesPath, "empty-block-with-disables.css") + ), + config, + reportInvalidScopeDisables: true + }).then(linted => { + const invalidScopeDisables = linted.invalidScopeDisables; + + expect(typeof invalidScopeDisables).toBe("object"); + expect(invalidScopeDisables).toHaveLength(1); + expect(invalidScopeDisables[0].source).toBe( + path.join(fixturesPath, "empty-block-with-disables.css") + ); + expect(invalidScopeDisables[0].ranges[0]).toEqual({ + start: 1, + unusedRule: "color-named" + }); + }); +}); diff --git a/lib/assignDisabledRanges.js b/lib/assignDisabledRanges.js index 9e489f04e4..9b5370780c 100644 --- a/lib/assignDisabledRanges.js +++ b/lib/assignDisabledRanges.js @@ -10,13 +10,32 @@ const disableLineCommand = COMMAND_PREFIX + "disable-line"; const disableNextLineCommand = COMMAND_PREFIX + "disable-next-line"; const ALL_RULES = "all"; -/*:: type disabledRangeObject = { - [ruleName: string]: Array<{ +/*:: type disableRange = { start: number, end?: number, - }> + strictStart: boolean, + strictEnd?: boolean + } + */ + +/*:: type disabledRangeObject = { + [ruleName: string]: Array }*/ +function createDisableRange( + start /*: number*/, + strictStart /*: boolean*/, + end /*: ?number*/, + strictEnd /*: ?boolean*/ +) /*: disableRange*/ { + return { + start, + end: end || undefined, + strictStart, + strictEnd: typeof strictEnd === "boolean" ? strictEnd : undefined + }; +} + // Run it like a plugin ... module.exports = function( root /*: Object*/, @@ -66,38 +85,43 @@ module.exports = function( if (ruleName === ALL_RULES) { Object.keys(disabledRanges).forEach(disabledRuleName => { - startDisabledRange(line, disabledRuleName); - endDisabledRange(line, disabledRuleName); + const strict = disabledRuleName === ALL_RULES; + + startDisabledRange(line, disabledRuleName, strict); + endDisabledRange(line, disabledRuleName, strict); }); } else { - startDisabledRange(line, ruleName); - endDisabledRange(line, ruleName); + startDisabledRange(line, ruleName, true); + endDisabledRange(line, ruleName, true); } } function processDisableCommand(comment /*: postcss$comment*/) { getCommandRules(disableCommand, comment.text).forEach(ruleToDisable => { - if (ruleToDisable === ALL_RULES) { - if (ruleIsDisabled(ALL_RULES)) { - throw comment.error("All rules have already been disabled", { - plugin: "stylelint" - }); - } + const isAllRules = ruleToDisable === ALL_RULES; - Object.keys(disabledRanges).forEach(ruleName => { - startDisabledRange(comment.source.start.line, ruleName); - }); - - return; + if (ruleIsDisabled(ruleToDisable)) { + throw comment.error( + isAllRules + ? "All rules have already been disabled" + : `"${ruleToDisable}" has already been disabled`, + { + plugin: "stylelint" + } + ); } - if (ruleIsDisabled(ruleToDisable)) { - throw comment.error(`"${ruleToDisable}" has already been disabled`, { - plugin: "stylelint" + if (isAllRules) { + Object.keys(disabledRanges).forEach(ruleName => { + startDisabledRange( + comment.source.start.line, + ruleName, + ruleName === ALL_RULES + ); }); + } else { + startDisabledRange(comment.source.start.line, ruleToDisable, true); } - - startDisabledRange(comment.source.start.line, ruleToDisable); }); } @@ -116,7 +140,11 @@ module.exports = function( Object.keys(disabledRanges).forEach(ruleName => { if (!_.get(_.last(disabledRanges[ruleName]), "end")) { - endDisabledRange(comment.source.end.line, ruleName); + endDisabledRange( + comment.source.end.line, + ruleName, + ruleName === ALL_RULES + ); } }); @@ -129,20 +157,22 @@ module.exports = function( ) { // Get a starting point from the where all rules were disabled if (!disabledRanges[ruleToEnable]) { - disabledRanges[ruleToEnable] = _.cloneDeep(disabledRanges.all); + disabledRanges[ruleToEnable] = disabledRanges.all.map( + ({ start, end }) => createDisableRange(start, false, end, false) + ); } else { disabledRanges[ruleToEnable].push( _.clone(_.last(disabledRanges[ALL_RULES])) ); } - endDisabledRange(comment.source.end.line, ruleToEnable); + endDisabledRange(comment.source.end.line, ruleToEnable, true); return; } if (ruleIsDisabled(ruleToEnable)) { - endDisabledRange(comment.source.end.line, ruleToEnable); + endDisabledRange(comment.source.end.line, ruleToEnable, true); return; } @@ -188,14 +218,22 @@ module.exports = function( return rules; } - function startDisabledRange(line /*: number*/, ruleName /*: string*/) { - const rangeObj = { start: line }; + function startDisabledRange( + line /*: number*/, + ruleName /*: string*/, + strict /*: boolean*/ + ) { + const rangeObj = createDisableRange(line, strict); ensureRuleRanges(ruleName); disabledRanges[ruleName].push(rangeObj); } - function endDisabledRange(line /*: number*/, ruleName /*: string*/) { + function endDisabledRange( + line /*: number*/, + ruleName /*: string*/, + strict /*: boolean*/ + ) { const lastRangeForRule = _.last(disabledRanges[ruleName]); if (!lastRangeForRule) { @@ -204,11 +242,14 @@ module.exports = function( // Add an `end` prop to the last range of that rule lastRangeForRule.end = line; + lastRangeForRule.strictEnd = strict; } function ensureRuleRanges(ruleName /*: string*/) { if (!disabledRanges[ruleName]) { - disabledRanges[ruleName] = _.cloneDeep(disabledRanges.all); + disabledRanges[ruleName] = disabledRanges.all.map(({ start, end }) => + createDisableRange(start, false, end, false) + ); } } diff --git a/lib/cli.js b/lib/cli.js index 22cd9f14a6..b38b7005a5 100644 --- a/lib/cli.js +++ b/lib/cli.js @@ -3,13 +3,13 @@ const chalk = require("chalk"); const checkInvalidCLIOptions = require("./utils/checkInvalidCLIOptions"); +const disableOptionsReportStringFormatter = require("./formatters/disableOptionsReportStringFormatter"); const dynamicRequire = require("./dynamicRequire"); const EOL = require("os").EOL; const getFormatterOptionsText = require("./utils/getFormatterOptionsText"); const getModulePath = require("./utils/getModulePath"); const getStdin = require("get-stdin"); const meow = require("meow"); -const needlessDisablesStringFormatter = require("./formatters/needlessDisablesStringFormatter"); const path = require("path"); const printConfig = require("./printConfig"); const resolveFrom = require("resolve-from"); @@ -126,7 +126,8 @@ const EXIT_CODE_ERROR = 2; maxWarnings: number, outputFile: string, quiet: any, - reportNeedlessDisables: any, + reportNeedlessDisables: boolean, + reportInvalidScopeDisables: boolean, stdinFilename: any, syntax: any, v: string, @@ -156,7 +157,8 @@ const EXIT_CODE_ERROR = 2; ignoreDisables?: any, ignorePath?: any, outputFile?: string, - reportNeedlessDisables?: any, + reportNeedlessDisables?: boolean, + reportInvalidScopeDisables?: boolean, maxWarnings?: any, syntax?: any, disableDefaultIgnores?: any, @@ -277,6 +279,11 @@ const meowOptions /*: meowOptionsType*/ = { Also report errors for stylelint-disable comments that are not blocking a lint warning. The process will exit with code ${EXIT_CODE_ERROR} if needless disables are found. + --report-invalid-scope-disables, --risd + + Report stylelint-disable comments that used for rules that don't exist within the configuration object. + The process will exit with code ${EXIT_CODE_ERROR} if invalid scope disables are found. + --max-warnings, --mw Number of warnings above which the process will exit with code ${EXIT_CODE_ERROR}. @@ -362,6 +369,10 @@ const meowOptions /*: meowOptionsType*/ = { alias: "rd", type: "boolean" }, + "report-invalid-scope-disables": { + alias: "risd", + type: "boolean" + }, "max-warnings": { alias: "mw" }, @@ -483,11 +494,16 @@ module.exports = (argv /*: string[]*/) /*: Promise|void*/ => { } const reportNeedlessDisables = cli.flags.reportNeedlessDisables; + const reportInvalidScopeDisables = cli.flags.reportInvalidScopeDisables; if (reportNeedlessDisables) { optionsBase.reportNeedlessDisables = reportNeedlessDisables; } + if (reportInvalidScopeDisables) { + optionsBase.reportInvalidScopeDisables = reportInvalidScopeDisables; + } + const maxWarnings = cli.flags.maxWarnings; if (maxWarnings !== undefined) { @@ -542,18 +558,33 @@ module.exports = (argv /*: string[]*/) /*: Promise|void*/ => { return standalone(options) .then(linted => { + const reports = []; + if (reportNeedlessDisables) { - const report = needlessDisablesStringFormatter( + const report = disableOptionsReportStringFormatter( linted.needlessDisables ); - process.stdout.write(report); + if (report) { + reports.push(report); + } + } + + if (reportInvalidScopeDisables) { + const report = disableOptionsReportStringFormatter( + linted.invalidScopeDisables + ); if (report) { - process.exitCode = EXIT_CODE_ERROR; + reports.push(report); } } + if (reports.length > 0) { + reports.forEach(report => process.stdout.write(report)); + process.exitCode = EXIT_CODE_ERROR; + } + if (!linted.output) { return; } diff --git a/lib/formatters/__tests__/needlessDisablesStringFormatter.test.js b/lib/formatters/__tests__/disableOptionsReportStringFormatter.test.js similarity index 73% rename from lib/formatters/__tests__/needlessDisablesStringFormatter.test.js rename to lib/formatters/__tests__/disableOptionsReportStringFormatter.test.js index 5a53a88c7c..9a575fc5a1 100644 --- a/lib/formatters/__tests__/needlessDisablesStringFormatter.test.js +++ b/lib/formatters/__tests__/disableOptionsReportStringFormatter.test.js @@ -1,13 +1,13 @@ "use strict"; -const needlessDisablesStringFormatter = require("../needlessDisablesStringFormatter"); +const disableOptionsReportStringFormatterTest = require("../disableOptionsReportStringFormatter"); const stripAnsi = require("strip-ansi"); const stripIndent = require("common-tags").stripIndent; -describe("needlessDisablesStringFormatter", () => { +describe("disableOptionsReportStringFormatter", () => { it("formatter stringified", () => { const actual = stripAnsi( - needlessDisablesStringFormatter([ + disableOptionsReportStringFormatterTest([ { source: "foo", ranges: [ @@ -42,4 +42,10 @@ describe("needlessDisablesStringFormatter", () => { expect(actual).toBe(expected); }); + + it("empty report", () => { + const actual = stripAnsi(disableOptionsReportStringFormatterTest()); + + expect(actual).toBe(""); + }); }); diff --git a/lib/formatters/needlessDisablesStringFormatter.js b/lib/formatters/disableOptionsReportStringFormatter.js similarity index 94% rename from lib/formatters/needlessDisablesStringFormatter.js rename to lib/formatters/disableOptionsReportStringFormatter.js index 3c4a13fabb..ccd6966398 100644 --- a/lib/formatters/needlessDisablesStringFormatter.js +++ b/lib/formatters/disableOptionsReportStringFormatter.js @@ -15,7 +15,7 @@ function logFrom(fromValue /*: string */) /*: string */ { } module.exports = function( - report /*:: ?: stylelint$needlessDisablesReport */ + report /*:: ?: stylelint$disableOptionsReport */ ) /*: string */ { if (!report) return ""; diff --git a/lib/invalidScopeDisables.js b/lib/invalidScopeDisables.js new file mode 100644 index 0000000000..9f19b923c6 --- /dev/null +++ b/lib/invalidScopeDisables.js @@ -0,0 +1,67 @@ +/* @flow */ +"use strict"; + +/*:: type rangeDataType = { + all: Array, +} +*/ + +/*:: type rangeType = { + unusedRule: string, + end?: number, + start: number, + used?: boolean, +}*/ + +/*:: type unusedRangeT = { + start: number, + end?: number, + strictStart: boolean, + strictEnd?: boolean +}*/ + +module.exports = function( + results /*: Array*/, + config /*: stylelint$config*/ +) /*: stylelint$disableOptionsReport*/ { + const report = []; + const usedRules = new Set(Object.keys(config.rules || {})); + + usedRules.add("all"); + + results.forEach(result => { + // File with `CssSyntaxError` have not `_postcssResult` + if (!result._postcssResult) { + return; + } + + const sourceReport = { source: result.source, ranges: [] }; + const rangeData /*: rangeDataType*/ = + result._postcssResult.stylelint.disabledRanges; + const disabledRules = Object.keys(rangeData); + + disabledRules.forEach(rule => { + if (usedRules.has(rule)) { + return; + } + + rangeData[rule].forEach((range /*: unusedRangeT */) => { + if (!range.strictStart && !range.strictEnd) { + return; + } + + sourceReport.ranges.push({ + unusedRule: rule, + start: range.start, + end: range.end + }); + }); + }); + + if (sourceReport.ranges.length > 0) { + report.push(sourceReport); + } + }); + + return report; +}; diff --git a/lib/needlessDisables.js b/lib/needlessDisables.js index f6c206e268..0dafa6c786 100644 --- a/lib/needlessDisables.js +++ b/lib/needlessDisables.js @@ -22,7 +22,7 @@ const _ = require("lodash"); module.exports = function( results /*: Array*/ -) /*: stylelint$needlessDisablesReport*/ { +) /*: stylelint$disableOptionsReport*/ { const report = []; results.forEach(result => { @@ -80,7 +80,7 @@ module.exports = function( // mark this range as unused if (!range.used && !alreadyMarkedUnused) { range.unusedRule = rule; - unused.ranges.push(range); + unused.ranges.push(_.omit(range, "strictStart", "strictEnd")); } // If this range is used but an equivalent has been marked as unused, diff --git a/lib/standalone.js b/lib/standalone.js index 1115ffa176..e1aa697fc1 100644 --- a/lib/standalone.js +++ b/lib/standalone.js @@ -13,6 +13,7 @@ const getFormatterOptionsText = require("./utils/getFormatterOptionsText"); const globby /*: Function*/ = require("globby"); const hash = require("./utils/hash"); const ignore = require("ignore"); +const invalidScopeDisables /*: Function*/ = require("./invalidScopeDisables"); const needlessDisables /*: Function*/ = require("./needlessDisables"); const NoFilesFoundError = require("./utils/noFilesFoundError"); const path = require("path"); @@ -41,6 +42,7 @@ module.exports = function( const formatter = options.formatter; const ignoreDisables = options.ignoreDisables; const reportNeedlessDisables = options.reportNeedlessDisables; + const reportInvalidScopeDisables = options.reportInvalidScopeDisables; const maxWarnings = options.maxWarnings; const syntax = options.syntax; const allowEmptyInput = options.allowEmptyInput || false; @@ -101,6 +103,7 @@ module.exports = function( ignoreDisables, ignorePath: ignoreFilePath, reportNeedlessDisables, + reportInvalidScopeDisables, syntax, customSyntax, fix @@ -291,6 +294,13 @@ module.exports = function( returnValue.needlessDisables = needlessDisables(stylelintResults); } + if (reportInvalidScopeDisables) { + returnValue.invalidScopeDisables = invalidScopeDisables( + stylelintResults, + stylelint._options.config + ); + } + if (maxWarnings !== undefined) { const foundWarnings = stylelintResults.reduce((count, file) => { return count + file.warnings.length; From 1dc83dda08cce40b3e69a794455792dad0bbd6de Mon Sep 17 00:00:00 2001 From: Ivan Kopeykin Date: Wed, 11 Sep 2019 00:27:38 +0300 Subject: [PATCH 17/20] fix tests again --- lib/__tests__/invalidScopeDisables.test.js | 10 +++++++--- lib/__tests__/needlessDisables.test.js | 10 +++++++--- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/lib/__tests__/invalidScopeDisables.test.js b/lib/__tests__/invalidScopeDisables.test.js index 230d24153a..472dde0593 100644 --- a/lib/__tests__/invalidScopeDisables.test.js +++ b/lib/__tests__/invalidScopeDisables.test.js @@ -12,6 +12,10 @@ function fixture(name) { ); } +function source(name) { + return path.join(__dirname, "./fixtures/disableOptions", name); +} + it("invalidScopeDisables simple case", () => { const config = { rules: { @@ -62,11 +66,11 @@ it("invalidScopeDisables complex case", () => { }).then(linted => { expect(invalidScopeDisables(linted.results, config)).toEqual([ { - source: fixture("disabled-ranges-1.css"), + source: source("disabled-ranges-1.css"), ranges: [{ start: 1, end: 3, unusedRule: "color-named" }] }, { - source: fixture("disabled-ranges-2.css"), + source: source("disabled-ranges-2.css"), ranges: [{ start: 5, end: 5, unusedRule: "color-named" }] } ]); @@ -88,7 +92,7 @@ it("invalidScopeDisables ignored case", () => { }).then(linted => { expect(invalidScopeDisables(linted.results, config)).toEqual([ { - source: fixture("disabled-ranges-1.css"), + source: source("disabled-ranges-1.css"), ranges: [{ start: 5, end: 7, unusedRule: "block-no-empty" }] } ]); diff --git a/lib/__tests__/needlessDisables.test.js b/lib/__tests__/needlessDisables.test.js index 1fedd105a2..5e423a6bf2 100644 --- a/lib/__tests__/needlessDisables.test.js +++ b/lib/__tests__/needlessDisables.test.js @@ -6,6 +6,10 @@ const replaceBackslashes = require("./replaceBackslashes"); const standalone = require("../standalone"); const stripIndent = require("common-tags").stripIndent; +function source(name) { + return path.join(__dirname, "./fixtures/disableOptions", name); +} + function fixture(name) { return replaceBackslashes( path.join(__dirname, "./fixtures/disableOptions", name) @@ -67,7 +71,7 @@ it("needlessDisables complex case", () => { }).then(linted => { expect(needlessDisables(linted.results)).toEqual([ { - source: fixture("disabled-ranges-1.css"), + source: source("disabled-ranges-1.css"), ranges: [ { start: 1, end: 3, unusedRule: "color-named" }, { start: 5, end: 7, unusedRule: "block-no-empty" }, @@ -75,7 +79,7 @@ it("needlessDisables complex case", () => { ] }, { - source: fixture("disabled-ranges-2.css"), + source: source("disabled-ranges-2.css"), ranges: [ { start: 5, end: 5, unusedRule: "color-named" }, { start: 6, end: 6, unusedRule: "block-no-empty" }, @@ -101,7 +105,7 @@ it("needlessDisables ignored case", () => { }).then(linted => { expect(needlessDisables(linted.results)).toEqual([ { - source: fixture("disabled-ranges-1.css"), + source: source("disabled-ranges-1.css"), ranges: [ { start: 1, end: 3, unusedRule: "color-named" }, { start: 5, end: 7, unusedRule: "block-no-empty" }, From a12d3dcc89f7a42d8a33afdf381c924cc901aeea Mon Sep 17 00:00:00 2001 From: Ivan Kopeykin Date: Mon, 16 Sep 2019 12:08:43 +0300 Subject: [PATCH 18/20] fix lint --- lib/__tests__/ignore.test.js | 2 +- lib/__tests__/invalidScopeDisables.test.js | 8 +- lib/__tests__/needlessDisables.test.js | 6 +- lib/__tests__/replaceBackslashes.js | 4 +- lib/__tests__/standalone-cache.test.js | 2 +- .../standalone-invalidScopeDisables.test.js | 6 +- lib/__tests__/standalone-maxWarnings.test.js | 2 +- .../standalone-needlessDisables.test.js | 6 +- lib/__tests__/standalone-syntax.test.js | 2 +- lib/__tests__/standalone.test.js | 6 +- .../stylelintignore.test.js | 16 ++-- system-tests/004/004.test.js | 2 +- system-tests/cli/cli.test.js | 92 +++++++++---------- system-tests/fix/fix.test.js | 10 +- system-tests/outputFile/outputFile.test.js | 9 +- system-tests/systemTestUtils.js | 10 +- 16 files changed, 88 insertions(+), 95 deletions(-) diff --git a/lib/__tests__/ignore.test.js b/lib/__tests__/ignore.test.js index b0ffdf2097..0053ce23bf 100644 --- a/lib/__tests__/ignore.test.js +++ b/lib/__tests__/ignore.test.js @@ -2,7 +2,7 @@ const NoFilesFoundError = require('../utils/noFilesFoundError'); const path = require('path'); -const replaceBackslashes = require("./replaceBackslashes"); +const replaceBackslashes = require('./replaceBackslashes'); const standalone = require('../standalone'); const fixturesPath = replaceBackslashes(path.join(__dirname, 'fixtures')); diff --git a/lib/__tests__/invalidScopeDisables.test.js b/lib/__tests__/invalidScopeDisables.test.js index 3779a3fd20..beb5cde0bc 100644 --- a/lib/__tests__/invalidScopeDisables.test.js +++ b/lib/__tests__/invalidScopeDisables.test.js @@ -2,18 +2,16 @@ const invalidScopeDisables = require('../invalidScopeDisables'); const path = require('path'); -const replaceBackslashes = require("./replaceBackslashes"); +const replaceBackslashes = require('./replaceBackslashes'); const standalone = require('../standalone'); const stripIndent = require('common-tags').stripIndent; function fixture(name) { - return replaceBackslashes( - path.join(__dirname, "./fixtures/disableOptions", name) - ); + return replaceBackslashes(path.join(__dirname, './fixtures/disableOptions', name)); } function source(name) { - return path.join(__dirname, './fixtures/disableOptions', name); + return path.join(__dirname, './fixtures/disableOptions', name); } it('invalidScopeDisables simple case', () => { diff --git a/lib/__tests__/needlessDisables.test.js b/lib/__tests__/needlessDisables.test.js index 67c37ac8ed..4d333d4163 100644 --- a/lib/__tests__/needlessDisables.test.js +++ b/lib/__tests__/needlessDisables.test.js @@ -2,7 +2,7 @@ const needlessDisables = require('../needlessDisables'); const path = require('path'); -const replaceBackslashes = require("./replaceBackslashes"); +const replaceBackslashes = require('./replaceBackslashes'); const standalone = require('../standalone'); const stripIndent = require('common-tags').stripIndent; @@ -11,9 +11,7 @@ function source(name) { } function fixture(name) { - return replaceBackslashes( - path.join(__dirname, "./fixtures/disableOptions", name) - ); + return replaceBackslashes(path.join(__dirname, './fixtures/disableOptions', name)); } it('needlessDisables simple case', () => { diff --git a/lib/__tests__/replaceBackslashes.js b/lib/__tests__/replaceBackslashes.js index 7f81d4b218..d8fc3c30e2 100644 --- a/lib/__tests__/replaceBackslashes.js +++ b/lib/__tests__/replaceBackslashes.js @@ -1,5 +1,5 @@ -"use strict"; +'use strict'; module.exports = function replaceBackslashes(str) { - return str.replace(/\\/g, "/"); + return str.replace(/\\/g, '/'); }; diff --git a/lib/__tests__/standalone-cache.test.js b/lib/__tests__/standalone-cache.test.js index 59031a4419..5bfaf49eb0 100644 --- a/lib/__tests__/standalone-cache.test.js +++ b/lib/__tests__/standalone-cache.test.js @@ -7,7 +7,7 @@ const fixturesPath = path.join(__dirname, 'fixtures'); const cpFile = require('cp-file'); const fileExists = require('file-exists-promise'); const fs = require('fs'); -const replaceBackslashes = require("./replaceBackslashes"); +const replaceBackslashes = require('./replaceBackslashes'); const { promisify } = require('util'); const unlink = promisify(fs.unlink); const fCache = require('file-entry-cache'); diff --git a/lib/__tests__/standalone-invalidScopeDisables.test.js b/lib/__tests__/standalone-invalidScopeDisables.test.js index 6ad38225ef..4742d77941 100644 --- a/lib/__tests__/standalone-invalidScopeDisables.test.js +++ b/lib/__tests__/standalone-invalidScopeDisables.test.js @@ -1,7 +1,7 @@ 'use strict'; const path = require('path'); -const replaceBackslashes = require("./replaceBackslashes"); +const replaceBackslashes = require('./replaceBackslashes'); const standalone = require('../standalone'); const fixturesPath = replaceBackslashes(path.join(__dirname, 'fixtures')); @@ -32,9 +32,7 @@ it('standalone with input css and `reportInvalidScopeDisables`', () => { it('standalone with input file(s) and `reportInvalidScopeDisables`', () => { return standalone({ - files: replaceBackslashes( - path.join(fixturesPath, 'empty-block-with-disables.css') - ), + files: replaceBackslashes(path.join(fixturesPath, 'empty-block-with-disables.css')), config, reportInvalidScopeDisables: true, }).then((linted) => { diff --git a/lib/__tests__/standalone-maxWarnings.test.js b/lib/__tests__/standalone-maxWarnings.test.js index b169c8b737..959bac6836 100644 --- a/lib/__tests__/standalone-maxWarnings.test.js +++ b/lib/__tests__/standalone-maxWarnings.test.js @@ -1,7 +1,7 @@ 'use strict'; const path = require('path'); -const replaceBackslashes = require("./replaceBackslashes"); +const replaceBackslashes = require('./replaceBackslashes'); const standalone = require('../standalone'); const fixturesPath = replaceBackslashes(path.join(__dirname, 'fixtures')); diff --git a/lib/__tests__/standalone-needlessDisables.test.js b/lib/__tests__/standalone-needlessDisables.test.js index f4a65d77fd..1d4c74bd43 100644 --- a/lib/__tests__/standalone-needlessDisables.test.js +++ b/lib/__tests__/standalone-needlessDisables.test.js @@ -1,7 +1,7 @@ 'use strict'; const path = require('path'); -const replaceBackslashes = require("./replaceBackslashes"); +const replaceBackslashes = require('./replaceBackslashes'); const standalone = require('../standalone'); const fixturesPath = replaceBackslashes(path.join(__dirname, 'fixtures')); @@ -42,9 +42,7 @@ it('standalone with input file(s) and `reportNeedlessDisables`', () => { }; return standalone({ - files: replaceBackslashes( - path.join(fixturesPath, 'empty-block-with-disables.css') - ), + files: replaceBackslashes(path.join(fixturesPath, 'empty-block-with-disables.css')), config, reportNeedlessDisables: true, }).then((linted) => { diff --git a/lib/__tests__/standalone-syntax.test.js b/lib/__tests__/standalone-syntax.test.js index d5701ca334..281f7be6b6 100644 --- a/lib/__tests__/standalone-syntax.test.js +++ b/lib/__tests__/standalone-syntax.test.js @@ -2,7 +2,7 @@ const fs = require('fs'); const path = require('path'); -const replaceBackslashes = require("./replaceBackslashes"); +const replaceBackslashes = require('./replaceBackslashes'); const standalone = require('../standalone'); const stringFormatter = require('../formatters/stringFormatter'); const stripAnsi = require('strip-ansi'); diff --git a/lib/__tests__/standalone.test.js b/lib/__tests__/standalone.test.js index bcc30d803d..c009014aa3 100644 --- a/lib/__tests__/standalone.test.js +++ b/lib/__tests__/standalone.test.js @@ -3,7 +3,7 @@ const configBlockNoEmpty = require('./fixtures/config-block-no-empty'); const NoFilesFoundError = require('../utils/noFilesFoundError'); const path = require('path'); -const replaceBackslashes = require("./replaceBackslashes"); +const replaceBackslashes = require('./replaceBackslashes'); const standalone = require('../standalone'); const fixturesPath = replaceBackslashes(path.join(__dirname, 'fixtures')); @@ -316,9 +316,7 @@ describe('standalone with config locatable from process.cwd not file', () => { beforeEach(() => { return standalone({ - files: [ - replaceBackslashes(path.join(__dirname, './fixtures/empty-block.css')) - ], + files: [replaceBackslashes(path.join(__dirname, './fixtures/empty-block.css'))], }).then((data) => (results = data.results)); }); diff --git a/lib/__tests__/stylelintignore-test/stylelintignore.test.js b/lib/__tests__/stylelintignore-test/stylelintignore.test.js index c2d95c4e67..308ea1b147 100644 --- a/lib/__tests__/stylelintignore-test/stylelintignore.test.js +++ b/lib/__tests__/stylelintignore-test/stylelintignore.test.js @@ -1,7 +1,7 @@ 'use strict'; const path = require('path'); -const replaceBackslashes = require("../replaceBackslashes"); +const replaceBackslashes = require('../replaceBackslashes'); const standalone = require('../../standalone'); describe('stylelintignore', () => { @@ -21,12 +21,14 @@ describe('stylelintignore', () => { describe('standalone with .stylelintignore file ignoring one file', () => { beforeEach(() => { return standalone({ - files: [replaceBackslashes(`${fixturesPath}/empty-block.css`), replaceBackslashes(`${fixturesPath}/invalid-hex.css`) - ], - config: { - extends: [ - `${fixturesPath}/config-block-no-empty`, - `${fixturesPath}/config-color-no-invalid-hex`, + files: [ + replaceBackslashes(`${fixturesPath}/empty-block.css`), + replaceBackslashes(`${fixturesPath}/invalid-hex.css`), + ], + config: { + extends: [ + `${fixturesPath}/config-block-no-empty`, + `${fixturesPath}/config-color-no-invalid-hex`, ], }, }).then((data) => (results = data.results)); diff --git a/system-tests/004/004.test.js b/system-tests/004/004.test.js index 33a042e50a..8c178a850e 100644 --- a/system-tests/004/004.test.js +++ b/system-tests/004/004.test.js @@ -3,7 +3,7 @@ const path = require('path'); const spawn = require('child_process').spawn; -const { replaceBackslashes } = require("../systemTestUtils"); +const { replaceBackslashes } = require('../systemTestUtils'); // this test ensures that CLI returns exit code which is not 0 // when there is a runtime error in configuration javascript file diff --git a/system-tests/cli/cli.test.js b/system-tests/cli/cli.test.js index 4b3c852e8c..9df56788a9 100644 --- a/system-tests/cli/cli.test.js +++ b/system-tests/cli/cli.test.js @@ -4,7 +4,7 @@ const cli = require('../../lib/cli'); const path = require('path'); const pkg = require('../../package.json'); -const { replaceBackslashes } = require("../systemTestUtils"); +const { replaceBackslashes } = require('../systemTestUtils'); jest.mock('get-stdin'); @@ -69,50 +69,50 @@ describe('CLI', () => { }); }); - it("--print-config", () => { - return Promise.resolve( - cli([ - "--print-config", - "--config", - path.join(__dirname, "config.json"), - replaceBackslashes(path.join(__dirname, "stylesheet.css")) - ]) - ).then(() => { - expect(process.exitCode).toBeUndefined(); - expect(process.stdout.write).toHaveBeenCalledTimes(1); - expect(process.stdout.write).toHaveBeenLastCalledWith( - JSON.stringify( - { - rules: { - "block-no-empty": [true] - } - }, - null, - " " - ) - ); - }); - }); + it('--print-config', () => { + return Promise.resolve( + cli([ + '--print-config', + '--config', + path.join(__dirname, 'config.json'), + replaceBackslashes(path.join(__dirname, 'stylesheet.css')), + ]), + ).then(() => { + expect(process.exitCode).toBeUndefined(); + expect(process.stdout.write).toHaveBeenCalledTimes(1); + expect(process.stdout.write).toHaveBeenLastCalledWith( + JSON.stringify( + { + rules: { + 'block-no-empty': [true], + }, + }, + null, + ' ', + ), + ); + }); + }); - it("--report-needless-disables", () => { - return Promise.resolve( - cli([ - "--report-needless-disables", - "--config", - path.join(__dirname, "config.json"), - replaceBackslashes(path.join(__dirname, "stylesheet.css")) - ]) - ).then(() => { - expect(process.exitCode).toBe(2); - expect(process.stdout.write).toHaveBeenCalledTimes(2); - expect(process.stdout.write).toHaveBeenNthCalledWith( - 1, - expect.stringContaining("unused rule: color-named") - ); - expect(process.stdout.write).toHaveBeenNthCalledWith( - 2, - expect.stringContaining("Unexpected empty block") - ); - }); - }); + it('--report-needless-disables', () => { + return Promise.resolve( + cli([ + '--report-needless-disables', + '--config', + path.join(__dirname, 'config.json'), + replaceBackslashes(path.join(__dirname, 'stylesheet.css')), + ]), + ).then(() => { + expect(process.exitCode).toBe(2); + expect(process.stdout.write).toHaveBeenCalledTimes(2); + expect(process.stdout.write).toHaveBeenNthCalledWith( + 1, + expect.stringContaining('unused rule: color-named'), + ); + expect(process.stdout.write).toHaveBeenNthCalledWith( + 2, + expect.stringContaining('Unexpected empty block'), + ); + }); + }); }); diff --git a/system-tests/fix/fix.test.js b/system-tests/fix/fix.test.js index 71aaeee0e8..941bfb3a22 100644 --- a/system-tests/fix/fix.test.js +++ b/system-tests/fix/fix.test.js @@ -9,7 +9,7 @@ const path = require('path'); const stylelint = require('../../lib'); const systemTestUtils = require('../systemTestUtils'); const { promisify } = require('util'); -const { replaceBackslashes } = require("../systemTestUtils"); +const { replaceBackslashes } = require('../systemTestUtils'); const readFileAsync = promisify(fs.readFile); describe('fix', () => { @@ -18,9 +18,7 @@ describe('fix', () => { beforeEach(() => { tmpDir = os.tmpdir(); - stylesheetPath = replaceBackslashes( - path.join(tmpDir, `stylesheet-${_.uniqueId()}.css`) - ); + stylesheetPath = replaceBackslashes(path.join(tmpDir, `stylesheet-${_.uniqueId()}.css`)); return cpFile(path.join(__dirname, 'stylesheet.css'), stylesheetPath); }); @@ -142,9 +140,7 @@ describe('fix with BOM', () => { beforeEach(() => { tmpDir = os.tmpdir(); - stylesheetPath = replaceBackslashes( - path.join(tmpDir, `stylesheet-with-bom.css`) - ); + stylesheetPath = replaceBackslashes(path.join(tmpDir, `stylesheet-with-bom.css`)); return cpFile(path.join(__dirname, 'stylesheet.css'), stylesheetPath); }); diff --git a/system-tests/outputFile/outputFile.test.js b/system-tests/outputFile/outputFile.test.js index c5ece4ceb1..2b5b163b51 100644 --- a/system-tests/outputFile/outputFile.test.js +++ b/system-tests/outputFile/outputFile.test.js @@ -8,7 +8,7 @@ const path = require('path'); const spawn = require('child_process').spawn; const systemTestUtils = require('../systemTestUtils'); const { promisify } = require('util'); -const { replaceBackslashes } = require("../systemTestUtils"); +const { replaceBackslashes } = require('../systemTestUtils'); const readFileAsync = promisify(fs.readFile); describe('outputFile', () => { @@ -31,7 +31,12 @@ describe('outputFile', () => { it('writes the result file ', (done) => { const childProcess = spawn( 'node', - [cliPath, replaceBackslashes(`${localPath}/*.css`), '--config=config.json', `--output-file=${directionPath}`], + [ + cliPath, + replaceBackslashes(`${localPath}/*.css`), + '--config=config.json', + `--output-file=${directionPath}`, + ], { cwd: localPath, }, diff --git a/system-tests/systemTestUtils.js b/system-tests/systemTestUtils.js index ba078d0ae2..10a7900140 100644 --- a/system-tests/systemTestUtils.js +++ b/system-tests/systemTestUtils.js @@ -33,7 +33,7 @@ function prepResults(results) { } function replaceBackslashes(str) { - return str.replace(/\\/g, "/"); + return str.replace(/\\/g, '/'); } function stripColors(input) { @@ -43,8 +43,8 @@ function stripColors(input) { module.exports = { caseFilePath, replaceBackslashes, - caseStylesheetGlob, - caseConfig, - prepResults, - stripColors, + caseStylesheetGlob, + caseConfig, + prepResults, + stripColors, }; From f38d182c57ba248306a270cf4edb7c1d467eec00 Mon Sep 17 00:00:00 2001 From: Ivan Kopeykin Date: Thu, 2 Jan 2020 11:14:08 +0300 Subject: [PATCH 19/20] update lock file with globby@10.0.1 --- package-lock.json | 320 ++++++++++++++++++++++++++-------------------- 1 file changed, 184 insertions(+), 136 deletions(-) diff --git a/package-lock.json b/package-lock.json index 625a2fb02b..95914f935b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -517,20 +517,10 @@ "@types/yargs": "^13.0.0" } }, - "@mrmlnc/readdir-enhanced": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/@mrmlnc/readdir-enhanced/-/readdir-enhanced-2.2.1.tgz", - "integrity": "sha512-bPHp6Ji8b41szTOcaP63VlnbbO5Ny6dwAATtY6JTjh5N2OLrb5Qk/Th5cRkRQhkWCt+EJsYrNB0MiL+Gpn6e3g==", - "requires": { - "call-me-maybe": "^1.0.1", - "glob-to-regexp": "^0.3.0" - } - }, "@nodelib/fs.scandir": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.3.tgz", "integrity": "sha512-eGmwYQn3gxo4r7jdQnkrrN6bY478C3P+a/y72IJukF8LjB6ZHeB3c+Ehacj3sYeSmUXGlnA67/PmbM9CVwL7Dw==", - "dev": true, "requires": { "@nodelib/fs.stat": "2.0.3", "run-parallel": "^1.1.9" @@ -539,21 +529,19 @@ "@nodelib/fs.stat": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.3.tgz", - "integrity": "sha512-bQBFruR2TAwoevBEd/NWMoAAtNGzTRgdrqnYCc7dhzfoNvqPzLyqlEQnzZ3kVnNrSp25iyxE00/3h2fqGAGArA==", - "dev": true + "integrity": "sha512-bQBFruR2TAwoevBEd/NWMoAAtNGzTRgdrqnYCc7dhzfoNvqPzLyqlEQnzZ3kVnNrSp25iyxE00/3h2fqGAGArA==" } } }, "@nodelib/fs.stat": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-1.1.3.tgz", - "integrity": "sha512-shAmDyaQC4H92APFoIaVDHCx5bStIocgvbwQyxPRrbUY20V1EYTbSDchWbuwlMG3V17cprZhA6+78JfB+3DTPw==" + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.3.tgz", + "integrity": "sha512-bQBFruR2TAwoevBEd/NWMoAAtNGzTRgdrqnYCc7dhzfoNvqPzLyqlEQnzZ3kVnNrSp25iyxE00/3h2fqGAGArA==" }, "@nodelib/fs.walk": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.4.tgz", "integrity": "sha512-1V9XOY4rDW0rehzbrcqAmHnz8e7SKvX27gh8Gt2WgB0+pdzdiLV83p72kZPU+jvMbS1qU5mauP2iOvO8rhmurQ==", - "dev": true, "requires": { "@nodelib/fs.scandir": "2.1.3", "fastq": "^1.6.0" @@ -1066,17 +1054,20 @@ "arr-diff": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", - "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=" + "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", + "dev": true }, "arr-flatten": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", - "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==" + "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", + "dev": true }, "arr-union": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", - "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=" + "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=", + "dev": true }, "array-equal": { "version": "1.0.0", @@ -1093,6 +1084,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=", + "dev": true, "requires": { "array-uniq": "^1.0.1" } @@ -1100,12 +1092,14 @@ "array-uniq": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz", - "integrity": "sha1-r2rId6Jcx/dOBYiUdThY39sk/bY=" + "integrity": "sha1-r2rId6Jcx/dOBYiUdThY39sk/bY=", + "dev": true }, "array-unique": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", - "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=" + "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", + "dev": true }, "arrify": { "version": "1.0.1", @@ -1130,7 +1124,8 @@ "assign-symbols": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", - "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=" + "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=", + "dev": true }, "astral-regex": { "version": "1.0.0", @@ -1158,7 +1153,8 @@ "atob": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", - "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==" + "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==", + "dev": true }, "autoprefixer": { "version": "9.7.3", @@ -1322,6 +1318,7 @@ "version": "0.11.2", "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", + "dev": true, "requires": { "cache-base": "^1.0.1", "class-utils": "^0.3.5", @@ -1336,6 +1333,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, "requires": { "is-descriptor": "^1.0.0" } @@ -1344,6 +1342,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, "requires": { "kind-of": "^6.0.0" } @@ -1352,6 +1351,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, "requires": { "kind-of": "^6.0.0" } @@ -1360,6 +1360,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, "requires": { "is-accessor-descriptor": "^1.0.0", "is-data-descriptor": "^1.0.0", @@ -1479,6 +1480,7 @@ "version": "2.3.2", "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", + "dev": true, "requires": { "arr-flatten": "^1.1.0", "array-unique": "^0.3.2", @@ -1496,6 +1498,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, "requires": { "is-extendable": "^0.1.0" } @@ -1560,6 +1563,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", + "dev": true, "requires": { "collection-visit": "^1.0.0", "component-emitter": "^1.2.1", @@ -1607,11 +1611,6 @@ } } }, - "call-me-maybe": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/call-me-maybe/-/call-me-maybe-1.0.1.tgz", - "integrity": "sha1-JtII6onje1y95gJQoV8DHBak1ms=" - }, "caller-callsite": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/caller-callsite/-/caller-callsite-2.0.0.tgz", @@ -1840,6 +1839,7 @@ "version": "0.3.6", "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", + "dev": true, "requires": { "arr-union": "^3.1.0", "define-property": "^0.2.5", @@ -1851,6 +1851,7 @@ "version": "0.2.5", "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, "requires": { "is-descriptor": "^0.1.0" } @@ -1983,6 +1984,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=", + "dev": true, "requires": { "map-visit": "^1.0.0", "object-visit": "^1.0.0" @@ -2025,7 +2027,8 @@ "component-emitter": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", - "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==" + "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==", + "dev": true }, "concat-map": { "version": "0.0.1", @@ -2104,7 +2107,8 @@ "copy-descriptor": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", - "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=" + "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=", + "dev": true }, "core-util-is": { "version": "1.0.2", @@ -2263,7 +2267,8 @@ "decode-uri-component": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", - "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=" + "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=", + "dev": true }, "decompress-response": { "version": "5.0.0", @@ -2311,6 +2316,7 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", + "dev": true, "requires": { "is-descriptor": "^1.0.2", "isobject": "^3.0.1" @@ -2320,6 +2326,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, "requires": { "kind-of": "^6.0.0" } @@ -2328,6 +2335,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, "requires": { "kind-of": "^6.0.0" } @@ -2336,6 +2344,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, "requires": { "is-accessor-descriptor": "^1.0.0", "is-data-descriptor": "^1.0.0", @@ -2455,11 +2464,18 @@ "dev": true }, "dir-glob": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-2.2.2.tgz", - "integrity": "sha512-f9LBi5QWzIW3I6e//uxZoLBlUt9kcp66qo0sSCxL6YZKc75R1c4MFCoe/LaZiBGmgujvQdxc5Bn3QhfyvK5Hsw==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", "requires": { - "path-type": "^3.0.0" + "path-type": "^4.0.0" + }, + "dependencies": { + "path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==" + } } }, "doctrine": { @@ -2925,6 +2941,7 @@ "version": "2.1.4", "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", + "dev": true, "requires": { "debug": "^2.3.3", "define-property": "^0.2.5", @@ -2939,6 +2956,7 @@ "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, "requires": { "ms": "2.0.0" } @@ -2947,6 +2965,7 @@ "version": "0.2.5", "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, "requires": { "is-descriptor": "^0.1.0" } @@ -2955,6 +2974,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, "requires": { "is-extendable": "^0.1.0" } @@ -2962,7 +2982,8 @@ "ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true } } }, @@ -2989,6 +3010,7 @@ "version": "3.0.2", "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", + "dev": true, "requires": { "assign-symbols": "^1.0.0", "is-extendable": "^1.0.1" @@ -2998,6 +3020,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "dev": true, "requires": { "is-plain-object": "^2.0.4" } @@ -3019,6 +3042,7 @@ "version": "2.0.4", "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", + "dev": true, "requires": { "array-unique": "^0.3.2", "define-property": "^1.0.0", @@ -3034,6 +3058,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, "requires": { "is-descriptor": "^1.0.0" } @@ -3042,6 +3067,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, "requires": { "is-extendable": "^0.1.0" } @@ -3050,6 +3076,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, "requires": { "kind-of": "^6.0.0" } @@ -3058,6 +3085,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, "requires": { "kind-of": "^6.0.0" } @@ -3066,6 +3094,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, "requires": { "is-accessor-descriptor": "^1.0.0", "is-data-descriptor": "^1.0.0", @@ -3086,38 +3115,15 @@ "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=" }, "fast-glob": { - "version": "2.2.7", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-2.2.7.tgz", - "integrity": "sha512-g1KuQwHOZAmOZMuBtHdxDtju+T2RT8jgCC9aANsbpdiDDTSnjgfuVsIBNKbUeJI3oKMRExcfNDtJl4OhbffMsw==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.1.1.tgz", + "integrity": "sha512-nTCREpBY8w8r+boyFYAx21iL6faSsQynliPHM4Uf56SbkyohCNxpVPEH9xrF5TXKy+IsjkPUHDKiUkzBVRXn9g==", "requires": { - "@mrmlnc/readdir-enhanced": "^2.2.1", - "@nodelib/fs.stat": "^1.1.2", - "glob-parent": "^3.1.0", - "is-glob": "^4.0.0", - "merge2": "^1.2.3", - "micromatch": "^3.1.10" - }, - "dependencies": { - "micromatch": { - "version": "3.1.10", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", - "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", - "requires": { - "arr-diff": "^4.0.0", - "array-unique": "^0.3.2", - "braces": "^2.3.1", - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "extglob": "^2.0.4", - "fragment-cache": "^0.2.1", - "kind-of": "^6.0.2", - "nanomatch": "^1.2.9", - "object.pick": "^1.3.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.2" - } - } + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.0", + "merge2": "^1.3.0", + "micromatch": "^4.0.2" } }, "fast-json-stable-stringify": { @@ -3135,7 +3141,6 @@ "version": "1.6.0", "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.6.0.tgz", "integrity": "sha512-jmxqQ3Z/nXoeyDmWAzF9kH1aGZSis6e/SbfPmJpUnyZ0ogr6iscHQaml4wsEepEWSdtmpy+eVXmCRIMpxaXqOA==", - "dev": true, "requires": { "reusify": "^1.0.0" } @@ -3179,6 +3184,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", + "dev": true, "requires": { "extend-shallow": "^2.0.1", "is-number": "^3.0.0", @@ -3190,6 +3196,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, "requires": { "is-extendable": "^0.1.0" } @@ -3228,7 +3235,8 @@ "for-in": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", - "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=" + "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", + "dev": true }, "forever-agent": { "version": "0.6.1", @@ -3257,6 +3265,7 @@ "version": "0.2.1", "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", + "dev": true, "requires": { "map-cache": "^0.2.2" } @@ -3849,7 +3858,8 @@ "get-value": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", - "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=" + "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=", + "dev": true }, "getpass": { "version": "0.1.7", @@ -3897,29 +3907,13 @@ } }, "glob-parent": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", - "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.0.tgz", + "integrity": "sha512-qjtRgnIVmOfnKUE3NJAQEdk+lKrxfw8t5ke7SXtfMTHcjsBfOfWXCQfdb30zfDoZQ2IRSIiidmjtbHZPZ++Ihw==", "requires": { - "is-glob": "^3.1.0", - "path-dirname": "^1.0.0" - }, - "dependencies": { - "is-glob": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", - "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", - "requires": { - "is-extglob": "^2.1.0" - } - } + "is-glob": "^4.0.1" } }, - "glob-to-regexp": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.3.0.tgz", - "integrity": "sha1-jFoUlNIGbFcMw7/kSWF1rMTVAqs=" - }, "global-dirs": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-2.0.1.tgz", @@ -3953,29 +3947,24 @@ "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==" }, "globby": { - "version": "9.2.0", - "resolved": "https://registry.npmjs.org/globby/-/globby-9.2.0.tgz", - "integrity": "sha512-ollPHROa5mcxDEkwg6bPt3QbEf4pDQSNtd6JPL1YvOvAo/7/0VAm9TccUeoTmarjPw4pfUthSCqcyfNB1I3ZSg==", + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/globby/-/globby-10.0.1.tgz", + "integrity": "sha512-sSs4inE1FB2YQiymcmTv6NWENryABjUNPeWhOvmn4SjtKybglsyPZxFB3U1/+L1bYi0rNZDqCLlHyLYDl1Pq5A==", "requires": { "@types/glob": "^7.1.1", - "array-union": "^1.0.2", - "dir-glob": "^2.2.2", - "fast-glob": "^2.2.6", + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.0.3", "glob": "^7.1.3", - "ignore": "^4.0.3", - "pify": "^4.0.1", - "slash": "^2.0.0" + "ignore": "^5.1.1", + "merge2": "^1.2.3", + "slash": "^3.0.0" }, "dependencies": { - "ignore": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", - "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==" - }, - "slash": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-2.0.0.tgz", - "integrity": "sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==" + "array-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==" } } }, @@ -4112,6 +4101,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=", + "dev": true, "requires": { "get-value": "^2.0.6", "has-values": "^1.0.0", @@ -4122,6 +4112,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz", "integrity": "sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=", + "dev": true, "requires": { "is-number": "^3.0.0", "kind-of": "^4.0.0" @@ -4131,6 +4122,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", + "dev": true, "requires": { "is-buffer": "^1.1.5" } @@ -4650,6 +4642,7 @@ "version": "0.1.6", "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "dev": true, "requires": { "kind-of": "^3.0.2" }, @@ -4658,6 +4651,7 @@ "version": "3.2.2", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, "requires": { "is-buffer": "^1.1.5" } @@ -4700,7 +4694,8 @@ "is-buffer": { "version": "1.1.6", "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", - "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==" + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true }, "is-callable": { "version": "1.1.4", @@ -4721,6 +4716,7 @@ "version": "0.1.4", "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "dev": true, "requires": { "kind-of": "^3.0.2" }, @@ -4729,6 +4725,7 @@ "version": "3.2.2", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, "requires": { "is-buffer": "^1.1.5" } @@ -4750,6 +4747,7 @@ "version": "0.1.6", "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "dev": true, "requires": { "is-accessor-descriptor": "^0.1.6", "is-data-descriptor": "^0.1.4", @@ -4759,7 +4757,8 @@ "kind-of": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", - "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==" + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "dev": true } } }, @@ -4778,7 +4777,8 @@ "is-extendable": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", - "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=" + "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", + "dev": true }, "is-extglob": { "version": "2.1.1", @@ -4835,6 +4835,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "dev": true, "requires": { "kind-of": "^3.0.2" }, @@ -4843,6 +4844,7 @@ "version": "3.2.2", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, "requires": { "is-buffer": "^1.1.5" } @@ -4910,6 +4912,7 @@ "version": "2.0.4", "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "dev": true, "requires": { "isobject": "^3.0.1" } @@ -4980,7 +4983,8 @@ "is-windows": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", - "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==" + "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", + "dev": true }, "is-word-character": { "version": "1.0.3", @@ -5002,7 +5006,8 @@ "isarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true }, "isexe": { "version": "2.0.0", @@ -5012,7 +5017,8 @@ "isobject": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=" + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true }, "isstream": { "version": "0.1.2", @@ -6921,7 +6927,8 @@ "map-cache": { "version": "0.2.2", "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", - "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=" + "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=", + "dev": true }, "map-obj": { "version": "2.0.0", @@ -6932,6 +6939,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", + "dev": true, "requires": { "object-visit": "^1.0.0" } @@ -7128,6 +7136,7 @@ "version": "1.3.2", "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz", "integrity": "sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA==", + "dev": true, "requires": { "for-in": "^1.0.2", "is-extendable": "^1.0.1" @@ -7137,6 +7146,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "dev": true, "requires": { "is-plain-object": "^2.0.4" } @@ -7173,6 +7183,7 @@ "version": "1.2.13", "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", "integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==", + "dev": true, "requires": { "arr-diff": "^4.0.0", "array-unique": "^0.3.2", @@ -7844,6 +7855,7 @@ "version": "0.1.0", "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", + "dev": true, "requires": { "copy-descriptor": "^0.1.0", "define-property": "^0.2.5", @@ -7854,6 +7866,7 @@ "version": "0.2.5", "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, "requires": { "is-descriptor": "^0.1.0" } @@ -7862,6 +7875,7 @@ "version": "3.2.2", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, "requires": { "is-buffer": "^1.1.5" } @@ -7884,6 +7898,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", + "dev": true, "requires": { "isobject": "^3.0.0" } @@ -7902,6 +7917,7 @@ "version": "1.3.0", "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", + "dev": true, "requires": { "isobject": "^3.0.1" } @@ -8254,12 +8270,8 @@ "pascalcase": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", - "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=" - }, - "path-dirname": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/path-dirname/-/path-dirname-1.0.2.tgz", - "integrity": "sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA=" + "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=", + "dev": true }, "path-exists": { "version": "3.0.0", @@ -8323,7 +8335,8 @@ "pify": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", - "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==" + "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", + "dev": true }, "pinkie": { "version": "2.0.4", @@ -8442,7 +8455,8 @@ "posix-character-classes": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", - "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=" + "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=", + "dev": true }, "postcss": { "version": "7.0.26", @@ -8870,6 +8884,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", + "dev": true, "requires": { "extend-shallow": "^3.0.2", "safe-regex": "^1.1.0" @@ -9524,7 +9539,8 @@ "repeat-element": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.3.tgz", - "integrity": "sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g==" + "integrity": "sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g==", + "dev": true }, "repeat-string": { "version": "1.6.1", @@ -9623,7 +9639,8 @@ "resolve-url": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", - "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=" + "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", + "dev": true }, "responselike": { "version": "2.0.0", @@ -9647,13 +9664,13 @@ "ret": { "version": "0.1.15", "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", - "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==" + "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", + "dev": true }, "reusify": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", - "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", - "dev": true + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==" }, "rimraf": { "version": "2.6.3", @@ -9687,8 +9704,7 @@ "run-parallel": { "version": "1.1.9", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.1.9.tgz", - "integrity": "sha512-DEqnSRTDw/Tc3FXf49zedI638Z9onwUotBMiUFKmrO2sdFKIbXamXGQ3Axd4qgphxKB4kw/qP1w5kTxnfU1B9Q==", - "dev": true + "integrity": "sha512-DEqnSRTDw/Tc3FXf49zedI638Z9onwUotBMiUFKmrO2sdFKIbXamXGQ3Axd4qgphxKB4kw/qP1w5kTxnfU1B9Q==" }, "rxjs": { "version": "6.5.3", @@ -9708,6 +9724,7 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", + "dev": true, "requires": { "ret": "~0.1.10" } @@ -9814,6 +9831,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz", "integrity": "sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==", + "dev": true, "requires": { "extend-shallow": "^2.0.1", "is-extendable": "^0.1.1", @@ -9825,6 +9843,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, "requires": { "is-extendable": "^0.1.0" } @@ -9907,6 +9926,7 @@ "version": "0.8.2", "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", + "dev": true, "requires": { "base": "^0.11.1", "debug": "^2.2.0", @@ -9922,6 +9942,7 @@ "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, "requires": { "ms": "2.0.0" } @@ -9930,6 +9951,7 @@ "version": "0.2.5", "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, "requires": { "is-descriptor": "^0.1.0" } @@ -9938,6 +9960,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, "requires": { "is-extendable": "^0.1.0" } @@ -9945,12 +9968,14 @@ "ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true }, "source-map": { "version": "0.5.7", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=" + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true } } }, @@ -9958,6 +9983,7 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz", "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", + "dev": true, "requires": { "define-property": "^1.0.0", "isobject": "^3.0.0", @@ -9968,6 +9994,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, "requires": { "is-descriptor": "^1.0.0" } @@ -9976,6 +10003,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, "requires": { "kind-of": "^6.0.0" } @@ -9984,6 +10012,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, "requires": { "kind-of": "^6.0.0" } @@ -9992,6 +10021,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, "requires": { "is-accessor-descriptor": "^1.0.0", "is-data-descriptor": "^1.0.0", @@ -10004,6 +10034,7 @@ "version": "3.0.1", "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz", "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", + "dev": true, "requires": { "kind-of": "^3.2.0" }, @@ -10012,6 +10043,7 @@ "version": "3.2.2", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, "requires": { "is-buffer": "^1.1.5" } @@ -10027,6 +10059,7 @@ "version": "0.5.2", "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.2.tgz", "integrity": "sha512-MjqsvNwyz1s0k81Goz/9vRBe9SZdB09Bdw+/zYyO+3CuPk6fouTaxscHkgtE8jKvf01kVfl8riHzERQ/kefaSA==", + "dev": true, "requires": { "atob": "^2.1.1", "decode-uri-component": "^0.2.0", @@ -10048,7 +10081,8 @@ "source-map-url": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.0.tgz", - "integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=" + "integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=", + "dev": true }, "spdx-correct": { "version": "3.1.0", @@ -10096,6 +10130,7 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", + "dev": true, "requires": { "extend-shallow": "^3.0.0" } @@ -10138,6 +10173,7 @@ "version": "0.1.2", "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=", + "dev": true, "requires": { "define-property": "^0.2.5", "object-copy": "^0.1.0" @@ -10147,6 +10183,7 @@ "version": "0.2.5", "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, "requires": { "is-descriptor": "^0.1.0" } @@ -10623,6 +10660,7 @@ "version": "0.3.0", "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=", + "dev": true, "requires": { "kind-of": "^3.0.2" }, @@ -10631,6 +10669,7 @@ "version": "3.2.2", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, "requires": { "is-buffer": "^1.1.5" } @@ -10647,6 +10686,7 @@ "version": "3.0.2", "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz", "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==", + "dev": true, "requires": { "define-property": "^2.0.2", "extend-shallow": "^3.0.2", @@ -10658,6 +10698,7 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", + "dev": true, "requires": { "is-number": "^3.0.0", "repeat-string": "^1.6.1" @@ -10955,6 +10996,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz", "integrity": "sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg==", + "dev": true, "requires": { "arr-union": "^3.1.0", "get-value": "^2.0.6", @@ -11043,6 +11085,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", + "dev": true, "requires": { "has-value": "^0.3.1", "isobject": "^3.0.0" @@ -11052,6 +11095,7 @@ "version": "0.3.1", "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz", "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=", + "dev": true, "requires": { "get-value": "^2.0.3", "has-values": "^0.1.4", @@ -11062,6 +11106,7 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", + "dev": true, "requires": { "isarray": "1.0.0" } @@ -11071,7 +11116,8 @@ "has-values": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz", - "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=" + "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=", + "dev": true } } }, @@ -11162,7 +11208,8 @@ "urix": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", - "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=" + "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=", + "dev": true }, "url-parse-lax": { "version": "3.0.0", @@ -11186,7 +11233,8 @@ "use": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", - "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==" + "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==", + "dev": true }, "util-deprecate": { "version": "1.0.2", From fbe29ce388f66cb77a7862305e247c19a587a379 Mon Sep 17 00:00:00 2001 From: Ivan Kopeykin Date: Thu, 2 Jan 2020 11:25:42 +0300 Subject: [PATCH 20/20] fix test --- lib/__tests__/standalone-parseErrors.test.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/__tests__/standalone-parseErrors.test.js b/lib/__tests__/standalone-parseErrors.test.js index c2f1e92775..58313300dc 100644 --- a/lib/__tests__/standalone-parseErrors.test.js +++ b/lib/__tests__/standalone-parseErrors.test.js @@ -3,6 +3,7 @@ const blockNoEmpty = require('../rules/block-no-empty'); const configBlockNoEmpty = require('./fixtures/config-block-no-empty'); const path = require('path'); +const replaceBackslashes = require('./replaceBackslashes'); const standalone = require('../standalone'); jest.mock('../rules/block-no-empty'); @@ -29,7 +30,7 @@ test('standalone with deprecations', async () => { test('file with correct syntax reported correctly', async () => { const data = await standalone({ - files: path.join(__dirname, 'fixtures/broken-syntax/correct-syntax.css'), + files: replaceBackslashes(path.join(__dirname, 'fixtures/broken-syntax/correct-syntax.css')), }); expect(data.results[0]).toMatchObject({ @@ -41,7 +42,7 @@ test('file with correct syntax reported correctly', async () => { test('file with invalid syntax reported correctly', async () => { const data = await standalone({ - files: [path.join(__dirname, 'fixtures/broken-syntax/broken-syntax.css')], + files: [replaceBackslashes(path.join(__dirname, 'fixtures/broken-syntax/broken-syntax.css'))], }); expect(data.results[0]).toMatchObject({