Skip to content

Commit

Permalink
fix: add ignoreIIFE to @typescript-eslint/no-floating-promises
Browse files Browse the repository at this point in the history
Without this setting, async functions cannot be executed at the top level (Node.js 12 does not support Top Level Await)
  • Loading branch information
tksst committed Jul 30, 2022
1 parent f464a02 commit 1446c9f
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
9 changes: 9 additions & 0 deletions __snapshots__/index.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -6615,6 +6615,9 @@ Object {
],
"@typescript-eslint/no-floating-promises": Array [
"error",
Object {
"ignoreIIFE": true,
},
],
"@typescript-eslint/no-for-in-array": Array [
"error",
Expand Down Expand Up @@ -9088,6 +9091,9 @@ Object {
],
"@typescript-eslint/no-floating-promises": Array [
"error",
Object {
"ignoreIIFE": true,
},
],
"@typescript-eslint/no-for-in-array": Array [
"error",
Expand Down Expand Up @@ -11561,6 +11567,9 @@ Object {
],
"@typescript-eslint/no-floating-promises": Array [
"error",
Object {
"ignoreIIFE": true,
},
],
"@typescript-eslint/no-for-in-array": Array [
"error",
Expand Down
9 changes: 9 additions & 0 deletions __snapshots__/typescript.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,9 @@ Object {
],
"@typescript-eslint/no-floating-promises": Array [
"error",
Object {
"ignoreIIFE": true,
},
],
"@typescript-eslint/no-for-in-array": Array [
"error",
Expand Down Expand Up @@ -2701,6 +2704,9 @@ Object {
],
"@typescript-eslint/no-floating-promises": Array [
"error",
Object {
"ignoreIIFE": true,
},
],
"@typescript-eslint/no-for-in-array": Array [
"error",
Expand Down Expand Up @@ -5174,6 +5180,9 @@ Object {
],
"@typescript-eslint/no-floating-promises": Array [
"error",
Object {
"ignoreIIFE": true,
},
],
"@typescript-eslint/no-for-in-array": Array [
"error",
Expand Down
1 change: 1 addition & 0 deletions typescript.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ module.exports = {
rules: {
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/no-floating-promises": ["error", { ignoreIIFE: true }],
"@typescript-eslint/no-use-before-define": "off",
"@typescript-eslint/no-explicit-any": "warn",
"@typescript-eslint/no-unused-vars": "warn",
Expand Down

0 comments on commit 1446c9f

Please sign in to comment.