Skip to content

Commit

Permalink
fix(eslint-plugin): [no-floating-promises] revert disable of ignoreVo…
Browse files Browse the repository at this point in the history
…id in strict config (#8718)

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

* Reverted inlines too

* yarn generate-configs
  • Loading branch information
JoshuaKGoldberg committed Mar 18, 2024
1 parent 4f44fbc commit d78d98b
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 19 deletions.
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

0 comments on commit d78d98b

Please sign in to comment.