Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Docs: fix examples in object-curly-newline (#13605)
* Docs: consistent example

* docs: let a -> empty

* docs: add correct example

* docs: add function object  incorrect example

* docs: add object empty correct example

* docs: add destruct operation example

* style: tab -> space
  • Loading branch information
soobing committed Aug 27, 2020
1 parent 1c35d57 commit 483bf7f
Showing 1 changed file with 36 additions and 15 deletions.
51 changes: 36 additions & 15 deletions docs/rules/object-curly-newline.md
Expand Up @@ -335,19 +335,32 @@ let d = {
foo: 1, bar: 2};
let e = {foo: function() {
dosomething();
}};
}
};
let f = {
foo: function() {
dosomething();}};

let {f
let {g
} = obj;
let {
g} = obj;
let {h, i
h} = obj;
let {i, j
} = obj;
let {k, l
} = obj;
let {
m, n} = obj;
let {
j, k} = obj;
let {l = function() {
o, p} = obj;
let {q = function() {
dosomething();
}} = obj;
}
} = obj;
let {
r = function() {
dosomething();
}} = obj;
```

Examples of **correct** code for this rule with the default `{ "consistent": true }` option:
Expand All @@ -356,27 +369,35 @@ Examples of **correct** code for this rule with the default `{ "consistent": tru
/*eslint object-curly-newline: ["error", { "consistent": true }]*/
/*eslint-env es6*/

let a = {};
let b = {foo: 1};
let c = {

let empty1 = {};
let empty2 = {
};
let a = {foo: 1};
let b = {
foo: 1
};
let d = {
let c = {
foo: 1, bar: 2
};
let e = {
let d = {
foo: 1,
bar: 2
};
let f = {foo: function() {dosomething();}};
let g = {
let e = {foo: function() {dosomething();}};
let f = {
foo: function() {
dosomething();
}
};

let {} = obj;
let {h} = obj;
let {
} = obj;
let {g} = obj;
let {
h
} = obj;
let {i, j} = obj;
let {
k, l
Expand Down

0 comments on commit 483bf7f

Please sign in to comment.