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 887
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add fixer and new option to commentFormatRule (#3583)
* Change commentFormatRule to only emit one message per error * Add fixer * Add allow-trailing-lowercase option * Changes after review: cache last comment, rework on structure * Make allow-trailing-lowercase a bit stricter
- Loading branch information
Showing
14 changed files
with
287 additions
and
59 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
15 changes: 15 additions & 0 deletions
15
test/rules/comment-format/allow-trailing-lowercase/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,15 @@ | ||
// This is a valid | ||
// multiline comment | ||
|
||
// This is an invalid | ||
// multiline | ||
|
||
let a = 1; // Some description | ||
let b = "foo"; // Another description | ||
|
||
// Another multiline | ||
// comment .. | ||
// | ||
// With multiple | ||
// paragraphs | ||
|
20 changes: 20 additions & 0 deletions
20
test/rules/comment-format/allow-trailing-lowercase/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,20 @@ | ||
// This is a valid | ||
// multiline comment | ||
|
||
// This is an invalid | ||
//multiline | ||
~~~~~~~~~[space] | ||
|
||
let a = 1; // Some description | ||
let b = "foo"; // another description | ||
~~~~~~~~~~~~~~~~~~~~[upper] | ||
|
||
// Another multiline | ||
// comment .. | ||
// | ||
// with multiple | ||
~~~~~~~~~~~~~~[upper] | ||
// paragraphs | ||
|
||
[upper]: comment must start with uppercase letter | ||
[space]: comment must start with a space |
5 changes: 5 additions & 0 deletions
5
test/rules/comment-format/allow-trailing-lowercase/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": { | ||
"comment-format": [true, "check-space", "check-uppercase", "allow-trailing-lowercase"] | ||
} | ||
} |
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
Oops, something went wrong.