Skip to content

Commit d7bdcec

Browse files
amir-rahmaniiASafaeirad
authored andcommitted
feat(promise): add new rules
1 parent 2d5ad35 commit d7bdcec

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/modules/promise.mjs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
import plugin from 'eslint-plugin-promise';
22

3+
import { strict } from '../utils/conditions.mjs';
4+
35
/** @return { import('eslint').Linter.Config } */
4-
function promise() {
6+
function promise(options = {}) {
57
return {
68
plugins: { promise: plugin },
79
rules: {
@@ -18,8 +20,10 @@ function promise() {
1820
'promise/param-names': 'warn',
1921
'promise/prefer-await-to-callbacks': 'off',
2022
'promise/prefer-await-to-then': 'off',
23+
'promise/prefer-catch': strict(options, 'warn'),
2124
'promise/valid-params': 'warn',
2225
'promise/no-multiple-resolved': 'warn',
26+
'promise/spec-only': 'warn',
2327
},
2428
};
2529
}

0 commit comments

Comments
 (0)