Skip to content

Commit 0841559

Browse files
committed
Enable strict-boolean-expressions rule
Fixes #95
1 parent 600b604 commit 0841559

1 file changed

Lines changed: 9 additions & 13 deletions

File tree

source/typescript-rules.js

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -642,19 +642,15 @@ export const typescriptRules = {
642642
'error',
643643
'always',
644644
],
645-
646-
// TODO: Reconsider enabling it again in 2023.
647-
// NOTE: The rule was complete redone in typescript-eslint v3, so this config needs to be changed before this is enabled.
648-
// Disabled for now as it's too strict.
649-
// Relevant discussion: https://github.com/sindresorhus/refined-github/pull/2521#discussion_r343013852
650-
// '@typescript-eslint/strict-boolean-expressions': [
651-
// 'error',
652-
// {
653-
// allowNullable: true,
654-
// allowSafe: true
655-
// }
656-
// ],
657-
645+
'@typescript-eslint/strict-boolean-expressions': [
646+
'error',
647+
{
648+
allowNullableBoolean: true,
649+
allowNullableObject: true,
650+
allowNumber: false,
651+
allowString: false,
652+
},
653+
],
658654
'@typescript-eslint/strict-void-return': 'error',
659655
'default-case': 'off', // It conflicts with `@typescript-eslint/switch-exhaustiveness-check`. It would still be nice to have this rule for non-exhaustive switches though.
660656
'@typescript-eslint/switch-exhaustiveness-check': [

0 commit comments

Comments
 (0)