Skip to content

Commit

Permalink
[guide] Add backticks
Browse files Browse the repository at this point in the history
  • Loading branch information
parksb authored and ljharb committed May 4, 2018
1 parent 2bd77bc commit 2ba36de
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ Other Style Guides
```
<a name="arrays--from"></a><a name="4.4"></a>
- [4.4](#arrays--from) To convert an array-like object to an array, use spreads `...` instead of [Array.from](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Array/from).
- [4.4](#arrays--from) To convert an array-like object to an array, use spreads `...` instead of [`Array.from`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Array/from).
```javascript
const foo = document.querySelectorAll('.foo');
Expand Down Expand Up @@ -786,7 +786,7 @@ Other Style Guides
<a name="functions--constructor"></a><a name="7.10"></a>
- [7.10](#functions--constructor) Never use the Function constructor to create a new function. eslint: [`no-new-func`](https://eslint.org/docs/rules/no-new-func)
> Why? Creating a function in this way evaluates a string similarly to eval(), which opens vulnerabilities.
> Why? Creating a function in this way evaluates a string similarly to `eval()`, which opens vulnerabilities.
```javascript
// bad
Expand Down Expand Up @@ -1167,7 +1167,7 @@ Other Style Guides
```
<a name="constructors--tostring"></a><a name="9.4"></a>
- [9.4](#constructors--tostring) It’s okay to write a custom toString() method, just make sure it works successfully and causes no side effects.
- [9.4](#constructors--tostring) It’s okay to write a custom `toString()` method, just make sure it works successfully and causes no side effects.
```javascript
class Jedi {
Expand Down Expand Up @@ -1687,7 +1687,7 @@ Other Style Guides
```
<a name="variables--unary-increment-decrement"></a><a name="13.6"></a>
- [13.6](#variables--unary-increment-decrement) Avoid using unary increments and decrements (++, --). eslint [`no-plusplus`](https://eslint.org/docs/rules/no-plusplus)
- [13.6](#variables--unary-increment-decrement) Avoid using unary increments and decrements (`++`, `--`). eslint [`no-plusplus`](https://eslint.org/docs/rules/no-plusplus)
> Why? Per the eslint documentation, unary increment and decrement statements are subject to automatic semicolon insertion and can cause silent errors with incrementing or decrementing values within an application. It is also more expressive to mutate your values with statements like `num += 1` instead of `num++` or `num ++`. Disallowing unary increment and decrement statements also prevents you from pre-incrementing/pre-decrementing values unintentionally which can also cause unexpected behavior in your programs.
Expand Down Expand Up @@ -3295,7 +3295,7 @@ Other Style Guides
- [24.1](#accessors--not-required) Accessor functions for properties are not required.

<a name="accessors--no-getters-setters"></a><a name="23.2"></a>
- [24.2](#accessors--no-getters-setters) Do not use JavaScript getters/setters as they cause unexpected side effects and are harder to test, maintain, and reason about. Instead, if you do make accessor functions, use getVal() and setVal('hello').
- [24.2](#accessors--no-getters-setters) Do not use JavaScript getters/setters as they cause unexpected side effects and are harder to test, maintain, and reason about. Instead, if you do make accessor functions, use `getVal()` and `setVal('hello')`.

```javascript
// bad
Expand Down Expand Up @@ -3337,7 +3337,7 @@ Other Style Guides
```

<a name="accessors--consistent"></a><a name="23.4"></a>
- [24.4](#accessors--consistent) It’s okay to create get() and set() functions, but be consistent.
- [24.4](#accessors--consistent) It’s okay to create `get()` and `set()` functions, but be consistent.

```javascript
class Jedi {
Expand Down

0 comments on commit 2ba36de

Please sign in to comment.