diff --git a/docs/rules/func-names.md b/docs/rules/func-names.md index 27b9cc20fcf..ea1ba617e54 100644 --- a/docs/rules/func-names.md +++ b/docs/rules/func-names.md @@ -17,14 +17,14 @@ This rule can enforce or disallow the use of named function expressions. This rule has a string option: * `"always"` (default) requires function expressions to have a name -* `"as-needed"` requires function expressions to have a name, if the name cannot be assigned automatically in an ES6 environment +* `"as-needed"` requires function expressions to have a name, if the name isn't assigned automatically per the ECMAScript specification. * `"never"` disallows named function expressions, except in recursive functions, where a name is needed This rule has an object option: * `"generators": "always" | "as-needed" | "never"` * `"always"` require named generators - * `"as-needed"` require named generators if the name cannot be assigned automatically in an ES6 environment. + * `"as-needed"` require named generators if the name isn't assigned automatically per the ECMAScript specification. * `"never"` disallow named generators where possible. When a value for `generators` is not provided the behavior for generator functions falls back to the base option. @@ -98,6 +98,13 @@ const cat = { meow: function() {} } +class C { + #bar = function() {}; + baz = function() {}; +} + +quux ??= function() {}; + (function bar() { // ... }())