Skip to content

Commit f13cf8b

Browse files
committed
Disable @typescript-eslint/no-unnecessary-condition rule
1 parent c4d411a commit f13cf8b

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

index.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,16 @@ module.exports = {
337337
'@typescript-eslint/no-throw-literal': 'error',
338338
'@typescript-eslint/no-unnecessary-boolean-literal-compare': 'error',
339339
'no-constant-condition': 'off', // `no-unnecessary-condition` is essentially a stricter version of `no-constant-condition`.
340-
'@typescript-eslint/no-unnecessary-condition': 'error',
340+
341+
// TODO: Try to enable this again in 2023 *if* the following are resolved:
342+
// - https://github.com/microsoft/TypeScript/issues/13778 (otherwise, it will report on if checks for elements extracted from array)
343+
// - https://github.com/microsoft/TypeScript/issues/36393
344+
// - The rule needs a way to ignore runtime type-checks: https://github.com/sindresorhus/refined-github/pull/3168
345+
// - Run the rule on https://github.com/sindresorhus/refined-github and ensure there are no false-positives
346+
//
347+
// Also related: https://github.com/typescript-eslint/typescript-eslint/issues/1798
348+
// '@typescript-eslint/no-unnecessary-condition': 'error',
349+
341350
'@typescript-eslint/no-unnecessary-qualifier': 'error',
342351
'@typescript-eslint/no-unnecessary-type-arguments': 'error',
343352
'@typescript-eslint/no-unnecessary-type-assertion': 'error',

0 commit comments

Comments
 (0)