-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
readonly-keyword rule, check function params and return type (#80)
* Fix parameters * Return type * Update readme to mention return types
- Loading branch information
1 parent
67b3237
commit 09290ad
Showing
7 changed files
with
70 additions
and
17 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
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,29 @@ | ||
// Index signature as return value from function | ||
|
||
function foo(): { [source: string]: string } { | ||
~~~~~~~~~~~~~~~~~~~~~~~~ [failure] | ||
return undefined; | ||
} | ||
|
||
// Index signature as parameter to function | ||
|
||
function foo(bar: { [source: string]: string }): void { | ||
~~~~~~~~~~~~~~~~~~~~~~~~ [failure] | ||
return undefined; | ||
} | ||
|
||
// Object as parameter to function | ||
|
||
function foo(bar: { zoo: string }): void { | ||
~~~~~~~~~~~ [failure] | ||
return undefined; | ||
} | ||
|
||
// Object as return value from function | ||
|
||
function foo(): { zoo: string } { | ||
~~~~~~~~~~~ [failure] | ||
return undefined; | ||
} | ||
|
||
[failure]: A readonly modifier is required. |
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 |
---|---|---|
|
@@ -58,6 +58,4 @@ function foo() { | |
} | ||
} | ||
|
||
|
||
|
||
[failure]: A readonly modifier is required. |