Skip to content
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

fix(eslint-plugin): [no-floating-promises] revert disable of ignoreVoid in strict config #8718

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -15,7 +15,7 @@ export = {
'@typescript-eslint/no-base-to-string': 'error',
'@typescript-eslint/no-confusing-void-expression': 'error',
'@typescript-eslint/no-duplicate-type-constituents': 'error',
'@typescript-eslint/no-floating-promises': ['error', { ignoreVoid: false }],
'@typescript-eslint/no-floating-promises': 'error',
'@typescript-eslint/no-for-in-array': 'error',
'no-implied-eval': 'off',
'@typescript-eslint/no-implied-eval': 'error',
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin/src/configs/strict-type-checked.ts
Expand Up @@ -27,7 +27,7 @@ export = {
'@typescript-eslint/no-explicit-any': 'error',
'@typescript-eslint/no-extra-non-null-assertion': 'error',
'@typescript-eslint/no-extraneous-class': 'error',
'@typescript-eslint/no-floating-promises': ['error', { ignoreVoid: false }],
'@typescript-eslint/no-floating-promises': 'error',
'@typescript-eslint/no-for-in-array': 'error',
'no-implied-eval': 'off',
'@typescript-eslint/no-implied-eval': 'error',
Expand Down
5 changes: 1 addition & 4 deletions packages/eslint-plugin/src/rules/no-floating-promises.ts
Expand Up @@ -50,10 +50,7 @@ export default createRule<Options, MessageId>({
docs: {
description:
'Require Promise-like statements to be handled appropriately',
recommended: {
recommended: true,
strict: [{ ignoreVoid: false }],
},
recommended: 'recommended',
requiresTypeChecking: true,
},
hasSuggestions: true,
Expand Down
3 changes: 1 addition & 2 deletions packages/repo-tools/src/postinstall.mts
Expand Up @@ -20,8 +20,7 @@ if (process.env.SKIP_POSTINSTALL) {
process.exit(0);
}

// eslint-disable-next-line @typescript-eslint/no-floating-promises
(async function (): Promise<void> {
void (async function (): Promise<void> {
// make sure we're running from the workspace root
const {
default: { workspaceRoot },
Expand Down
3 changes: 1 addition & 2 deletions packages/rule-tester/src/utils/config-validator.ts
Expand Up @@ -78,8 +78,7 @@ function validateRuleSchema(
const validateRule = ruleValidators.get(rule);

if (validateRule) {
// eslint-disable-next-line @typescript-eslint/no-floating-promises
validateRule(localOptions);
void validateRule(localOptions);
if (validateRule.errors) {
throw new Error(
validateRule.errors
Expand Down
Expand Up @@ -23,10 +23,7 @@ export default (
'@typescript-eslint/no-base-to-string': 'error',
'@typescript-eslint/no-confusing-void-expression': 'error',
'@typescript-eslint/no-duplicate-type-constituents': 'error',
'@typescript-eslint/no-floating-promises': [
'error',
{ ignoreVoid: false },
],
'@typescript-eslint/no-floating-promises': 'error',
'@typescript-eslint/no-for-in-array': 'error',
'no-implied-eval': 'off',
'@typescript-eslint/no-implied-eval': 'error',
Expand Down
Expand Up @@ -35,10 +35,7 @@ export default (
'@typescript-eslint/no-explicit-any': 'error',
'@typescript-eslint/no-extra-non-null-assertion': 'error',
'@typescript-eslint/no-extraneous-class': 'error',
'@typescript-eslint/no-floating-promises': [
'error',
{ ignoreVoid: false },
],
'@typescript-eslint/no-floating-promises': 'error',
'@typescript-eslint/no-for-in-array': 'error',
'no-implied-eval': 'off',
'@typescript-eslint/no-implied-eval': 'error',
Expand Down
2 changes: 1 addition & 1 deletion packages/website/src/hooks/useClipboard.ts
Expand Up @@ -9,7 +9,7 @@ export function useClipboard(code: () => string): useClipboardResult {

const copy = useCallback(() => {
// eslint-disable-next-line @typescript-eslint/no-floating-promises
navigator.clipboard.writeText(code()).then(() => {
void navigator.clipboard.writeText(code()).then(() => {
setCopied(true);
});
}, [setCopied, code]);
Expand Down