I'm using tslint
on a Typescript project and I'm often getting warnings about shadow variables in lamdba functions.
Here's an example:
const page = this.currentDocument.pages.find(page => page.pageNumber === pageNumber);
Here the warning is about the page
variable.
I've already changed this because I find that's in bad style and confusing to reuse the page variable name here but I'm wondering if this could create a bug or is this just a style/comprehension issue in these cases. I know that shadow variables can often create bugs in other circumstances.
Does someone have an example of what could specifically go wrong here?