Open Janpot opened 2 weeks ago
I've also seen somewhat similar stuff with t
being used for translation
:
Should we think of it similarly?
Maybe, it's up to the core team IMO. I think we're all quite on the same page for e
=>event
I found this issue back in the GitHub project I'm trying to revive for code-infra. Maybe we should groom this a bit first
The one-letter variables are a never-ending topic in software development :laughing:
For e
=> event
, it enforces some consistency across the codebase so I'm all in favor of doing it.
IMHO the rule should not apply to for loops for (let i=0)
, and for map
/ filter
it's debatable but I don't have a strong preference.
I agree. Ok, I propose then to keep the scope of this issue to e
=> event
only. And to instead use the id-denylist
rule. wdyt?
Hey, Could someone this issue to me? I would love to make a PR on this issue Thanks
@AfaqShuaib09 Go for it
For example https://github.com/mui/material-ui/blob/1103320f310e799216d6f2cf76d4e8054b1dc0de/docs/data/joy/components/list/ExampleNavigationMenu.tsx#L67
Also enforce this with an eslint rule. e.g. ~https://eslint.org/docs/latest/rules/id-length~ https://eslint.org/docs/latest/rules/id-denylist
Single letter identifiers are desired in some cases (
t
for translations, andi
,j
,k
for loop variables). So let's keep the scope of this issue down to specific identifiers only and not enforce it by length. Some other ids I can think of are:err
=>error
res
=>response
, or did you meanresult
, orresolve
?