Browse Source

Set up ESLint

pull/1/head
Sven Slootweg 1 year ago
parent
commit
d2710cc987
  1. 3
      .eslintrc
  2. 2
      package.json
  3. 2
      src/css-only-stream.js
  4. 2
      src/phase-streams/dedupe-bundle-css.js
  5. 2
      src/phase-streams/sort-kahn.js
  6. 2
      src/postcss/postcss-icss-find-imports.js
  7. 2
      src/postcss/postcss-icss-parser.js
  8. 2
      src/unhide-css.js

3
.eslintrc

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

2
package.json

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

2
src/css-only-stream.js

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

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

2
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");

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

2
src/postcss/postcss-icss-parser.js

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

2
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");
}
}
};
Loading…
Cancel
Save