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.
[enhancement] member-access rule on parameter properties (#3325)
- Loading branch information
1 parent
74d84be
commit d197ee3
Showing
9 changed files
with
103 additions
and
21 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
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,17 @@ | ||
class Members { | ||
constructor( | ||
public readonly paramReadonly : number, | ||
public paramPublic : number, | ||
protected paramProtected : number, | ||
private paramPrivate : number, | ||
public readonly paramPublicReadonly : number, | ||
protected readonly paramProtectedReadonly : number, | ||
private readonly paramPrivateReadonly : number | ||
){ | ||
|
||
} | ||
|
||
constructor(public readonly a : number, @decorated public readonly b : number) { | ||
|
||
} | ||
} |
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 Members { | ||
constructor( | ||
readonly paramReadonly : number, | ||
~~~~~~~~~~~~~ [The parameter property 'paramReadonly' must be marked either 'private', 'public', or 'protected'] | ||
public paramPublic : number, | ||
protected paramProtected : number, | ||
private paramPrivate : number, | ||
public readonly paramPublicReadonly : number, | ||
protected readonly paramProtectedReadonly : number, | ||
private readonly paramPrivateReadonly : number | ||
){ | ||
|
||
} | ||
|
||
constructor(readonly a : number, @decorated readonly b : number) { | ||
~ [The parameter property 'a' must be marked either 'private', 'public', or 'protected'] | ||
~ [The parameter property 'b' must be marked either 'private', 'public', or 'protected'] | ||
|
||
} | ||
} |
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": { | ||
"member-access": [true, "check-parameter-property"] | ||
} | ||
} |