vercel / style-guide

Vercel's engineering style guide
Mozilla Public License 2.0
1.25k stars 33 forks source link

Enforce consistent acronyms and brands in variable names #25

Closed mrmckeb closed 1 year ago

mrmckeb commented 2 years ago

What are we trying to solve

To enforce consistent casing for acronyms.

Examples:

There are many views on this, and many valid arguments for either approach.

Research

Recommendation

As with many of our decisions in the style guide, I feel we should opt for the solution that's easiest to lint.

For brands, we should simply ignore casing and apply normal conventions (not lintable):

Unfortunately it's difficult to know programatically* if the XMLHTTP in XMLHTTPRequest is one or more acronyms, or a word that's incorrectly uppercased, just as it's impossible to know the opposite.

*Assuming we're not writing rules that use ML.

mrmckeb commented 1 year ago

Closing off as we can't think of a way to autofix this.