From d2710cc987e761fdd4258c1478bcd116c31e8c70 Mon Sep 17 00:00:00 2001 From: Sven Slootweg Date: Fri, 6 Mar 2020 02:11:53 +0100 Subject: [PATCH] Set up ESLint --- .eslintrc | 3 +++ package.json | 2 +- src/css-only-stream.js | 2 +- src/phase-streams/dedupe-bundle-css.js | 2 +- src/phase-streams/sort-kahn.js | 2 -- src/postcss/postcss-icss-find-imports.js | 2 +- src/postcss/postcss-icss-parser.js | 2 +- src/unhide-css.js | 2 +- 8 files changed, 9 insertions(+), 8 deletions(-) create mode 100644 .eslintrc diff --git a/.eslintrc b/.eslintrc new file mode 100644 index 0000000..b0108ff --- /dev/null +++ b/.eslintrc @@ -0,0 +1,3 @@ +{ + "extends": "@joepie91/eslint-config" +} diff --git a/package.json b/package.json index b6d354c..19da274 100644 --- a/package.json +++ b/package.json @@ -39,6 +39,6 @@ }, "devDependencies": { "@joepie91/eslint-config": "^1.1.0", - "eslint": "^5.9.0" + "eslint": "^6.8.0" } } diff --git a/src/css-only-stream.js b/src/css-only-stream.js index a113019..39b0d23 100644 --- a/src/css-only-stream.js +++ b/src/css-only-stream.js @@ -13,5 +13,5 @@ module.exports = function (state) { return [ item ]; } }, flushHandler); - } + }; }; diff --git a/src/phase-streams/dedupe-bundle-css.js b/src/phase-streams/dedupe-bundle-css.js index 070d594..179e47d 100644 --- a/src/phase-streams/dedupe-bundle-css.js +++ b/src/phase-streams/dedupe-bundle-css.js @@ -22,7 +22,7 @@ module.exports = function (state) { // Get the (absolute!) path of the folder containing the initial entry file, as a reference point for relative paths in the output ? path.dirname(path.resolve(options._flags.entries[0])) // ... or, if no entry file is specified, go off the current working directory - : process.cwd() + : process.cwd(); return stream((item) => { // And the same for the loader shim path. All this relative-path stuff is to prevent absolute filesystem URLs from leaking into the output, as those might contain sensitive information. diff --git a/src/phase-streams/sort-kahn.js b/src/phase-streams/sort-kahn.js index 2d24d29..7a648fd 100644 --- a/src/phase-streams/sort-kahn.js +++ b/src/phase-streams/sort-kahn.js @@ -1,7 +1,5 @@ "use strict"; -const through2 = require("through2"); - const sortDependencies = require("../sort-dependencies"); const stream = require("../stream"); diff --git a/src/postcss/postcss-icss-find-imports.js b/src/postcss/postcss-icss-find-imports.js index 8b52110..0cb85c2 100644 --- a/src/postcss/postcss-icss-find-imports.js +++ b/src/postcss/postcss-icss-find-imports.js @@ -21,7 +21,7 @@ module.exports = postcss.plugin(pluginName, (_options = {}) => { return function process(css, result) { let discoveredImports = new Set(); - let { icssImports, icssExports } = icssUtils.extractICSS(css, false); + let { icssImports } = icssUtils.extractICSS(css, false); for (let importUrl of Object.keys(icssImports)) { discoveredImports.add(loaderUtils.parseString(importUrl)); diff --git a/src/postcss/postcss-icss-parser.js b/src/postcss/postcss-icss-parser.js index 781f3a3..45c6aa4 100644 --- a/src/postcss/postcss-icss-parser.js +++ b/src/postcss/postcss-icss-parser.js @@ -61,5 +61,5 @@ module.exports = postcss.plugin(pluginName, (options = {}) => { item: { name, value: parsedValue } }); } - } + }; }); diff --git a/src/unhide-css.js b/src/unhide-css.js index ff07696..aec08df 100644 --- a/src/unhide-css.js +++ b/src/unhide-css.js @@ -11,4 +11,4 @@ module.exports = function unhideCss(css) { // This was apparently not (hidden) CSS, but it should have been throw new Error("Expected hidden CSS, but did not find it"); } -} +};