Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat(eslint-plugin): [no-floating-promises] disable checkThenables by default for v8#9559

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -129,10 +129,6 @@ await createMyThenable();
</TabItem>
</Tabs>

:::info
This option is enabled by default in v7 but will be turned off by default in v8.
:::

### `ignoreVoid`

This option, which is `true` by default, allows you to stop the rule reporting promises consumed with void operator.
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -104,7 +104,7 @@ export default createRule<Options, MessageId>({
{
allowForKnownSafeCalls: readonlynessOptionsDefaults.allow,
allowForKnownSafePromises: readonlynessOptionsDefaults.allow,
checkThenables:true,
checkThenables:false,
ignoreIIFE: false,
ignoreVoid: true,
},
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -770,25 +770,19 @@ createSafePromise();
},
],
},
{
code: `
declare const createPromise: () => PromiseLike<number>;
createPromise();
`,
options: [{ checkThenables: false }],
},
{
code: `
`
declare const createPromiseLike: () => PromiseLike<number>;
createPromiseLike();
`,
`
interface MyThenable {
then(onFulfilled: () => void, onRejected: () => void): MyThenable;
}

declare function createMyThenable(): MyThenable;

createMyThenable();
`,
options: [{ checkThenables: false }],
},
`,
],

invalid: [
Expand DownExpand Up@@ -2104,6 +2098,7 @@ async function test() {
],
},
],
options: [{ checkThenables: true }],
},
{
code: `
Expand DownExpand Up@@ -3586,6 +3581,7 @@ promise;
options: [
{
allowForKnownSafePromises: [{ from: 'file', name: 'SafeThenable' }],
checkThenables: true,
},
],
errors: [
Expand DownExpand Up@@ -3962,7 +3958,6 @@ void createPromise();
],
},
],
options: [{ checkThenables: false }],
},
{
code: `
Expand All@@ -3986,7 +3981,6 @@ void createMyPromise();
],
},
],
options: [{ checkThenables: false }],
},
{
code: `
Expand DownExpand Up@@ -4014,7 +4008,7 @@ void createMyPromise();
],
},
],
options: [{ checkThenables:false }],
options: [{ checkThenables:true }],
},
],
});
Loading

[8]ページ先頭

©2009-2025 Movatter.jp