Skip to content

Commit

Permalink
chore: use Record<string, any> instead of the verbose syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
aminya committed Jan 4, 2021
1 parent ee9a41c commit d6a561c
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 23 deletions.
4 changes: 1 addition & 3 deletions lib/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,7 @@ export function isPathIgnored(filePath: string | null | undefined, ignoredGlob:
}

export function subscriptiveObserve(
object: {
[key: string]: any
},
object: Record<string, any>,
eventName: string,
callback: (...args: Array<any>) => any,
): Disposable {
Expand Down
4 changes: 1 addition & 3 deletions lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,7 @@ export function consumeUI(ui: UI): Disposable {
}
})
}
export function provideIndie(): {
[key: string]: any
} {
export function provideIndie(): Record<string, any> {
return indie => instance.addIndie(indie)
}
export function deactivate() {
Expand Down
19 changes: 3 additions & 16 deletions lib/indie-delegate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,8 @@ export default class IndieDelegate {
}
}
setMessages(
filePath:
| string
| Array<{
[key: string]: any
}>,
messages:
| Array<{
[key: string]: any
}>
| null
| undefined = null,
filePath: string | Array<Record<string, any>>,
messages: Array<Record<string, any>> | null | undefined = null,
): void {
// v2 Support from here on
if (typeof filePath !== 'string' || !Array.isArray(messages)) {
Expand All @@ -70,11 +61,7 @@ export default class IndieDelegate {
this.messages.set(filePath, messages)
this.emitter.emit('did-update', this.getMessages())
}
setAllMessages(
messages: Array<{
[key: string]: any
}>,
): void {
setAllMessages(messages: Array<Record<string, any>>): void {
if (this.subscriptions.disposed) {
return
}
Expand Down
2 changes: 1 addition & 1 deletion lib/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ class Linter {
this.registryMessages.deleteByLinter(linter)
}
// Indie Linter
addIndie(indie: { [key: string]: any }) {
addIndie(indie: Record<string, any>) {
this.registryIndieInit()
return this.registryIndie.register(indie, 2)
}
Expand Down

0 comments on commit d6a561c

Please sign in to comment.