Skip to content

Commit 0641725

Browse files
committed
Initial commit
0 parents  commit 0641725

File tree

6 files changed

+1946
-0
lines changed

6 files changed

+1946
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules

.prettierrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# eslint-config-async
2+
3+
A shareable ESLint config for writing better asynchronous code.
4+
5+
## Installation & usage
6+
Install this package and its peer dependencies:
7+
8+
```shell
9+
npm install --save-dev eslint eslint-config-async eslint-plugin-node
10+
```
11+
12+
In your `.eslintrc` configuration file:
13+
14+
```js
15+
module.exports = {
16+
plugins: [
17+
'eslint-plugin-node',
18+
],
19+
extends: [
20+
'eslint-config-async'
21+
],
22+
};
23+
```

index.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
module.exports = {
2+
rules: {
3+
// Base rules
4+
"no-async-promise-executor": "error",
5+
"no-await-in-loop": "error",
6+
"no-promise-executor-return": "error",
7+
"require-atomic-updates": "error",
8+
"max-nested-callbacks": ["error", 3],
9+
"no-return-await": "error",
10+
"prefer-promise-reject-errors": "error",
11+
12+
// Node.js rules
13+
"node/handle-callback-err": ["error", "^(e|err|error)$"],
14+
"node/no-callback-literal": "error",
15+
"node/no-sync": "error",
16+
},
17+
};

0 commit comments

Comments
 (0)