Skip to content

Commit

Permalink
Correct eslint and lint-staged config
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinfarrugia committed Jun 21, 2021
1 parent 9581cfa commit 1de29e5
Show file tree
Hide file tree
Showing 5 changed files with 343 additions and 93 deletions.
15 changes: 7 additions & 8 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
{
"extends": ["airbnb", "prettier"],
"extends": ["eslint:recommended", "prettier"],
"env": {
"browser": false,
"node": true
"node": true,
"es6": true
},
"globals": {
"document": false,
"window": false,
"module": true
"parserOptions": {
"ecmaVersion": 2018
},
"plugins": ["prettier"],
"plugins": ["import", "prettier"],
"rules": {
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-extraneous-dependencies.md
"import/no-extraneous-dependencies": ["error", { "packageDir": "." }],
// https://eslint.org/docs/rules/no-console
"no-console": [
Expand Down
5 changes: 4 additions & 1 deletion lib/coa.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ module.exports = function makeProgram(program) {

async function action(args, opts, command) {
var input = opts.input || args;
var output = opts.output;
var { output } = opts;
var config = {};

if (opts.in === null) {
Expand Down Expand Up @@ -169,6 +169,7 @@ async function action(args, opts, command) {
*/
async function parseFolder(config, dir, output) {
if (!config.quiet) {
// eslint-disable-next-line no-console
console.log(`Processing directory '${dir}':\n`);
}
const files = await FS.promises.readdir(dir);
Expand Down Expand Up @@ -286,6 +287,7 @@ function processHARData(config, info, data, output, input) {
function () {
if (!config.quiet && output != "-") {
if (input) {
// eslint-disable-next-line no-console
console.log(`${PATH.basename(input)}:`);
}
printTimeInfo(processingTime);
Expand Down Expand Up @@ -333,6 +335,7 @@ async function writeOutput(input, output, data) {
* @param {number} time time in milliseconds.
*/
function printTimeInfo(time) {
// eslint-disable-next-line no-console
console.log(`Done in ${time} ms!\n`);
}

Expand Down
2 changes: 1 addition & 1 deletion lib/hara.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const parseLargest = (data) => {
return {
url: normalizeUrl(item.request.url),
bytes: item.response.content.size,
};
};
};

const parseLargestCompressed = (data) => {
Expand Down
Loading

0 comments on commit 1de29e5

Please sign in to comment.