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
member-access: add fixer #2969
Merged
Merged
member-access: add fixer #2969
Changes from 1 commit
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
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
Next
Next commit
member-access: add fixer
[new-fixer] `member-access` Fixes: #2967
- Loading branch information
commit 924e6abee76c63c0da9ac4fc488f040ad8a512a0
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
class Members { | ||
public get g() { | ||
return 1; | ||
} | ||
public set s(o: any) {} | ||
|
||
public get publicG() { | ||
return 1; | ||
} | ||
public set publicS(o: any) {} | ||
} | ||
|
||
const obj = { | ||
get g() { | ||
return 1; | ||
} | ||
}; |
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 ContructorsNoAccess { | ||
public constructor(i: number); | ||
public constructor(o: any) {} | ||
} | ||
|
||
class ContructorsAccess { | ||
public constructor(i: number); | ||
public constructor(o: any) {} | ||
} | ||
|
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,48 @@ | ||
declare class AmbientNoAccess { | ||
public a(): number; | ||
|
||
public static b(): number; | ||
} | ||
|
||
declare class AmbientAccess { | ||
public a(): number; | ||
public static b(): number; | ||
} | ||
|
||
class Members { | ||
[x: string]: number; | ||
public i: number; | ||
public static j: number; | ||
|
||
public nPublic: number; | ||
protected nProtected: number; | ||
private nPrivate: number; | ||
|
||
public static nsPublic: number; | ||
protected static nsProtected: number; | ||
private static nsPrivate: number; | ||
|
||
public noAccess(x: number): number; | ||
public noAccess(o: any): any {} | ||
|
||
public static noAccess(x: number): number; | ||
public static noAccess(o: any): any {} | ||
|
||
public access(x: number): number; | ||
public access(o: any): any {} | ||
|
||
public static access(x: number): number; | ||
public static access(o: any): any {} | ||
} | ||
|
||
const obj = { | ||
func() {} | ||
}; | ||
|
||
function main() { | ||
class A { | ||
public i: number; | ||
public static j: number; | ||
public n: 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,7 @@ | ||
class { | ||
x() {} | ||
constructor() {} | ||
/*some comment*/ get y() {} | ||
public() {} | ||
} | ||
|
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
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.
This feels like it could be separated into a
tsutils
function.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.
👍
I added a
getModifier
utility to tsutils. I don't know if I release a new version this week though.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.
done