forked from palantir/tslint
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
member-access: add fixer (palantir#2969)
- Loading branch information
1 parent
3bb6fb1
commit a98d492
Showing
6 changed files
with
101 additions
and
10 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
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() {} | ||
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