Skip to content

Commit 590ca50

Browse files
bradzacherJamesHenry
authored andcommitted
feat(eslint-plugin): [promise-function-async] make allowAny default true (#733)
BREAKING CHANGE: changing default rule config
1 parent 4933ade commit 590ca50

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

Diff for: packages/eslint-plugin/docs/rules/promise-function-async.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ async function functionDeturnsPromise() {
3636

3737
Options may be provided as an object with:
3838

39-
- `allowAny` to indicate that `any` or `unknown` shouldn't be considered Promises (`false` by default).
39+
- `allowAny` to indicate that `any` or `unknown` shouldn't be considered Promises (`true` by default).
4040
- `allowedPromiseNames` to indicate any extra names of classes or interfaces to be considered Promises when returned.
4141

4242
In addition, each of the following properties may be provided, and default to `true`:
@@ -51,7 +51,6 @@ In addition, each of the following properties may be provided, and default to `t
5151
"@typescript-eslint/promise-function-async": [
5252
"error",
5353
{
54-
"allowAny": true,
5554
"allowedPromiseNames": ["Thenable"],
5655
"checkArrowFunctions": true,
5756
"checkFunctionDeclarations": true,

Diff for: packages/eslint-plugin/src/rules/promise-function-async.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export default util.createRule<Options, MessageIds>({
5858
},
5959
defaultOptions: [
6060
{
61-
allowAny: false,
61+
allowAny: true,
6262
allowedPromiseNames: [],
6363
checkArrowFunctions: true,
6464
checkFunctionDeclarations: true,

Diff for: packages/eslint-plugin/tests/rules/promise-function-async.test.ts

+10
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,11 @@ function returnsAny(): any {
102102
return 0;
103103
}
104104
`,
105+
options: [
106+
{
107+
allowAny: false,
108+
},
109+
],
105110
errors: [
106111
{
107112
messageId,
@@ -114,6 +119,11 @@ function returnsUnknown(): unknown {
114119
return 0;
115120
}
116121
`,
122+
options: [
123+
{
124+
allowAny: false,
125+
},
126+
],
117127
errors: [
118128
{
119129
messageId,

0 commit comments

Comments
 (0)