Set up ESLint

pull/1/head
Sven Slootweg 5 years ago
parent 3840a1f8d3
commit d2710cc987

@ -0,0 +1,3 @@
{
"extends": "@joepie91/eslint-config"
}

@ -39,6 +39,6 @@
},
"devDependencies": {
"@joepie91/eslint-config": "^1.1.0",
"eslint": "^5.9.0"
"eslint": "^6.8.0"
}
}

@ -13,5 +13,5 @@ module.exports = function (state) {
return [ item ];
}
}, flushHandler);
}
};
};

@ -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.

@ -1,7 +1,5 @@
"use strict";
const through2 = require("through2");
const sortDependencies = require("../sort-dependencies");
const stream = require("../stream");

@ -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));

@ -61,5 +61,5 @@ module.exports = postcss.plugin(pluginName, (options = {}) => {
item: { name, value: parsedValue }
});
}
}
};
});

@ -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");
}
}
};

Loading…
Cancel
Save