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
[enhancement] member-access rule on parameter properties #3325
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
a985353
member-access rule: check also for parameter property
1568dba
member-access rule: add test for no-public option
ebce660
member-access rule: add new-rule-option check-parameter-property
6087fe8
memberAccessRule: prefer multiline import to namespace import
e5c4358
memberAccessRule: add more tests
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"] | ||
} | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
consider adding the
public
keyword to theconstructor
to make sure the rule finds both failures