From d9c6315988c7505f899a4e1abfb09fe93d162580 Mon Sep 17 00:00:00 2001 From: soobing Date: Sat, 22 Aug 2020 14:14:47 +0900 Subject: [PATCH] Docs: consistent example --- docs/rules/object-curly-newline.md | 34 +++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/docs/rules/object-curly-newline.md b/docs/rules/object-curly-newline.md index eabc03eacf4..d12a0b9f961 100644 --- a/docs/rules/object-curly-newline.md +++ b/docs/rules/object-curly-newline.md @@ -325,29 +325,43 @@ Examples of **incorrect** code for this rule with the default `{ "consistent": t /*eslint object-curly-newline: ["error", { "consistent": true }]*/ /*eslint-env es6*/ -let a = {foo: 1 +let a = { }; -let b = { +let b = {foo: 1 +}; +let c = { foo: 1}; -let c = {foo: 1, bar: 2 +let d = {foo: 1, bar: 2 }; -let d = { +let e = { foo: 1, bar: 2}; -let e = {foo: function() { +let f = {foo: function() { dosomething(); }}; +let g = { + foo: function() { + dosomething();}}; -let {f +let { +} = obj; +let { + h} = obj; +let {i, j } = obj; let { - g} = obj; -let {h, i + k, l} = obj; +let {m, n } = obj; let { - j, k} = obj; -let {l = function() { + o, p +} = obj; +let {q = function() { dosomething(); }} = obj; +let { + r = function() { + dosomething(); + }} = obj; ``` Examples of **correct** code for this rule with the default `{ "consistent": true }` option: