Skip to content

Commit c551d72

Browse files
committed
Add basic linting
1 parent 427d014 commit c551d72

File tree

7 files changed

+1230
-15
lines changed

7 files changed

+1230
-15
lines changed

.eslintrc.cjs

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
"use strict";
2+
3+
module.exports = {
4+
5+
parserOptions: {
6+
sourceType: "module",
7+
ecmaVersion: "latest",
8+
},
9+
10+
env: {
11+
"es2022": true,
12+
"node": true,
13+
},
14+
15+
extends: [
16+
"eslint:recommended",
17+
],
18+
19+
rules: {
20+
"comma-style": ["error", "last"],
21+
"eol-last": ["error", "always"],
22+
"indent": ["error", 2, {"MemberExpression": "off", "SwitchCase": 1}],
23+
"semi": ["error", "always"],
24+
},
25+
26+
};

index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import { join as joinPaths } from 'path';
1414
*
1515
* @returns {Promise<{size: number | bigint, errors: Array<Error> | null}>} - An object containing the size of the folder in bytes and a list of encountered errors.
1616
*/
17-
export default async function getFolderSize (itemPath, options) { return await core(itemPath, options, {errors: true}) }
17+
export default async function getFolderSize (itemPath, options) { return await core(itemPath, options, {errors: true}); }
1818

1919
/**
2020
* Returns the size of the folder. If any errors are encountered while traversing the folder, they are silently ignored.
@@ -92,9 +92,9 @@ async function core (rootItemPath, options = {}, returnType = {}) {
9292
return {
9393
size: folderSize,
9494
errors: errors.length > 0 ? errors : null,
95-
}
95+
};
9696
} else {
9797
return folderSize;
9898
}
9999

100-
}
100+
}

0 commit comments

Comments
 (0)