Skip to content

Commit 5443d03

Browse files
kevinweberljharb
authored andcommitted
[guide] Consistently use curly quotes instead of straight quotes in prose
1 parent fcfd378 commit 5443d03

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ Other Style Guides
8181
console.log(foo, bar); // => 1, 9
8282
```
8383

84-
- Symbols cannot be faithfully polyfilled, so they should not be used when targeting browsers/environments that don't support them natively.
84+
- Symbols cannot be faithfully polyfilled, so they should not be used when targeting browsers/environments that dont support them natively.
8585

8686
<a name="types--complex"></a><a name="1.2"></a>
8787
- [1.2](#types--complex) **Complex**: When you access a complex type you work on a reference to its value.
@@ -650,7 +650,7 @@ Other Style Guides
650650
<a name="functions--declarations"></a><a name="7.1"></a>
651651
- [7.1](#functions--declarations) Use named function expressions instead of function declarations. eslint: [`func-style`](https://eslint.org/docs/rules/func-style)
652652
653-
> Why? Function declarations are hoisted, which means that it’s easy - too easy - to reference the function before it is defined in the file. This harms readability and maintainability. If you find that a function’s definition is large or complex enough that it is interfering with understanding the rest of the file, then perhaps it’s time to extract it to its own module! Don’t forget to explicitly name the expression, regardless of whether or not the name is inferred from the containing variable (which is often the case in modern browsers or when using compilers such as Babel). This eliminates any assumptions made about the Error's call stack. ([Discussion](https://github.com/airbnb/javascript/issues/794))
653+
> Why? Function declarations are hoisted, which means that it’s easy - too easy - to reference the function before it is defined in the file. This harms readability and maintainability. If you find that a function’s definition is large or complex enough that it is interfering with understanding the rest of the file, then perhaps it’s time to extract it to its own module! Don’t forget to explicitly name the expression, regardless of whether or not the name is inferred from the containing variable (which is often the case in modern browsers or when using compilers such as Babel). This eliminates any assumptions made about the Errors call stack. ([Discussion](https://github.com/airbnb/javascript/issues/794))
654654
655655
```javascript
656656
// bad
@@ -2105,7 +2105,7 @@ Other Style Guides
21052105
```
21062106

21072107
<a name="blocks--cuddled-elses"></a><a name="16.2"></a>
2108-
- [16.2](#blocks--cuddled-elses) If you're using multi-line blocks with `if` and `else`, put `else` on the same line as your `if` block’s closing brace. eslint: [`brace-style`](https://eslint.org/docs/rules/brace-style.html)
2108+
- [16.2](#blocks--cuddled-elses) If youre using multi-line blocks with `if` and `else`, put `else` on the same line as your `if` block’s closing brace. eslint: [`brace-style`](https://eslint.org/docs/rules/brace-style.html)
21092109

21102110
```javascript
21112111
// bad
@@ -2373,7 +2373,7 @@ Other Style Guides
23732373
```
23742374
23752375
<a name="comments--actionitems"></a><a name="17.3"></a>
2376-
- [18.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`.
2376+
- [18.4](#comments--actionitems) Prefixing your comments with `FIXME` or `TODO` helps other developers quickly understand if youre pointing out a problem that needs to be revisited, or if youre 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`.
23772377
23782378
<a name="comments--fixme"></a><a name="17.4"></a>
23792379
- [18.5](#comments--fixme) Use `// FIXME:` to annotate problems.
@@ -2979,7 +2979,7 @@ Other Style Guides
29792979
[luke, leia].forEach(jedi => jedi.father = 'vader')
29802980

29812981
// bad - raises exception
2982-
const reaction = "No! That's impossible!"
2982+
const reaction = "No! Thats impossible!"
29832983
(async function meanwhileOnTheFalcon() {
29842984
// handle `leia`, `lando`, `chewie`, `r2`, `c3p0`
29852985
// ...
@@ -2999,7 +2999,7 @@ Other Style Guides
29992999
});
30003000

30013001
// good
3002-
const reaction = "No! That's impossible!";
3002+
const reaction = "No! Thats impossible!";
30033003
(async function meanwhileOnTheFalcon() {
30043004
// handle `leia`, `lando`, `chewie`, `r2`, `c3p0`
30053005
// ...
@@ -3065,7 +3065,7 @@ Other Style Guides
30653065
```
30663066
30673067
<a name="coercion--comment-deviations"></a><a name="21.4"></a>
3068-
- [22.4](#coercion--comment-deviations) If for whatever reason you are doing something wild and `parseInt` is your bottleneck and need to use Bitshift for [performance reasons](https://jsperf.com/coercion-vs-casting/3), leave a comment explaining why and what you're doing.
3068+
- [22.4](#coercion--comment-deviations) If for whatever reason you are doing something wild and `parseInt` is your bottleneck and need to use Bitshift for [performance reasons](https://jsperf.com/coercion-vs-casting/3), leave a comment explaining why and what youre doing.
30693069
30703070
```javascript
30713071
// good
@@ -3781,7 +3781,7 @@ Other Style Guides
37813781
- **React**: [facebook.github.io/react/contributing/how-to-contribute.html#style-guide](https://facebook.github.io/react/contributing/how-to-contribute.html#style-guide)
37823782
- **REI**: [reidev/js-style-guide](https://github.com/rei/code-style-guides/)
37833783
- **Ripple**: [ripple/javascript-style-guide](https://github.com/ripple/javascript-style-guide)
3784-
- **Sainsbury's Supermarkets**: [jsainsburyplc](https://github.com/jsainsburyplc)
3784+
- **Sainsburys Supermarkets**: [jsainsburyplc](https://github.com/jsainsburyplc)
37853785
- **SeekingAlpha**: [seekingalpha/javascript-style-guide](https://github.com/seekingalpha/javascript-style-guide)
37863786
- **Shutterfly**: [shutterfly/javascript](https://github.com/shutterfly/javascript)
37873787
- **Sourcetoad**: [sourcetoad/javascript](https://github.com/sourcetoad/javascript)

react/README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ This style guide is mostly based on the standards that are currently prevalent i
2727
- Only include one React component per file.
2828
- However, multiple [Stateless, or Pure, Components](https://facebook.github.io/react/docs/reusable-components.html#stateless-functions) are allowed per file. eslint: [`react/no-multi-comp`](https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-multi-comp.md#ignorestateless).
2929
- Always use JSX syntax.
30-
- Do not use `React.createElement` unless you're initializing the app from a file that is not JSX.
30+
- Do not use `React.createElement` unless youre initializing the app from a file that is not JSX.
3131

3232
## Class vs `React.createClass` vs stateless
3333

@@ -51,7 +51,7 @@ This style guide is mostly based on the standards that are currently prevalent i
5151
}
5252
```
5353

54-
And if you don't have state or refs, prefer normal functions (not arrow functions) over classes:
54+
And if you dont have state or refs, prefer normal functions (not arrow functions) over classes:
5555

5656
```jsx
5757
// bad
@@ -110,9 +110,9 @@ This style guide is mostly based on the standards that are currently prevalent i
110110
// good
111111
import Footer from './Footer';
112112
```
113-
- **Higher-order Component Naming**: Use a composite of the higher-order component's name and the passed-in component's name as the `displayName` on the generated component. For example, the higher-order component `withFoo()`, when passed a component `Bar` should produce a component with a `displayName` of `withFoo(Bar)`.
113+
- **Higher-order Component Naming**: Use a composite of the higher-order components name and the passed-in components name as the `displayName` on the generated component. For example, the higher-order component `withFoo()`, when passed a component `Bar` should produce a component with a `displayName` of `withFoo(Bar)`.
114114

115-
> Why? A component's `displayName` may be used by developer tools or in error messages, and having a value that clearly expresses this relationship helps people understand what is happening.
115+
> Why? A components `displayName` may be used by developer tools or in error messages, and having a value that clearly expresses this relationship helps people understand what is happening.
116116

117117
```jsx
118118
// bad
@@ -402,7 +402,7 @@ This style guide is mostly based on the standards that are currently prevalent i
402402
```
403403

404404
- Use spread props sparingly.
405-
> Why? Otherwise you're more likely to pass unnecessary props down to components. And for React v15.6.1 and older, you could [pass invalid HTML attributes to the DOM](https://reactjs.org/blog/2017/09/08/dom-attributes-in-react-16.html).
405+
> Why? Otherwise youre more likely to pass unnecessary props down to components. And for React v15.6.1 and older, you could [pass invalid HTML attributes to the DOM](https://reactjs.org/blog/2017/09/08/dom-attributes-in-react-16.html).
406406

407407
Exceptions:
408408

@@ -423,7 +423,7 @@ This style guide is mostly based on the standards that are currently prevalent i
423423
}
424424
```
425425

426-
- Spreading objects with known, explicit props. This can be particularly useful when testing React components with Mocha's beforeEach construct.
426+
- Spreading objects with known, explicit props. This can be particularly useful when testing React components with Mochas beforeEach construct.
427427

428428
```jsx
429429
export default function Foo {

0 commit comments

Comments
 (0)