From 4448261f5d217d8a06eb0ef898401928b54a34e3 Mon Sep 17 00:00:00 2001 From: Jason Lee Date: Sun, 14 Jul 2019 18:17:41 +0800 Subject: [PATCH] Docs: some typos and optimization points (#11960) --- docs/rules/array-element-newline.md | 2 +- docs/rules/func-names.md | 4 ++-- docs/rules/function-paren-newline.md | 2 +- docs/rules/new-parens.md | 2 +- docs/rules/no-return-await.md | 4 ++-- docs/rules/no-self-assign.md | 2 +- docs/rules/no-template-curly-in-string.md | 2 +- docs/rules/no-underscore-dangle.md | 2 +- docs/rules/semi-style.md | 4 ++-- docs/rules/space-before-blocks.md | 6 +++--- docs/rules/switch-colon-spacing.md | 8 ++++---- docs/rules/template-tag-spacing.md | 2 +- docs/user-guide/configuring.md | 2 +- 13 files changed, 21 insertions(+), 21 deletions(-) diff --git a/docs/rules/array-element-newline.md b/docs/rules/array-element-newline.md index f26c92a827f..f67661f60a6 100644 --- a/docs/rules/array-element-newline.md +++ b/docs/rules/array-element-newline.md @@ -61,7 +61,7 @@ var e = [ ### never -Examples of **incorrect** code for this rule with the default `"never"` option: +Examples of **incorrect** code for this rule with the `"never"` option: ```js /*eslint array-element-newline: ["error", "never"]*/ diff --git a/docs/rules/func-names.md b/docs/rules/func-names.md index 60a0910e555..cd699400698 100644 --- a/docs/rules/func-names.md +++ b/docs/rules/func-names.md @@ -59,7 +59,7 @@ Foo.prototype.bar = function bar() {}; ECMAScript 6 introduced a `name` property on all functions. The value of `name` is determined by evaluating the code around the function to see if a name can be inferred. For example, a function assigned to a variable will automatically have a `name` property equal to the name of the variable. The value of `name` is then used in stack traces for easier debugging. -Examples of **incorrect** code for this rule with the default `"as-needed"` option: +Examples of **incorrect** code for this rule with the `"as-needed"` option: ```js /*eslint func-names: ["error", "as-needed"]*/ @@ -71,7 +71,7 @@ Foo.prototype.bar = function() {}; }()) ``` -Examples of **correct** code for this rule with the default `"as-needed"` option: +Examples of **correct** code for this rule with the `"as-needed"` option: ```js /*eslint func-names: ["error", "as-needed"]*/ diff --git a/docs/rules/function-paren-newline.md b/docs/rules/function-paren-newline.md index 099021e0ef2..ab86680ddff 100644 --- a/docs/rules/function-paren-newline.md +++ b/docs/rules/function-paren-newline.md @@ -200,7 +200,7 @@ foo( }); ``` -Examples of **correct** code for this rule with the consistent `"consistent"` option: +Examples of **correct** code for this rule with the `"consistent"` option: ```js /* eslint function-paren-newline: ["error", "consistent"] */ diff --git a/docs/rules/new-parens.md b/docs/rules/new-parens.md index 1640d37a2e4..0b2a49b7e76 100644 --- a/docs/rules/new-parens.md +++ b/docs/rules/new-parens.md @@ -1,4 +1,4 @@ -# Require parentheses when invoking a constructor with no arguments (new-parens) +# require parentheses when invoking a constructor with no arguments (new-parens) JavaScript allows the omission of parentheses when invoking a function via the `new` keyword and the constructor has no arguments. However, some coders believe that omitting the parentheses is inconsistent with the rest of the language and thus makes code less clear. diff --git a/docs/rules/no-return-await.md b/docs/rules/no-return-await.md index c30fc60a692..02ba9af02a9 100644 --- a/docs/rules/no-return-await.md +++ b/docs/rules/no-return-await.md @@ -6,7 +6,7 @@ Inside an `async function`, `return await` is seldom useful. Since the return va This rule aims to prevent a likely common performance hazard due to a lack of understanding of the semantics of `async function`. -The following patterns are considered warnings: +Examples of **incorrect** code for this rule: ```js async function foo() { @@ -14,7 +14,7 @@ async function foo() { } ``` -The following patterns are not warnings: +Examples of **correct** code for this rule: ```js async function foo() { diff --git a/docs/rules/no-self-assign.md b/docs/rules/no-self-assign.md index b80df6afcf5..2991504e838 100644 --- a/docs/rules/no-self-assign.md +++ b/docs/rules/no-self-assign.md @@ -72,7 +72,7 @@ This rule has the option to check properties as well. Examples of **correct** code with the `{ "props": false }` option: ```js -/*eslint no-self-assign: ["error", {"props": true}]*/ +/*eslint no-self-assign: ["error", {"props": false}]*/ // self-assignments with properties. obj.a = obj.a; diff --git a/docs/rules/no-template-curly-in-string.md b/docs/rules/no-template-curly-in-string.md index 52c10df2e57..9c03b67a612 100644 --- a/docs/rules/no-template-curly-in-string.md +++ b/docs/rules/no-template-curly-in-string.md @@ -5,7 +5,7 @@ ECMAScript 6 allows programmers to create strings containing variable or express ## Rule Details -This rule aims to warn when a regular string contains what looks like a template literal placeholder. It will warn when it finds a string containing the template literal place holder (`${something}`) that uses either `"` or `'` for the quotes. +This rule aims to warn when a regular string contains what looks like a template literal placeholder. It will warn when it finds a string containing the template literal placeholder (`${something}`) that uses either `"` or `'` for the quotes. ## Examples diff --git a/docs/rules/no-underscore-dangle.md b/docs/rules/no-underscore-dangle.md index 7383815b3fd..e112c7a1b30 100644 --- a/docs/rules/no-underscore-dangle.md +++ b/docs/rules/no-underscore-dangle.md @@ -79,7 +79,7 @@ super._bar(); ### enforceInMethodNames -Examples of incorrect code for this rule with the `{ "enforceInMethodNames": true }` option: +Examples of **incorrect** code for this rule with the `{ "enforceInMethodNames": true }` option: ```js /*eslint no-underscore-dangle: ["error", { "enforceInMethodNames": true }]*/ diff --git a/docs/rules/semi-style.md b/docs/rules/semi-style.md index f8aa8fcde30..7bd916f9d68 100644 --- a/docs/rules/semi-style.md +++ b/docs/rules/semi-style.md @@ -14,8 +14,8 @@ This rule has an option. } ``` -- `"last"` (Default) ... enforces that semicolons are at the end of statements. -- `"first"` ... enforces that semicolons are at the beginning of statements. Semicolons of `for` loop heads (`for(a;b;c){}`) should be at the end of lines even if you use this option. +- `"last"` (Default) enforces that semicolons are at the end of statements. +- `"first"` enforces that semicolons are at the beginning of statements. Semicolons of `for` loop heads (`for(a;b;c){}`) should be at the end of lines even if you use this option. Examples of **incorrect** code for this rule with `"last"` option: diff --git a/docs/rules/space-before-blocks.md b/docs/rules/space-before-blocks.md index 0b188f2608b..25b81cae222 100644 --- a/docs/rules/space-before-blocks.md +++ b/docs/rules/space-before-blocks.md @@ -47,7 +47,7 @@ class Foo{ } ``` -Examples of **correct** code for this rule with the "always" option: +Examples of **correct** code for this rule with the `"always"` option: ```js /*eslint space-before-blocks: "error"*/ @@ -74,7 +74,7 @@ try {} catch(a) {} ### "never" -Examples of **incorrect** code for this rule with the "never" option: +Examples of **incorrect** code for this rule with the `"never"` option: ```js /*eslint space-before-blocks: ["error", "never"]*/ @@ -92,7 +92,7 @@ for (;;) { try {} catch(a) {} ``` -Examples of **correct** code for this rule with the "never" option: +Examples of **correct** code for this rule with the `"never"` option: ```js /*eslint space-before-blocks: ["error", "never"]*/ diff --git a/docs/rules/switch-colon-spacing.md b/docs/rules/switch-colon-spacing.md index baf081e4cb4..bd469ea7791 100644 --- a/docs/rules/switch-colon-spacing.md +++ b/docs/rules/switch-colon-spacing.md @@ -15,10 +15,10 @@ This rule has 2 options that are boolean value. } ``` -- `"after": true` (Default) ... requires one or more spaces after colons. -- `"after": false` ... disallows spaces after colons. -- `"before": true` ... requires one or more spaces before colons. -- `"before": false` (Default) ... disallows before colons. +- `"after": true` (Default) requires one or more spaces after colons. +- `"after": false` disallows spaces after colons. +- `"before": true` requires one or more spaces before colons. +- `"before": false` (Default) disallows before colons. Examples of **incorrect** code for this rule: diff --git a/docs/rules/template-tag-spacing.md b/docs/rules/template-tag-spacing.md index 004624a9f6b..58cd166f54d 100644 --- a/docs/rules/template-tag-spacing.md +++ b/docs/rules/template-tag-spacing.md @@ -21,7 +21,7 @@ This rule aims to maintain consistency around the spacing between template tag f } ``` -This rule has one option whose value can be set to "never" or "always" +This rule has one option whose value can be set to `"never"` or `"always"` * `"never"` (default) - Disallows spaces between a tag function and its template literal. * `"always"` - Requires one or more spaces between a tag function and its template literal. diff --git a/docs/user-guide/configuring.md b/docs/user-guide/configuring.md index 86e60b17636..6132c46bf30 100644 --- a/docs/user-guide/configuring.md +++ b/docs/user-guide/configuring.md @@ -661,7 +661,7 @@ The complete configuration hierarchy, from highest precedence to lowest preceden 1. Project-level configuration: 1. `.eslintrc.*` or `package.json` file in same directory as linted file 1. Continue searching for `.eslintrc` and `package.json` files in ancestor directories (parent has highest precedence, then grandparent, etc.), up to and including the root directory or until a config with `"root": true` is found. -1. In the absence of any configuration from (1) through (3), fall back to a personal default configuration in `~/.eslintrc`. +1. In the absence of any configuration from (1) through (3), fall back to a personal default configuration in `~/.eslintrc`. ## Extending Configuration Files