mirror of
https://github.com/airbnb/javascript.git
synced 2026-01-14 08:38:08 -05:00
[guide] ``js -> ``javascript for consistency
This commit is contained in:
committed by
Jordan Harband
parent
40d5797b35
commit
d8c3048f24
@@ -907,7 +907,7 @@ Other Style Guides
|
||||
|
||||
> Why? It shows clearly where the function starts and ends.
|
||||
|
||||
```js
|
||||
```javascript
|
||||
// bad
|
||||
['get', 'post', 'put'].map(httpMethod => Object.prototype.hasOwnProperty.call(
|
||||
httpMagicObjectWithAVeryLongName,
|
||||
@@ -929,7 +929,7 @@ Other Style Guides
|
||||
|
||||
> Why? Less visual clutter.
|
||||
|
||||
```js
|
||||
```javascript
|
||||
// bad
|
||||
[1, 2, 3].map((x) => x * x);
|
||||
|
||||
@@ -957,7 +957,7 @@ Other Style Guides
|
||||
<a name="arrows--confusing"></a><a name="8.5"></a>
|
||||
- [8.5](#arrows--confusing) Avoid confusing arrow function syntax (`=>`) with comparison operators (`<=`, `>=`). eslint: [`no-confusing-arrow`](http://eslint.org/docs/rules/no-confusing-arrow)
|
||||
|
||||
```js
|
||||
```javascript
|
||||
// bad
|
||||
const itemHeight = item => item.height > 256 ? item.largeSize : item.smallSize;
|
||||
|
||||
@@ -1351,7 +1351,7 @@ Other Style Guides
|
||||
|
||||
> Why? `function` and `*` are part of the same conceptual keyword - `*` is not a modifier for `function`, `function*` is a unique construct, different from `function`.
|
||||
|
||||
```js
|
||||
```javascript
|
||||
// bad
|
||||
function * foo() {
|
||||
// ...
|
||||
|
||||
Reference in New Issue
Block a user