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