Skip to content
This repository was archived by the owner on Sep 22, 2025. It is now read-only.

Commit cd4ec62

Browse files
committed
[guide] change more straight quotes to curly quotes
1 parent 4499ee0 commit cd4ec62

1 file changed

Lines changed: 14 additions & 14 deletions

File tree

README.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ Other Style Guides
9797
<a name="references--prefer-const"></a><a name="2.1"></a>
9898
- [2.1](#references--prefer-const) Use `const` for all of your references; avoid using `var`. eslint: [`prefer-const`](http://eslint.org/docs/rules/prefer-const.html), [`no-const-assign`](http://eslint.org/docs/rules/no-const-assign.html)
9999

100-
> Why? This ensures that you can't reassign your references, which can lead to bugs and difficult to comprehend code.
100+
> Why? This ensures that you cant reassign your references, which can lead to bugs and difficult to comprehend code.
101101

102102
```javascript
103103
// bad
@@ -708,7 +708,7 @@ Other Style Guides
708708
```javascript
709709
// really bad
710710
function handleThings(opts) {
711-
// No! We shouldn't mutate function arguments.
711+
// No! We shouldnt mutate function arguments.
712712
// Double bad: if opts is falsy it'll be set to an object which may
713713
// be what you want but it can introduce subtle bugs.
714714
opts = opts || {};
@@ -838,7 +838,7 @@ Other Style Guides
838838
<a name="functions--spread-vs-apply"></a><a name="7.14"></a>
839839
- [7.14](#functions--spread-vs-apply) Prefer the use of the spread operator `...` to call variadic functions. eslint: [`prefer-spread`](http://eslint.org/docs/rules/prefer-spread)
840840

841-
> Why? It’s cleaner, you don't need to supply a context, and you can not easily compose `new` with `apply`.
841+
> Why? It’s cleaner, you dont need to supply a context, and you can not easily compose `new` with `apply`.
842842

843843
```javascript
844844
// bad
@@ -1354,7 +1354,7 @@ Other Style Guides
13541354
## Iterators and Generators
13551355

13561356
<a name="iterators--nope"></a><a name="11.1"></a>
1357-
- [11.1](#iterators--nope) Don't use iterators. Prefer JavaScript’s higher-order functions instead of loops like `for-in` or `for-of`. eslint: [`no-iterator`](http://eslint.org/docs/rules/no-iterator.html) [`no-restricted-syntax`](http://eslint.org/docs/rules/no-restricted-syntax)
1357+
- [11.1](#iterators--nope) Dont use iterators. Prefer JavaScript’s higher-order functions instead of loops like `for-in` or `for-of`. eslint: [`no-iterator`](http://eslint.org/docs/rules/no-iterator.html) [`no-restricted-syntax`](http://eslint.org/docs/rules/no-restricted-syntax)
13581358

13591359
> Why? This enforces our immutable rule. Dealing with pure functions that return values is easier to reason about than side effects.
13601360

@@ -1398,9 +1398,9 @@ Other Style Guides
13981398
```
13991399

14001400
<a name="generators--nope"></a><a name="11.2"></a>
1401-
- [11.2](#generators--nope) Don't use generators for now.
1401+
- [11.2](#generators--nope) Dont use generators for now.
14021402

1403-
> Why? They don't transpile well to ES5.
1403+
> Why? They dont transpile well to ES5.
14041404

14051405
<a name="generators--spacing"></a>
14061406
- [11.3](#generators--spacing) If you must use generators, or if you disregard [our advice](#generators--nope), make sure their function signature is spaced properly. eslint: [`generator-star-spacing`](http://eslint.org/docs/rules/generator-star-spacing)
@@ -1602,7 +1602,7 @@ Other Style Guides
16021602
}
16031603
```
16041604
<a name="variables--no-chain-assignment"></a><a name="13.5"></a>
1605-
- [13.5](#variables--no-chain-assignment) Don't chain variable assignments.
1605+
- [13.5](#variables--no-chain-assignment) Dont chain variable assignments.
16061606
16071607
> Why? Chaining variable assignments creates implicit global variables.
16081608
@@ -1676,7 +1676,7 @@ Other Style Guides
16761676
- [14.1](#hoisting--about) `var` declarations get hoisted to the top of their scope, their assignment does not. `const` and `let` declarations are blessed with a new concept called [Temporal Dead Zones (TDZ)](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/let#Temporal_dead_zone_and_errors_with_let). It’s important to know why [typeof is no longer safe](http://es-discourse.com/t/why-typeof-is-no-longer-safe/15).
16771677

16781678
```javascript
1679-
// we know this wouldn't work (assuming there
1679+
// we know this wouldnt work (assuming there
16801680
// is no notDefined global variable)
16811681
function example() {
16821682
console.log(notDefined); // => throws a ReferenceError
@@ -2147,7 +2147,7 @@ Other Style Guides
21472147
constructor() {
21482148
super();
21492149
2150-
// FIXME: shouldn't use a global here
2150+
// FIXME: shouldnt use a global here
21512151
total = 0;
21522152
}
21532153
}
@@ -2535,7 +2535,7 @@ Other Style Guides
25352535
<a name="commas--dangling"></a><a name="19.2"></a>
25362536
- [20.2](#commas--dangling) Additional trailing comma: **Yup.** eslint: [`comma-dangle`](http://eslint.org/docs/rules/comma-dangle.html) jscs: [`requireTrailingComma`](http://jscs.info/rule/requireTrailingComma)
25372537
2538-
> Why? This leads to cleaner git diffs. Also, transpilers like Babel will remove the additional trailing comma in the transpiled code which means you don't have to worry about the [trailing comma problem](https://github.com/airbnb/javascript/blob/es5-deprecated/es5/README.md#commas) in legacy browsers.
2538+
> Why? This leads to cleaner git diffs. Also, transpilers like Babel will remove the additional trailing comma in the transpiled code which means you dont have to worry about the [trailing comma problem](https://github.com/airbnb/javascript/blob/es5-deprecated/es5/README.md#commas) in legacy browsers.
25392539
25402540
```diff
25412541
// bad - git diff without trailing comma
@@ -2674,7 +2674,7 @@ Other Style Guides
26742674
const totalScore = this.reviewScore + ''; // invokes this.reviewScore.valueOf()
26752675

26762676
// bad
2677-
const totalScore = this.reviewScore.toString(); // isn't guaranteed to return a string
2677+
const totalScore = this.reviewScore.toString(); // isnt guaranteed to return a string
26782678

26792679
// good
26802680
const totalScore = String(this.reviewScore);
@@ -2804,7 +2804,7 @@ Other Style Guides
28042804
<a name="naming--leading-underscore"></a><a name="22.4"></a>
28052805
- [23.4](#naming--leading-underscore) Do not use trailing or leading underscores. eslint: [`no-underscore-dangle`](http://eslint.org/docs/rules/no-underscore-dangle.html) jscs: [`disallowDanglingUnderscores`](http://jscs.info/rule/disallowDanglingUnderscores)
28062806
2807-
> Why? JavaScript does not have the concept of privacy in terms of properties or methods. Although a leading underscore is a common convention to mean “private”, in fact, these properties are fully public, and as such, are part of your public API contract. This convention might lead developers to wrongly think that a change won't count as breaking, or that tests aren't needed. tl;dr: if you want something to be “private”, it must not be observably present.
2807+
> Why? JavaScript does not have the concept of privacy in terms of properties or methods. Although a leading underscore is a common convention to mean “private”, in fact, these properties are fully public, and as such, are part of your public API contract. This convention might lead developers to wrongly think that a change wont count as breaking, or that tests arent needed. tl;dr: if you want something to be “private”, it must not be observably present.
28082808
28092809
```javascript
28102810
// bad
@@ -2817,7 +2817,7 @@ Other Style Guides
28172817
```
28182818
28192819
<a name="naming--self-this"></a><a name="22.5"></a>
2820-
- [23.5](#naming--self-this) Don't save references to `this`. Use arrow functions or [Function#bind](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/bind). jscs: [`disallowNodeTypes`](http://jscs.info/rule/disallowNodeTypes)
2820+
- [23.5](#naming--self-this) Dont save references to `this`. Use arrow functions or [Function#bind](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/bind). jscs: [`disallowNodeTypes`](http://jscs.info/rule/disallowNodeTypes)
28212821
28222822
```javascript
28232823
// bad
@@ -3234,7 +3234,7 @@ Other Style Guides
32343234
- [Third Party JavaScript](https://www.manning.com/books/third-party-javascript) - Ben Vinegar and Anton Kovalyov
32353235
- [Effective JavaScript: 68 Specific Ways to Harness the Power of JavaScript](http://amzn.com/0321812182) - David Herman
32363236
- [Eloquent JavaScript](http://eloquentjavascript.net/) - Marijn Haverbeke
3237-
- [You Don't Know JS: ES6 & Beyond](http://shop.oreilly.com/product/0636920033769.do) - Kyle Simpson
3237+
- [You Dont Know JS: ES6 & Beyond](http://shop.oreilly.com/product/0636920033769.do) - Kyle Simpson
32383238
32393239
**Blogs**
32403240

0 commit comments

Comments
 (0)