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.
Add option to ignore accessors in adjacent-overload-signatures (#3718)
* add noAsyncWithoutAwait rule * fix lint * code review updates * Add option to ignore accessors in adjacent-overload-signatures * Fix options schema * allow return as well as await * remove unneeded lint ignore * improve rationale & fix performance issue * fixes according to review * finish fixing according to review * Initial feedback cleanups * Refactored to walk function * Reset tslint.json to master * Converted options to object form * Disabled no-object-literal-type-assertion complaint
- Loading branch information
Showing
5 changed files
with
75 additions
and
12 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
File renamed without changes.
11 changes: 11 additions & 0 deletions
11
test/rules/adjacent-overload-signatures/ignore-accessors/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,11 @@ | ||
// good | ||
|
||
class Accessors { | ||
private x: number; | ||
private y: number; | ||
get x() {return this.x;} | ||
get y() {return this.y;} | ||
// setter is not considered as an overload of getter | ||
set x(newX: number) {this.x = newX;} | ||
set y(newY: number) {this.y = newY;} | ||
} |
5 changes: 5 additions & 0 deletions
5
test/rules/adjacent-overload-signatures/ignore-accessors/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": { | ||
"adjacent-overload-signatures": [true, { "ignore-accessors": true }] | ||
} | ||
} |