File tree 3 files changed +11
-2
lines changed
3 files changed +11
-2
lines changed Original file line number Diff line number Diff line change
1
+ ## 5.2.0
2
+
3
+ - Updated ` param-names ` rule to allow for unused params
4
+
1
5
## 5.1.1
2
6
3
7
- Updated docs to include ` no-callback-in-promise ` reasons #215
6
10
7
11
- Included ` catch() ` and ` finally() ` in ` prefer-await-to-then ` #196
8
12
- Added some additional tests and upgraded some dev deps #196
9
- - Exempted array methods in prefer-await-to-callbacks ([ #212 ] ( https://github.com/xjamundx/eslint-plugin-promise/issues/212 ) )
13
+ - Exempted array methods in prefer-await-to-callbacks
14
+ ([ #212 ] ( https://github.com/xjamundx/eslint-plugin-promise/issues/212 ) )
10
15
11
16
## 5.0.0
12
17
Original file line number Diff line number Diff line change @@ -7,13 +7,15 @@ Enforce standard parameter names for Promise constructors
7
7
``` js
8
8
new Promise (function (resolve ) { ... })
9
9
new Promise (function (resolve , reject ) { ... })
10
+ new Promise (function (_resolve , _reject ) { ... }) // Unused marker for parameters are allowed
10
11
```
11
12
12
13
#### Invalid
13
14
14
15
``` js
15
16
new Promise (function (reject , resolve ) { ... }) // incorrect order
16
17
new Promise (function (ok , fail ) { ... }) // non-standard parameter names
18
+ new Promise (function (_ , reject ) { ... }) // a simple underscore is not allowed
17
19
```
18
20
19
21
Ensures that ` new Promise() ` is instantiated with the parameter names
Original file line number Diff line number Diff line change @@ -21,7 +21,9 @@ module.exports = {
21
21
22
22
if (
23
23
( params [ 0 ] . name !== 'resolve' && params [ 0 ] . name !== '_resolve' ) ||
24
- ( params [ 1 ] && params [ 1 ] . name !== 'reject' && params [ 1 ] . name !== '_reject' )
24
+ ( params [ 1 ] &&
25
+ params [ 1 ] . name !== 'reject' &&
26
+ params [ 1 ] . name !== '_reject' )
25
27
) {
26
28
context . report ( {
27
29
node,
You can’t perform that action at this time.
0 commit comments