Skip to content

Commit

Permalink
chore: fixed typo
Browse files Browse the repository at this point in the history
  • Loading branch information
jguddas committed Jun 11, 2022
1 parent dda02a3 commit 2587035
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions packages/eslint-plugin/src/rules/prefer-nullish-coalescing.ts
Expand Up @@ -128,7 +128,7 @@ export default util.createRule<Options, MessageIds>({
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)
Expand Down Expand Up @@ -191,10 +191,8 @@ export default util.createRule<Options, MessageIds>({
): 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;
}

Expand Down

0 comments on commit 2587035

Please sign in to comment.