You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Copy file name to clipboardExpand all lines: es6/README.md
+29Lines changed: 29 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -51,6 +51,35 @@ globals:
51
51
The boolean value indicates whether the global is to be treated as
52
52
read-only (`false`) or read-write (`true`).
53
53
54
+
## Naming
55
+
56
+
Classes and constructor functions should be TitleCased
57
+
58
+
```javascript
59
+
// GOOD
60
+
class DatePicker { }
61
+
62
+
var LinkLabel = function() { }
63
+
64
+
// BAD
65
+
class linkLabel { }
66
+
```
67
+
68
+
All other symbols (methods, variables, even constants) should be camelCased!
69
+
70
+
```javascript
71
+
// GOOD
72
+
const defaultName = 'Element'
73
+
74
+
class MyClass {
75
+
const name = 'Button'
76
+
render() { ... }
77
+
}
78
+
79
+
// BAD - ES6 has `const` now. The compiler/interpreter will warn you if you re-assign a const.
80
+
const DEFAULT_NAME = 'Element'
81
+
```
82
+
54
83
## Overriding Lint Rules
55
84
56
85
Some of the lint rules disallow uncommon but valid behaviour that is easily confused with/typoed from much more common behaviour. If you need to use the disallowed behaviour on purpose, use an explicit lint override in the source.
0 commit comments