From 4539dbcf17b960ab650665bc95421dc8d0d3276e Mon Sep 17 00:00:00 2001 From: Kevin Yue Date: Fri, 24 May 2019 16:29:24 +0800 Subject: [PATCH] [guide] remove redundant spaces --- README.md | 8 ++++---- react/README.md | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index b5df3946a2..57f90f0651 100644 --- a/README.md +++ b/README.md @@ -3073,7 +3073,7 @@ Other Style Guides - [22.1](#coercion--explicit) Perform type coercion at the beginning of the statement. - - [22.2](#coercion--strings) Strings: eslint: [`no-new-wrappers`](https://eslint.org/docs/rules/no-new-wrappers) + - [22.2](#coercion--strings) Strings: eslint: [`no-new-wrappers`](https://eslint.org/docs/rules/no-new-wrappers) ```javascript // => this.reviewScore = 9; @@ -3360,7 +3360,7 @@ Other Style Guides > Why? This is an additional tool to assist in situations where the programmer would be unsure if a variable might ever change. UPPERCASE_VARIABLES are letting the programmer know that they can trust the variable (and its properties) not to change. - What about all `const` variables? - This is unnecessary, so uppercasing should not be used for constants within a file. It should be used for exported constants however. - - What about exported objects? - Uppercase at the top level of export (e.g. `EXPORTED_OBJECT.key`) and maintain that all nested properties do not change. + - What about exported objects? - Uppercase at the top level of export (e.g. `EXPORTED_OBJECT.key`) and maintain that all nested properties do not change. ```javascript // bad @@ -3467,7 +3467,7 @@ Other Style Guides ## Events - - [25.1](#events--hash) When attaching data payloads to events (whether DOM events or something more proprietary like Backbone events), pass an object literal (also known as a "hash") instead of a raw value. This allows a subsequent contributor to add more data to the event payload without finding and updating every handler for the event. For example, instead of: + - [25.1](#events--hash) When attaching data payloads to events (whether DOM events or something more proprietary like Backbone events), pass an object literal (also known as a "hash") instead of a raw value. This allows a subsequent contributor to add more data to the event payload without finding and updating every handler for the event. For example, instead of: ```javascript // bad @@ -3721,7 +3721,7 @@ Other Style Guides - [JavaScript: The Good Parts](https://www.amazon.com/JavaScript-Good-Parts-Douglas-Crockford/dp/0596517742) - Douglas Crockford - [JavaScript Patterns](https://www.amazon.com/JavaScript-Patterns-Stoyan-Stefanov/dp/0596806752) - Stoyan Stefanov - - [Pro JavaScript Design Patterns](https://www.amazon.com/JavaScript-Design-Patterns-Recipes-Problem-Solution/dp/159059908X) - Ross Harmes and Dustin Diaz + - [Pro JavaScript Design Patterns](https://www.amazon.com/JavaScript-Design-Patterns-Recipes-Problem-Solution/dp/159059908X) - Ross Harmes and Dustin Diaz - [High Performance Web Sites: Essential Knowledge for Front-End Engineers](https://www.amazon.com/High-Performance-Web-Sites-Essential/dp/0596529309) - Steve Souders - [Maintainable JavaScript](https://www.amazon.com/Maintainable-JavaScript-Nicholas-C-Zakas/dp/1449327680) - Nicholas C. Zakas - [JavaScript Web Applications](https://www.amazon.com/JavaScript-Web-Applications-Alex-MacCaw/dp/144930351X) - Alex MacCaw diff --git a/react/README.md b/react/README.md index 4d2aa63fb3..87dbcb9996 100644 --- a/react/README.md +++ b/react/README.md @@ -447,13 +447,13 @@ We don’t recommend using indexes for keys if the order of items may change. ```jsx // bad render() { - const { irrelevantProp, ...relevantProps } = this.props; + const { irrelevantProp, ...relevantProps } = this.props; return } // good render() { - const { irrelevantProp, ...relevantProps } = this.props; + const { irrelevantProp, ...relevantProps } = this.props; return } ```