This repository has been archived by the owner on Mar 25, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 889
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added fixer for newline-before-return rule (#4482)
- Loading branch information
Showing
6 changed files
with
192 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,126 @@ | ||
function foo(bar) { | ||
if (!bar) { | ||
return; | ||
} | ||
|
||
return bar; | ||
} | ||
|
||
function foo(bar) { | ||
if (!bar) { | ||
var statement = ''; | ||
|
||
return statement; | ||
} | ||
|
||
return bar; | ||
} | ||
|
||
function foo(bar) { | ||
if (!bar) { | ||
return; | ||
} | ||
|
||
/* multi-line | ||
comment */ | ||
return bar; | ||
} | ||
|
||
var fn = () => null; | ||
function foo() { | ||
fn(); | ||
|
||
return; | ||
} | ||
|
||
function foo(fn) { | ||
fn(); | ||
|
||
return; | ||
} | ||
|
||
function foo(fn) { | ||
fn(); | ||
|
||
return; | ||
} | ||
|
||
function foo(fn) { | ||
fn(); | ||
|
||
return; | ||
} | ||
|
||
function foo() { | ||
return; | ||
} | ||
|
||
function foo() { | ||
|
||
return; | ||
} | ||
|
||
function foo(bar) { | ||
if (!bar) return; | ||
} | ||
|
||
function foo(bar) { | ||
let someCall; | ||
if (!bar) return; | ||
} | ||
|
||
function foo(bar) { | ||
if (!bar) { return }; | ||
} | ||
|
||
function foo(bar) { | ||
if (!bar) { | ||
return; | ||
} | ||
} | ||
|
||
function foo(bar) { | ||
if (!bar) { | ||
return; | ||
} | ||
|
||
return bar; | ||
} | ||
|
||
function foo(bar) { | ||
if (!bar) { | ||
|
||
return; | ||
} | ||
} | ||
|
||
function foo() { | ||
|
||
// comment | ||
return; | ||
} | ||
|
||
function test() { | ||
console.log("Any statement"); | ||
// Any comment | ||
|
||
return; | ||
} | ||
|
||
function foo() { | ||
fn(); | ||
// comment | ||
|
||
// comment | ||
return; | ||
} | ||
|
||
function bar() { | ||
"some statement"; | ||
|
||
//comment | ||
//comment | ||
//comment | ||
return; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import * as React from 'react'; | ||
|
||
<div>{ [].map((child: any) => { | ||
let i = 0; | ||
|
||
return <span />; | ||
}) }</div> | ||
|
||
<div>{ [].map((child: any) => { | ||
return <span />; | ||
}) }</div> | ||
|
||
<div>{ [].map((child: any) => | ||
<span />; | ||
) }</div> | ||
|
||
|