diff --git a/docs/rules/no-multi-assign.md b/docs/rules/no-multi-assign.md index 7ef70567593..14721dab0d8 100644 --- a/docs/rules/no-multi-assign.md +++ b/docs/rules/no-multi-assign.md @@ -26,12 +26,19 @@ const foo = bar = "baz"; let a = b = c; + +class Foo { + a = b = 10; +} + +a = b = "quux"; ``` Examples of **correct** code for this rule: ```js /*eslint no-multi-assign: "error"*/ + var a = 5; var b = 5; var c = 5; @@ -41,13 +48,21 @@ const bar = "baz"; let a = c; let b = c; + +class Foo { + a = 10; + b = 10; +} + +a = "quux"; +b = "quux"; ``` ## Options This rule has an object option: -* `"ignoreNonDeclaration"`: When set to `true`, the rule allows chains that don't include initializing a variable in a declaration. Default is `false`. +* `"ignoreNonDeclaration"`: When set to `true`, the rule allows chains that don't include initializing a variable in a declaration or initializing a class field. Default is `false`. ### ignoreNonDeclaration @@ -73,6 +88,10 @@ Examples of **incorrect** code for the `{ "ignoreNonDeclaration": true }` option let a = b = "baz"; const foo = bar = 1; + +class Foo { + a = b = 10; +} ``` ## Related Rules