forked from palantir/tslint
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ignore-comments option for no-trailing-whitespace (palantir#2153)
Addresses comments in palantir#2049.
- Loading branch information
Showing
11 changed files
with
119 additions
and
24 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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
10 changes: 10 additions & 0 deletions
10
test/rules/no-trailing-whitespace/ignore-comments/test.js.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,10 @@ | ||
class Clazz { | ||
public funcxion() { | ||
console.log("test") ; | ||
} | ||
|
||
|
||
private foobar() { | ||
} | ||
} | ||
|
16 changes: 16 additions & 0 deletions
16
test/rules/no-trailing-whitespace/ignore-comments/test.js.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,16 @@ | ||
class Clazz { | ||
public funcxion() { | ||
~~~~ [0] | ||
console.log("test") ; | ||
~~~~ [0] | ||
} | ||
|
||
~~~~ [0] | ||
|
||
~~~~ [0] | ||
private foobar() { | ||
} | ||
} | ||
~~~~ [0] | ||
|
||
[0]: trailing whitespace |
20 changes: 20 additions & 0 deletions
20
test/rules/no-trailing-whitespace/ignore-comments/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,20 @@ | ||
class Clazz { | ||
public funcxion() { | ||
console.log("test") ; | ||
} | ||
|
||
|
||
private foobar() { | ||
} | ||
} | ||
// 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 */ | ||
/* | ||
*/ | ||
|
||
// following line checks for trailing whitespace before EOF |
28 changes: 28 additions & 0 deletions
28
test/rules/no-trailing-whitespace/ignore-comments/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,28 @@ | ||
class Clazz { | ||
public funcxion() { | ||
~~~~ [trailing whitespace] | ||
console.log("test") ; | ||
~~~~ [trailing whitespace] | ||
} | ||
|
||
~~~~ [trailing whitespace] | ||
|
||
~~~~ [trailing whitespace] | ||
private foobar() { | ||
} | ||
} | ||
~~~~ [trailing whitespace] | ||
// single line comment without trailing whitespace | ||
// single line comment with trailing whitespace | ||
/* single line multiline comment */ | ||
/* whitespace after comment */ | ||
~ [trailing whitespace] | ||
/* first line has trailing whitespace | ||
second line is ok | ||
last line is not checked */ | ||
/* | ||
*/ | ||
|
||
// following line checks for trailing whitespace before EOF | ||
|
||
~~~ [trailing whitespace] |
8 changes: 8 additions & 0 deletions
8
test/rules/no-trailing-whitespace/ignore-comments/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,8 @@ | ||
{ | ||
"rules": { | ||
"no-trailing-whitespace": [true, "ignore-comments"] | ||
}, | ||
"jsRules": { | ||
"no-trailing-whitespace": [true, "ignore-comments"] | ||
} | ||
} |