Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

Commit 5ccdb96

Browse files
author
Jeremy Wiebe
committed
Clarify const and SCREAMING_CAPS.
1 parent 2a88330 commit 5ccdb96

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

es6/README.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ read-only (`false`) or read-write (`true`).
5353

5454
## Naming
5555

56-
Classes and constructor functions should be TitleCased
56+
Classes and constructor functions should be `TitleCased`
5757

5858
```javascript
5959
// GOOD
@@ -65,7 +65,10 @@ var LinkLabel = function() { }
6565
class linkLabel { }
6666
```
6767

68-
Constant values that appear outside of a method scope should be in ALL_CAPS
68+
Constant values that appear outside of a method scope and truly represent "data"
69+
that is constant (ie. it isn't something that is expected to be mutated during
70+
the app lifecycle), should be in `ALL_CAPS`. This means that things like global
71+
functions would still be `camelCased`. See examples below.
6972

7073
```javascript
7174
// GOOD
@@ -88,10 +91,12 @@ class DatePicker {
8891
}
8992
```
9093

91-
All other symbols (methods, variables, constants within a method) should be camelCased!
94+
All other symbols (methods, variables, constants within a method) should be `camelCased`!
9295

9396
```javascript
9497
// GOOD
98+
import {addToCart} from './actions'
99+
95100
class MyClass {
96101
const name = 'Button'
97102
render() { ... }

0 commit comments

Comments
 (0)