@@ -88,20 +88,20 @@ or start with the recommended rule set
88
88
89
89
## Rules
90
90
91
- | recommended | rule | description |
92
- | ----------- | --------------------------- | -------------------------------------------------------------------------------- |
93
- | : bangbang : | ` catch-or-return ` | Enforces the use of ` catch() ` on un-returned promises. |
94
- | : bangbang : | ` no-return-wrap ` | Avoid wrapping values in ` Promise.resolve ` or ` Promise.reject ` when not needed. |
95
- | : bangbang : | ` param-names ` | Enforce consistent param names when creating new promises. |
96
- | : bangbang : | ` always-return ` | Return inside each ` then() ` to create readable and reusable Promise chains. |
97
- | | ` no-native ` | In an ES5 environment, make sure to create a ` Promise ` constructor before using. |
98
- | : warning : | ` no-nesting ` | Avoid nested ` then() ` or ` catch() ` statements |
99
- | : warning : | ` no-promise-in-callback ` | Avoid using promises inside of callbacks |
100
- | : warning : | ` no-callback-in-promise ` | Avoid calling ` cb() ` inside of a ` then() ` (use [ nodeify] [ ] instead) |
101
- | : warning : | ` avoid-new ` | Avoid creating ` new ` promises outside of utility libs (use [ pify] [ ] instead) |
102
- | : warning : | ` no-return-in-finally ` | Disallow return statements in ` finally() ` |
103
- | : seven : | ` prefer-await-to-then ` | Prefer ` await ` to ` then() ` for reading Promise values |
104
- | : seven : | ` prefer-await-to-callbacks ` | Prefer async/await to the callback pattern |
91
+ | rule | description | recommended | fixable |
92
+ | --------------------------- | -------------------------------------------------------------------------------- | ----------- | -------- |
93
+ | ` catch-or-return ` | Enforces the use of ` catch() ` on un-returned promises. | : bangbang : | |
94
+ | ` no-return-wrap ` | Avoid wrapping values in ` Promise.resolve ` or ` Promise.reject ` when not needed. | : bangbang : | |
95
+ | ` param-names ` | Enforce consistent param names when creating new promises. | : bangbang : | : wrench : |
96
+ | ` always-return ` | Return inside each ` then() ` to create readable and reusable Promise chains. | : bangbang : | |
97
+ | ` no-native ` | In an ES5 environment, make sure to create a ` Promise ` constructor before using. | | |
98
+ | ` no-nesting ` | Avoid nested ` then() ` or ` catch() ` statements | : warning : | |
99
+ | ` no-promise-in-callback ` | Avoid using promises inside of callbacks | : warning : | |
100
+ | ` no-callback-in-promise ` | Avoid calling ` cb() ` inside of a ` then() ` (use [ nodeify] [ ] instead) | : warning : | |
101
+ | ` avoid-new ` | Avoid creating ` new ` promises outside of utility libs (use [ pify] [ ] instead) | : warning : | |
102
+ | ` no-return-in-finally ` | Disallow return statements in ` finally() ` | : warning : | |
103
+ | ` prefer-await-to-then ` | Prefer ` await ` to ` then() ` for reading Promise values | : seven : | |
104
+ | ` prefer-await-to-callbacks ` | Prefer async/await to the callback pattern | : seven : | |
105
105
106
106
** Key**
107
107
@@ -110,6 +110,7 @@ or start with the recommended rule set
110
110
| :bangbang : | Reports as error in recommended configuration |
111
111
| :warning : | Reports as warning in recommended configuration |
112
112
| :seven : | ES2017 Async Await rules |
113
+ | :wrench : | Rule is fixable with ` eslint --fix ` |
113
114
114
115
### ` catch-or-return `
115
116
@@ -215,6 +216,9 @@ way to reject the promise.
215
216
216
217
Enforce standard parameter names for Promise constructors
217
218
219
+ :wrench : The ` --fix ` option on the command line can automatically fix some of
220
+ the problems reported by this rule.
221
+
218
222
#### Valid
219
223
220
224
``` js
0 commit comments