@@ -45,7 +45,7 @@ Examples of **correct** code for this rule with the `"always"` option:
4545let foo = () => {
4646 return 0 ;
4747};
48- let foo = (retv , name ) => {
48+ let bar = (retv , name ) => {
4949 retv[name] = true ;
5050 return retv;
5151};
@@ -66,7 +66,7 @@ Examples of **incorrect** code for this rule with the default `"as-needed"` opti
6666let foo = () => {
6767 return 0 ;
6868};
69- let foo = () => {
69+ let bar = () => {
7070 return {
7171 bar: {
7272 foo: 1 ,
@@ -86,24 +86,24 @@ Examples of **correct** code for this rule with the default `"as-needed"` option
8686/* eslint arrow-body-style: ["error", "as-needed"]*/
8787/* eslint-env es6*/
8888
89- let foo = () => 0 ;
90- let foo = (retv , name ) => {
89+ let foo1 = () => 0 ;
90+ let foo2 = (retv , name ) => {
9191 retv[name] = true ;
9292 return retv;
9393};
94- let foo = () => ({
94+ let foo3 = () => ({
9595 bar: {
9696 foo: 1 ,
9797 bar: 2 ,
9898 }
9999});
100- let foo = () => { bar (); };
101- let foo = () => {};
102- let foo = () => { /* do nothing */ };
103- let foo = () => {
100+ let foo4 = () => { bar (); };
101+ let foo5 = () => {};
102+ let foo6 = () => { /* do nothing */ };
103+ let foo7 = () => {
104104 // do nothing.
105105};
106- let foo = () => ({ bar: 0 });
106+ let foo8 = () => ({ bar: 0 });
107107```
108108
109109:::
@@ -120,7 +120,7 @@ Examples of **incorrect** code for this rule with the `{ "requireReturnForObject
120120/* eslint arrow-body-style: ["error", "as-needed", { "requireReturnForObjectLiteral": true }]*/
121121/* eslint-env es6*/
122122let foo = () => ({});
123- let foo = () => ({ bar: 0 });
123+ let bar = () => ({ bar: 0 });
124124```
125125
126126:::
@@ -134,7 +134,7 @@ Examples of **correct** code for this rule with the `{ "requireReturnForObjectLi
134134/* eslint-env es6*/
135135
136136let foo = () => {};
137- let foo = () => { return { bar: 0 }; };
137+ let bar = () => { return { bar: 0 }; };
138138```
139139
140140:::
@@ -152,7 +152,7 @@ Examples of **incorrect** code for this rule with the `"never"` option:
152152let foo = () => {
153153 return 0 ;
154154};
155- let foo = (retv , name ) => {
155+ let bar = (retv , name ) => {
156156 retv[name] = true ;
157157 return retv;
158158};
@@ -169,7 +169,7 @@ Examples of **correct** code for this rule with the `"never"` option:
169169/* eslint-env es6*/
170170
171171let foo = () => 0 ;
172- let foo = () => ({ foo: 0 });
172+ let bar = () => ({ foo: 0 });
173173```
174174
175175:::
0 commit comments