Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
docs: use inline code for rule options name (#16768)
  • Loading branch information
kecrily committed Jan 10, 2023
1 parent 3e34418 commit 78ecfe0
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions docs/src/rules/class-methods-use-this.md
Expand Up @@ -118,9 +118,9 @@ This rule has two options:
"class-methods-use-this": [<enabled>, { "exceptMethods": [<...exceptions>] }]
```

The `exceptMethods` option allows you to pass an array of method names for which you would like to ignore warnings. For example, you might have a spec from an external library that requires you to overwrite a method as a regular function (and not as a static method) and does not use `this` inside the function body. In this case, you can add that method to ignore in the warnings.
The `"exceptMethods"` option allows you to pass an array of method names for which you would like to ignore warnings. For example, you might have a spec from an external library that requires you to overwrite a method as a regular function (and not as a static method) and does not use `this` inside the function body. In this case, you can add that method to ignore in the warnings.

Examples of **incorrect** code for this rule when used without exceptMethods:
Examples of **incorrect** code for this rule when used without `"exceptMethods"`:

::: incorrect

Expand Down
2 changes: 1 addition & 1 deletion docs/src/rules/eqeqeq.md
Expand Up @@ -139,7 +139,7 @@ foo == null

### allow-null

**Deprecated:** Instead of using this option use "always" and pass a "null" option property with value "ignore". This will tell ESLint to always enforce strict equality except when comparing with the `null` literal.
**Deprecated:** Instead of using this option use `"always"` and pass a `"null"` option property with value `"ignore"`. This will tell ESLint to always enforce strict equality except when comparing with the `null` literal.

```js
["error", "always", {"null": "ignore"}]
Expand Down
2 changes: 1 addition & 1 deletion docs/src/rules/func-name-matching.md
Expand Up @@ -145,7 +145,7 @@ module['exports'] = function foo(name) {};

## Options

This rule takes an optional string of "always" or "never" (when omitted, it defaults to "always"), and an optional options object with two properties `considerPropertyDescriptor` and `includeCommonJSModuleExports`.
This rule takes an optional string of `"always"` or `"never"` (when omitted, it defaults to `"always"`), and an optional options object with two properties `considerPropertyDescriptor` and `includeCommonJSModuleExports`.

### considerPropertyDescriptor

Expand Down
12 changes: 6 additions & 6 deletions docs/src/rules/generator-star-spacing.md
Expand Up @@ -51,14 +51,14 @@ This rule aims to enforce spacing around the `*` of generator functions.

## Options

The rule takes one option, an object, which has two keys `before` and `after` having boolean values `true` or `false`.
The rule takes one option, an object, which has two keys `"before"` and `"after"` having boolean values `true` or `false`.

* `before` enforces spacing between the `*` and the `function` keyword.
* `"before"` enforces spacing between the `*` and the `function` keyword.
If it is `true`, a space is required, otherwise spaces are disallowed.

In object literal shorthand methods, spacing before the `*` is not checked, as they lack a `function` keyword.

* `after` enforces spacing between the `*` and the function name (or the opening parenthesis for anonymous generator functions).
* `"after"` enforces spacing between the `*` and the function name (or the opening parenthesis for anonymous generator functions).
If it is `true`, a space is required, otherwise spaces are disallowed.

The default is `{"before": true, "after": false}`.
Expand Down Expand Up @@ -99,9 +99,9 @@ An example of a configuration with overrides:
}]
```

In the example configuration above, the top level "before" and "after" options define the default behavior of
the rule, while the "anonymous" and "method" options override the default behavior.
Overrides can be either an object with "before" and "after", or a shorthand string as above.
In the example configuration above, the top level `"before"` and `"after"` options define the default behavior of
the rule, while the `"anonymous"` and `"method"` options override the default behavior.
Overrides can be either an object with `"before"` and `"after"`, or a shorthand string as above.

## Examples

Expand Down

0 comments on commit 78ecfe0

Please sign in to comment.