Skip to content

Commit

Permalink
Docs: some typos and optimization points (#11960)
Browse files Browse the repository at this point in the history
  • Loading branch information
molee1905 authored and aladdin-add committed Jul 14, 2019
1 parent 2a10856 commit 4448261
Show file tree
Hide file tree
Showing 13 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion docs/rules/array-element-newline.md
Expand Up @@ -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"]*/
Expand Down
4 changes: 2 additions & 2 deletions docs/rules/func-names.md
Expand Up @@ -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"]*/
Expand All @@ -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"]*/
Expand Down
2 changes: 1 addition & 1 deletion docs/rules/function-paren-newline.md
Expand Up @@ -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"] */
Expand Down
2 changes: 1 addition & 1 deletion 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.

Expand Down
4 changes: 2 additions & 2 deletions docs/rules/no-return-await.md
Expand Up @@ -6,15 +6,15 @@ 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() {
return await bar();
}
```

The following patterns are not warnings:
Examples of **correct** code for this rule:

```js
async function foo() {
Expand Down
2 changes: 1 addition & 1 deletion docs/rules/no-self-assign.md
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion docs/rules/no-template-curly-in-string.md
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/no-underscore-dangle.md
Expand Up @@ -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 }]*/
Expand Down
4 changes: 2 additions & 2 deletions docs/rules/semi-style.md
Expand Up @@ -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:

Expand Down
6 changes: 3 additions & 3 deletions docs/rules/space-before-blocks.md
Expand Up @@ -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"*/
Expand All @@ -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"]*/
Expand All @@ -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"]*/
Expand Down
8 changes: 4 additions & 4 deletions docs/rules/switch-colon-spacing.md
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion docs/rules/template-tag-spacing.md
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion docs/user-guide/configuring.md
Expand Up @@ -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

Expand Down

0 comments on commit 4448261

Please sign in to comment.