mirror of
https://github.com/theoludwig/eslint-config-conventions.git
synced 2024-12-18 21:45:04 +01:00
fix: allow to ignore floating promise with void operator: @typescript-eslint/no-floating-promises
This commit is contained in:
parent
815518c613
commit
10b5a0d8df
@ -140,7 +140,7 @@
|
|||||||
"no-useless-return": "error",
|
"no-useless-return": "error",
|
||||||
"no-else-return": ["error", { "allowElseIf": false }],
|
"no-else-return": ["error", { "allowElseIf": false }],
|
||||||
"no-var": "error",
|
"no-var": "error",
|
||||||
"no-void": "error",
|
"no-void": ["error", { "allowAsStatement": true }],
|
||||||
"no-with": "error",
|
"no-with": "error",
|
||||||
"object-shorthand": ["error", "properties"],
|
"object-shorthand": ["error", "properties"],
|
||||||
"one-var": ["error", { "initialized": "never" }],
|
"one-var": ["error", { "initialized": "never" }],
|
||||||
|
3
test/fixtures/typescript-no-errors-ignore-promise.ts
vendored
Normal file
3
test/fixtures/typescript-no-errors-ignore-promise.ts
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
const returnsPromise = async (): Promise<void> => {}
|
||||||
|
|
||||||
|
void returnsPromise()
|
@ -37,3 +37,10 @@ test("ensure we allow top-level await", async () => {
|
|||||||
)
|
)
|
||||||
assert.strictEqual(lintResult?.errorCount, 0)
|
assert.strictEqual(lintResult?.errorCount, 0)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
test("ensure we allow to ignore floating promise with void operator (@typescript-eslint/no-floating-promises)", async () => {
|
||||||
|
const [lintResult] = await eslint.lintFiles(
|
||||||
|
"test/fixtures/typescript-no-errors-ignore-promise.ts",
|
||||||
|
)
|
||||||
|
assert.strictEqual(lintResult?.errorCount, 0)
|
||||||
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user