Fork me on GitHub
#clj-kondo
<
2020-08-02
>
borkdude14:08:32

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.

practicalli-johnny16:08:53

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.

borkdude16:08:08

I have trouble parsing the first half of that sentence

seancorfield21:08:24

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

seancorfield21:08:44

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.

vemv01:08:21

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