-
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.
Added index signature fixer error case. (#63)
Fixes #62
- Loading branch information
1 parent
8db42f4
commit 7e4b593
Showing
3 changed files
with
25 additions
and
8 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
17 changes: 17 additions & 0 deletions
17
test/rules/readonly-keyword/default/index-signature.ts.fix
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 @@ | ||
|
||
// Index signature as part of interface | ||
interface Foo { | ||
readonly [key: string]: string | ||
} | ||
|
||
// Index signature as return value from function | ||
|
||
function foo(): { readonly [source: string]: string } { | ||
return undefined; | ||
} | ||
|
||
// Index signature with nested object. | ||
interface Foo { | ||
readonly [key: string]: { readonly bar: string } | ||
} | ||
|
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