Why would ESLint or any linter

It’s warning about exactly what you’re doing: the name parameter is shadowing the name in the outer scope. If this is what you intend to do, then disable the warning for that line. If you’re running into this problem a lot, you might want to limit your scopes more or shadow your variables less.

Or if your code style shadows names in the same scope a lot , just disable the warning in the config. I do recommend not doing a whole lot of shadowing for names in the outer scope simply because it can be confusing to the reader, even if the compiler is completely clear.

1 Like