Skip to content

Commit

Permalink
Docs: Add options to func-names config comments (#6748)
Browse files Browse the repository at this point in the history
  • Loading branch information
btmills authored and alberto committed Jul 26, 2016
1 parent 2f94443 commit 2983c32
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions docs/rules/func-names.md
Expand Up @@ -19,11 +19,12 @@ This rule has a string option:
* `"always"` (default) requires function expressions to have a name
* `"never"` disallows named function expressions, except in recursive functions, where a name is needed

### always

Examples of **incorrect** code for this rule with the default `"always"` option:

```js
/*eslint func-names: "error"*/
/*eslint func-names: ["error", "always"]*/

Foo.prototype.bar = function() {};

Expand All @@ -35,7 +36,7 @@ Foo.prototype.bar = function() {};
Examples of **correct** code for this rule with the default `"always"` option:

```js
/*eslint func-names: "error"*/
/*eslint func-names: ["error", "always"]*/

Foo.prototype.bar = function bar() {};

Expand All @@ -44,10 +45,12 @@ Foo.prototype.bar = function bar() {};
}())
```

### never

Examples of **incorrect** code for this rule with the `"never"` option:

```js
/*eslint func-names: "error"*/
/*eslint func-names: ["error", "never"]*/

Foo.prototype.bar = function bar() {};

Expand All @@ -59,7 +62,7 @@ Foo.prototype.bar = function bar() {};
Examples of **correct** code for this rule with the `"never"` option:

```js
/*eslint func-names: "error"*/
/*eslint func-names: ["error", "never"]*/

Foo.prototype.bar = function() {};

Expand Down

0 comments on commit 2983c32

Please sign in to comment.