mirror of
https://github.com/airbnb/javascript.git
synced 2026-01-14 16:37:54 -05:00
[guide] Add notes on acronyms and initialisms to naming
This commit is contained in:
committed by
Jordan Gensler
parent
c4a9d28485
commit
9f51fd264b
30
README.md
30
README.md
@@ -2761,6 +2761,36 @@ Other Style Guides
|
||||
export default AirbnbStyleGuide;
|
||||
```
|
||||
|
||||
<a name="naming--Acronyms-and-Initialisms"></a>
|
||||
- [22.9](#naming--Acronyms-and-Initialisms) Acronyms and initialisms should always be all capitalized, or all lowercased.
|
||||
|
||||
> Why? Names are for readability, not to appease a computer algorithm.
|
||||
|
||||
```javascript
|
||||
// bad
|
||||
import SmsContainer from './containers/SmsContainer';
|
||||
|
||||
// bad
|
||||
const HttpRequests = [
|
||||
// ...
|
||||
];
|
||||
|
||||
// good
|
||||
import SMSContainer from './containers/SMSContainer';
|
||||
|
||||
// good
|
||||
const HTTPRequests = [
|
||||
// ...
|
||||
];
|
||||
|
||||
// best
|
||||
import TextMessageContainer from './containers/TextMessageContainer';
|
||||
|
||||
// best
|
||||
const Requests = [
|
||||
// ...
|
||||
];
|
||||
```
|
||||
|
||||
**[⬆ back to top](#table-of-contents)**
|
||||
|
||||
|
||||
Reference in New Issue
Block a user