Skip to content
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.

Commit

Permalink
array-type: consider this to be simple type (#2982)
Browse files Browse the repository at this point in the history
  • Loading branch information
ksvitkovsky authored and adidahiya committed Jul 7, 2017
1 parent ff3904a commit 8de7cae
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 8de7cae

Please sign in to comment.