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
Copy file name to clipboardExpand all lines: docs/style-guides/javascript/README.md
+21-15Lines changed: 21 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# JavaScript Style Guide
2
2
3
-
> _An opinionated style guide for writing JavaScript._
3
+
> *An opinionated style guide for writing JavaScript.*
4
4
5
5
6
6
## Table of Contents
@@ -37,11 +37,11 @@
37
37
38
38
## Introduction
39
39
40
-
Always abide by the __Law of Code Style Consistency__, or, in other words, _when in Rome, do as the Romans do_.
40
+
Always abide by the __Law of Code Style Consistency__, or, in other words, *when in Rome, do as the Romans do*.
41
41
42
42
While the code base to which you want to contribute may be a horrific mess in terms of aesthetic appearance and style, style consistency takes precedent over personal preference and canon. The more consistent a code base is in terms of style, the more readers of the code can focus on what the code does rather than deciphering changes in style.
43
43
44
-
So, even if your peers commit various _faux pas_ outlined below, as long as you are contributing to their code base, abide by their conventions.
44
+
So, even if your peers commit various *faux pas* outlined below, as long as you are contributing to their code base, abide by their conventions.
45
45
46
46
A code base--module, repository, application, library, etc--should always appear to have a single author and not be a schizophrenic franken-mess. This stated, for those opportunities where you are the primary author, you should lead by example and write clean, readable, and testable code.
47
47
@@ -67,7 +67,7 @@ Hopefully, most of the conventions outlined below will help enable you to do so.
67
67
68
68
##### Reason
69
69
70
-
Tab indentation allows a developer to specify the space indentation equivalent in her editor. For example, in [Sublime Text][sublime-text], you can specify in your user preferences
70
+
[Tab indentation][tab-indentation] allows a developer to specify the space indentation equivalent in her editor. For example, in [Sublime Text][sublime-text], you can specify in your user preferences
71
71
72
72
```text
73
73
"tab_width": 4
@@ -779,6 +779,7 @@ Code review.
779
779
780
780
781
781
<!-- <rule-set> -->
782
+
782
783
---
783
784
784
785
## Strings
@@ -3028,6 +3029,7 @@ var robo = createRobot();
3028
3029
3029
3030
3030
3031
<!-- <rule-set> -->
3032
+
3031
3033
---
3032
3034
3033
3035
## Setters and Getters
@@ -3439,9 +3441,9 @@ Often, more focused modules are available which can accomplish the same task. In
3439
3441
3440
3442
* In particular, avoid the following libraries:
3441
3443
3442
-
* underscore
3443
-
* lodash
3444
-
* async
3444
+
* underscore
3445
+
* lodash
3446
+
* async
3445
3447
3446
3448
3447
3449
##### Enforcement
@@ -3460,15 +3462,19 @@ Any dependency you use becomes __your__ responsibility. Demand the same level of
3460
3462
3461
3463
##### Notes
3462
3464
3463
-
* While Github stars and downloads are rough indicators, place more emphasis on the following:
3465
+
* While GitHub stars and downloads are rough indicators, place more emphasis on the following:
3466
+
3467
+
* Code quality
3468
+
3469
+
- conciseness
3470
+
- maintainability
3471
+
3472
+
* Documentation
3473
+
3474
+
- APIs
3475
+
- examples
3464
3476
3465
-
* Code quality
3466
-
- conciseness
3467
-
- maintainability
3468
-
* Documentation
3469
-
- APIs
3470
-
- examples
3471
-
* Test cases
3477
+
* Test cases
3472
3478
3473
3479
* For most cases, do __not__ place much weight on how recently the module was updated. Small, focused, well-written modules should not require much updating.
0 commit comments