-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.js
42 lines (39 loc) · 999 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
const nodePlugin = require("eslint-plugin-n");
module.exports = {
// Base rules
base: [
{
rules: {
"no-async-promise-executor": "error",
"no-await-in-loop": "error",
"no-promise-executor-return": "error",
"require-atomic-updates": "error",
"max-nested-callbacks": ["error", 3],
"no-return-await": "error",
"prefer-promise-reject-errors": "error",
},
},
],
// Node.js rules
node: [
{
plugins: { n: nodePlugin },
rules: {
"n/handle-callback-err": ["error", "^(e|err|error)$"],
"n/no-callback-literal": "error",
"n/no-sync": "error",
},
},
],
// TypeScript rules
typescript: [
{
rules: {
"@typescript-eslint/await-thenable": "error",
"@typescript-eslint/no-floating-promises": "error",
"@typescript-eslint/no-misused-promises": "error",
"@typescript-eslint/promise-function-async": "error",
},
},
],
};