Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9cbda0f

Browse files
nischayvljharb
authored andcommitted
Updated README - Added sub-section for spaces in comments
1 parent fbfe881 commit 9cbda0f

File tree

1 file changed

+39
-3
lines changed

1 file changed

+39
-3
lines changed

README.md

Lines changed: 39 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1922,11 +1922,47 @@ Other Style Guides
19221922
}
19231923
```
19241924
1925+
- [17.3](#comments--spaces) Start all comments with a space to make it easier to read.
1926+
1927+
```javascript
1928+
// bad
1929+
//is current tab
1930+
const active = true;
1931+
1932+
// good
1933+
// is current tab
1934+
const active = true;
1935+
1936+
// bad
1937+
/**
1938+
*make() returns a new element
1939+
*based on the passed-in tag name
1940+
*/
1941+
function make(tag) {
1942+
1943+
// ...stuff...
1944+
1945+
return element;
1946+
}
1947+
1948+
// good
1949+
/**
1950+
* make() returns a new element
1951+
* based on the passed-in tag name
1952+
*/
1953+
function make(tag) {
1954+
1955+
// ...stuff...
1956+
1957+
return element;
1958+
}
1959+
```
1960+
19251961
<a name="comments--actionitems"></a><a name="17.3"></a>
1926-
- [17.3](#comments--actionitems) Prefixing your comments with `FIXME` or `TODO` helps other developers quickly understand if you're pointing out a problem that needs to be revisited, or if you're suggesting a solution to the problem that needs to be implemented. These are different than regular comments because they are actionable. The actions are `FIXME: -- need to figure this out` or `TODO: -- need to implement`.
1962+
- [17.4](#comments--actionitems) Prefixing your comments with `FIXME` or `TODO` helps other developers quickly understand if you're pointing out a problem that needs to be revisited, or if you're suggesting a solution to the problem that needs to be implemented. These are different than regular comments because they are actionable. The actions are `FIXME: -- need to figure this out` or `TODO: -- need to implement`.
19271963
19281964
<a name="comments--fixme"></a><a name="17.4"></a>
1929-
- [17.4](#comments--fixme) Use `// FIXME:` to annotate problems.
1965+
- [17.5](#comments--fixme) Use `// FIXME:` to annotate problems.
19301966
19311967
```javascript
19321968
class Calculator extends Abacus {
@@ -1940,7 +1976,7 @@ Other Style Guides
19401976
```
19411977
19421978
<a name="comments--todo"></a><a name="17.5"></a>
1943-
- [17.5](#comments--todo) Use `// TODO:` to annotate solutions to problems.
1979+
- [17.6](#comments--todo) Use `// TODO:` to annotate solutions to problems.
19441980

19451981
```javascript
19461982
class Calculator extends Abacus {

0 commit comments

Comments
 (0)