Skip to content

Commit

Permalink
Update packages/eslint-plugin/src/rules/no-unnecessary-type-assertion.ts
Browse files Browse the repository at this point in the history
Co-authored-by: Brad Zacher <brad.zacher@gmail.com>
  • Loading branch information
JoshuaKGoldberg and bradzacher committed Apr 5, 2021
1 parent 3db3aa4 commit db0e026
Showing 1 changed file with 4 additions and 0 deletions.
Expand Up @@ -151,6 +151,10 @@ export default util.createRule<Options, MessageIds>({
},
});
}
// for all other = assignments we ignore non-null checks
// this is because non-null assertions can change the type-flow of the code
// so whilst they might be unnecessary for the assignment - they are necessary
// for following code
return;
}

Expand Down

0 comments on commit db0e026

Please sign in to comment.