Skip to content

feat(eslint-plugin): [return-await] promote to recommended: strict #9595

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Show file tree
Hide file tree
Changes from all 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
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ export = {
allowNever: false,
},
],
'no-return-await': 'off',
'@typescript-eslint/return-await': 'error',
'@typescript-eslint/unbound-method': 'error',
'@typescript-eslint/use-unknown-in-catch-callback-variable': 'error',
},
Expand Down
2 changes: 2 additions & 0 deletions packages/eslint-plugin/src/configs/strict-type-checked.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ export = {
allowNever: false,
},
],
'no-return-await': 'off',
'@typescript-eslint/return-await': 'error',
'@typescript-eslint/triple-slash-reference': 'error',
'@typescript-eslint/unbound-method': 'error',
'@typescript-eslint/unified-signatures': 'error',
Expand Down
1 change: 1 addition & 0 deletions packages/eslint-plugin/src/rules/return-await.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export default createRule({
meta: {
docs: {
description: 'Enforce consistent awaiting of returned promises',
recommended: 'strict',
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kirkwaiblinger surfacing what you mentioned a bit back in a DM: that we might want to customize settings for this rule in the strict configs. I'm interpreting #8667 (comment) to mean that:

  • For strict: we want in-type-checked, as it avoids stylistic things
  • For stylistic: that'd be a separate issue

...and since this already has defaultOptions: ['in-try-catch'], we're cleared to just say recommended: 'strict'. Is that right?

Copy link
Member

@kirkwaiblinger kirkwaiblinger Jul 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

negative - my understanding was that the only thing that we are currently proceeding with is putting return-await in the strict config with option error-handling-correctness-only.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right! Makes sense, thanks.

Since that's a little bit more plumbing, as you suggested it would be, I'm going to close this one out & let you take lead. You've already taken the lead on so much around it & other async things, I'd rather not butt in.

requiresTypeChecking: true,
extendsBaseRule: 'no-return-await',
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ export default (
allowNever: false,
},
],
'no-return-await': 'off',
'@typescript-eslint/return-await': 'error',
'@typescript-eslint/unbound-method': 'error',
'@typescript-eslint/use-unknown-in-catch-callback-variable': 'error',
},
Expand Down
2 changes: 2 additions & 0 deletions packages/typescript-eslint/src/configs/strict-type-checked.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ export default (
allowNever: false,
},
],
'no-return-await': 'off',
'@typescript-eslint/return-await': 'error',
'@typescript-eslint/triple-slash-reference': 'error',
'@typescript-eslint/unbound-method': 'error',
'@typescript-eslint/unified-signatures': 'error',
Expand Down
Loading