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 885
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add skip-blank-lines option to no-trailing-whitespace (#3346)
- Loading branch information
1 parent
aa35097
commit c1b842a
Showing
4 changed files
with
93 additions
and
3 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
34 changes: 34 additions & 0 deletions
34
test/rules/no-trailing-whitespace/skip-blank-lines/test.ts.fix
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,34 @@ | ||
class Clazz { | ||
public funcxion() { | ||
console.log("test") ; | ||
} | ||
|
||
|
||
private foobar() { | ||
} | ||
} | ||
const template = ` | ||
I have trailing whitespace | ||
`; | ||
// single line comment without trailing whitespace | ||
// single line comment with trailing whitespace | ||
/* single line multiline comment */ | ||
/* whitespace after comment */ | ||
/* first line has trailing whitespace | ||
second line is ok | ||
last line is not checked */ | ||
/* | ||
*/ | ||
|
||
/** | ||
* JSDoc comment with trailing whitespace | ||
* | ||
*/ | ||
|
||
/*** | ||
* not a JSDoc comment | ||
* | ||
*/ | ||
|
||
// following line checks for trailing whitespace before EOF | ||
|
46 changes: 46 additions & 0 deletions
46
test/rules/no-trailing-whitespace/skip-blank-lines/test.ts.lint
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,46 @@ | ||
class Clazz { | ||
public funcxion() { | ||
~~~~ [trailing whitespace] | ||
console.log("test") ; | ||
~~~~ [trailing whitespace] | ||
} | ||
|
||
|
||
private foobar() { | ||
} | ||
} | ||
~~~~ [trailing whitespace] | ||
const template = ` | ||
~ [trailing whitespace] | ||
I have trailing whitespace | ||
~~ [trailing whitespace] | ||
`; | ||
// single line comment without trailing whitespace | ||
// single line comment with trailing whitespace | ||
~~~ [trailing whitespace] | ||
/* single line multiline comment */ | ||
/* whitespace after comment */ | ||
~ [trailing whitespace] | ||
/* first line has trailing whitespace | ||
~~ [trailing whitespace] | ||
second line is ok | ||
last line is not checked */ | ||
/* | ||
*/ | ||
|
||
/** | ||
* JSDoc comment with trailing whitespace | ||
~ [trailing whitespace] | ||
* | ||
~ [trailing whitespace] | ||
*/ | ||
|
||
/*** | ||
* not a JSDoc comment | ||
~ [trailing whitespace] | ||
* | ||
~ [trailing whitespace] | ||
*/ | ||
|
||
// following line checks for trailing whitespace before EOF | ||
|
5 changes: 5 additions & 0 deletions
5
test/rules/no-trailing-whitespace/skip-blank-lines/tslint.json
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,5 @@ | ||
{ | ||
"rules": { | ||
"no-trailing-whitespace": [true, "ignore-blank-lines"] | ||
} | ||
} |