Skip to content

Commit 6792a1f

Browse files
committed
Updated eslint rules according to other projects, integrated void operator
1 parent 5929bbd commit 6792a1f

File tree

5 files changed

+210
-26
lines changed

5 files changed

+210
-26
lines changed

.eslintrc

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"import"
1919
],
2020
"parserOptions": {
21+
"project": "tsconfig.json",
2122
"sourceType": "module",
2223
"ecmaVersion": 2021
2324
},
@@ -31,6 +32,18 @@
3132
"no-useless-escape": 0,
3233
"no-console": "error",
3334
"eqeqeq": ["error", "smart"],
35+
"spaced-comment": [
36+
"warn",
37+
"always",
38+
{
39+
"line": {
40+
"exceptions": ["-"]
41+
},
42+
"block": {
43+
"exceptions": ["*"]
44+
}
45+
}
46+
],
3447
"capitalized-comments": [
3548
"warn",
3649
"always",
@@ -79,7 +92,22 @@
7992
],
8093
"@typescript-eslint/no-inferrable-types": 0,
8194
"@typescript-eslint/no-non-null-assertion": 0,
95+
"@typescript-eslint/no-this-alias": 0,
8296
"@typescript-eslint/no-var-requires": 0,
97+
"@typescript-eslint/no-empty-function": 0,
98+
"@typescript-eslint/no-empty-interface": 0,
99+
"@typescript-eslint/consistent-type-imports": ["error"],
100+
"@typescript-eslint/consistent-type-exports": ["error"],
101+
"no-throw-literal": "off",
102+
"@typescript-eslint/no-throw-literal": ["error"],
103+
"@typescript-eslint/no-floating-promises": ["error", {
104+
"ignoreVoid": true,
105+
"ignoreIIFE": true
106+
}],
107+
"@typescript-eslint/no-misused-promises": ["error", {
108+
"checksVoidReturn": false
109+
}],
110+
"@typescript-eslint/await-thenable": ["error"],
83111
"@typescript-eslint/naming-convention": [
84112
"error",
85113
{
@@ -90,13 +118,14 @@
90118
},
91119
{
92120
"selector": "variable",
93-
"format": ["camelCase", "UPPER_CASE"],
121+
"format": ["camelCase", "UPPER_CASE", "PascalCase"],
94122
"leadingUnderscore": "allow",
95123
"trailingUnderscore": "allowSingleOrDouble"
96124
},
97125
{
98126
"selector": "parameter",
99127
"format": ["camelCase"],
128+
"leadingUnderscore": "allow",
100129
"trailingUnderscore": "allowSingleOrDouble"
101130
},
102131
{

package-lock.json

Lines changed: 174 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,19 +43,19 @@
4343
"devDependencies": {
4444
"@types/jest": "^27.0.2",
4545
"@types/node": "^16.11.7",
46-
"@typescript-eslint/eslint-plugin": "^5.0.0",
47-
"@typescript-eslint/parser": "^5.0.0",
46+
"@typescript-eslint/eslint-plugin": "^5.4.0",
47+
"@typescript-eslint/parser": "^5.4.0",
4848
"eslint": "^7.17.0",
4949
"eslint-config-prettier": "^7.1.0",
50-
"eslint-plugin-import": "^2.25.2",
50+
"eslint-plugin-import": "^2.25.3",
5151
"eslint-plugin-prettier": "^3.3.1",
5252
"jest": "^27.2.5",
5353
"jest-mock-process": "^1.4.0",
5454
"node-gyp-build": "4.4.0",
5555
"pkg": "5.6.0",
5656
"prettier": "^2.2.1",
5757
"ts-jest": "^27.0.5",
58-
"ts-node": "^9.1.1",
58+
"ts-node": "^10.4.0",
5959
"tsconfig-paths": "^3.9.0",
6060
"typedoc": "^0.22.15",
6161
"typescript": "^4.5.2",

src/bin/typescript-demo-lib.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ async function main(argv = process.argv): Promise<number> {
4747
}
4848

4949
if (require.main === module) {
50-
main();
50+
void main();
5151
}
5252

5353
export default main;

src/lib/workers/test-workers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ async function testWorkers() {
77
const coreCount = os.cpus().length;
88
const pool = Pool(() => spawn(new Worker('./worker')), coreCount);
99
for (let i = 0; i < coreCount; i++) {
10-
pool.queue(async (hellower) => {
10+
void pool.queue(async (hellower) => {
1111
process.stdout.write((await hellower.helloWorld()) + '\n');
1212
});
1313
}

0 commit comments

Comments
 (0)