Fork me on GitHub

I wonder how useful people would find a linter that warns if you shadow a var with a local name. I fear that people would be interested initially, but after a while, they would turn it off because it's so common to call a local e.g. val or key.


I would find it useful to have a linter that highlights local names shadowing vars, but then I strive for highly readable code as meaningless names are quite difficult for me to work with.


I have trouble parsing the first half of that sentence


I would find it very helpful, as long as I could turn it off for certain symbols on a per-namespace basis.


For example, I have a couple of namespaces where I want function arguments and let bindings to use name but in general I would want a linter to tell me not to do that.


I find it definitely useful, Eastwood does it (and without issues other than its usual relative slowness) In specific legacy projects it's unfeasible to retrofit things though Also occasionally it's very hard to come up with a good local name that doesn't shadow the defn it comes from