diff --git a/packages/eslint-plugin/src/rules/prefer-nullish-coalescing.ts b/packages/eslint-plugin/src/rules/prefer-nullish-coalescing.ts index 0eaa39b1f0bb..dbb32994f16c 100644 --- a/packages/eslint-plugin/src/rules/prefer-nullish-coalescing.ts +++ b/packages/eslint-plugin/src/rules/prefer-nullish-coalescing.ts @@ -128,7 +128,7 @@ export default util.createRule({ return true; } - // it is fixable if we loosly check for eihter null or undefined + // it is fixable if we loosely check for either null or undefined if ( (operator === '==' || operator === '!=') && (hasUndefinedCheck || hasNullCheck) @@ -191,10 +191,8 @@ export default util.createRule({ ): void { const tsNode = parserServices.esTreeNodeToTSNodeMap.get(node); const type = checker.getTypeAtLocation(tsNode.left); - const isNullLiteralish = util.isNullableType(type, { - allowUndefined: true, - }); - if (!isNullLiteralish) { + const isNullish = util.isNullableType(type, { allowUndefined: true }); + if (!isNullish) { return; }