Skip to content

Commit cad9032

Browse files
committed
[comments] add FIXME and TODO annotations. Fixes airbnb#62
1 parent a15b27e commit cad9032

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -668,6 +668,32 @@
668668
}
669669
```
670670

671+
- 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`.
672+
673+
- Use `// FIXME:` to annotate problems
674+
675+
```javascript
676+
function Calculator() {
677+
678+
// FIXME: shouldn't use a global here
679+
total = 0;
680+
681+
return this;
682+
}
683+
```
684+
685+
- Use `// TODO:` to annotate solutions to problems
686+
687+
```javascript
688+
function Calculator() {
689+
690+
// TODO: total should be configurable by an options param
691+
this.total = 0;
692+
693+
return this;
694+
}
695+
```
696+
671697
**[[⬆]](#TOC)**
672698

673699

0 commit comments

Comments
 (0)