Skip to content

Commit

Permalink
array-type: consider this to be simple type (palantir#2982)
Browse files Browse the repository at this point in the history
  • Loading branch information
ksvitkovsky authored and HyphnKnight committed Apr 9, 2018
1 parent b7be17b commit e6e007e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/rules/arrayTypeRule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ function isSimpleType(nodeType: ts.TypeNode): boolean {
case ts.SyntaxKind.SymbolKeyword:
case ts.SyntaxKind.VoidKeyword:
case ts.SyntaxKind.NeverKeyword:
case ts.SyntaxKind.ThisType:
return true;
case ts.SyntaxKind.TypeReference:
// TypeReferences must be non-generic or be another Array with a simple type
Expand Down
1 change: 1 addition & 0 deletions test/rules/array-type/array-simple/test.ts.fix
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ interface ArrayClass<T> {
foo: T[];
bar: T[];
baz: Arr<T>;
xyz: this[];
}

function fooFunction(foo: Array<ArrayClass<string>>) {
Expand Down
1 change: 1 addition & 0 deletions test/rules/array-type/array-simple/test.ts.lint
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ interface ArrayClass<T> {
~~~~~~~~ [0]
bar: T[];
baz: Arr<T>;
xyz: this[];
}

function fooFunction(foo: Array<ArrayClass<string>>) {
Expand Down

0 comments on commit e6e007e

Please sign in to comment.