Skip to content

Commit 62c5fd3

Browse files
renovate[bot]renovate-botfelixfbecker
authored
chore(deps): update dependency @sourcegraph/eslint-config to ^0.19.2 (#38)
Co-authored-by: Renovate Bot <bot@renovateapp.com> Co-authored-by: Felix Becker <felix.b@outlook.com>
1 parent 748fee9 commit 62c5fd3

File tree

5 files changed

+200
-100
lines changed

5 files changed

+200
-100
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@
118118
"devDependencies": {
119119
"@commitlint/cli": "^8.3.5",
120120
"@commitlint/config-conventional": "^8.3.4",
121-
"@sourcegraph/eslint-config": "^0.17.2",
121+
"@sourcegraph/eslint-config": "^0.19.2",
122122
"@sourcegraph/prettierrc": "^3.0.3",
123123
"@sourcegraph/tsconfig": "^3.0.0",
124124
"@types/mocha": "7.0.2",

src/codeownersFile.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,9 @@ export interface CodeOwnersEntry {
8080
* Parse a CODEOWNERS file into an array of entries (will be in reverse order
8181
* of the file).
8282
*/
83-
export function parseCodeownersFile(str: string): CodeOwnersEntry[] {
83+
export function parseCodeownersFile(string: string): CodeOwnersEntry[] {
8484
const entries: CodeOwnersEntry[] = []
85-
const lines = str.split('\n')
85+
const lines = string.split('\n')
8686

8787
for (const [index, lineText] of lines.entries()) {
8888
const [content] = lineText.split('#')

src/extension.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import { getCodeOwners } from './codeownersFile'
55
import { formatCodeOwners } from './codeOwners'
66
import { resolveURI } from './uri'
77

8-
export function activate(ctx: sourcegraph.ExtensionContext): void {
9-
ctx.subscriptions.add(
8+
export function activate(context: sourcegraph.ExtensionContext): void {
9+
context.subscriptions.add(
1010
combineLatest([
1111
from(sourcegraph.workspace.onDidOpenTextDocument).pipe(
1212
startWith(
@@ -24,8 +24,8 @@ export function activate(ctx: sourcegraph.ExtensionContext): void {
2424
if (!sourcegraph.configuration.get().value['codeOwnership.hide']) {
2525
try {
2626
return { textDocument, resolvedOwnersLine: await getCodeOwners(textDocument.uri) }
27-
} catch (err) {
28-
console.error(`Error getting code owners for ${textDocument.uri}:`, err)
27+
} catch (error) {
28+
console.error(`Error getting code owners for ${textDocument.uri}:`, error)
2929
}
3030
}
3131
return { textDocument, resolvedOwnersLine: null }

src/util/memoizeAsync.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ export function memoizeAsync<P, T>(
1010
toKey: (params: P) => string
1111
): (params: P) => Promise<T> {
1212
const cache = new Map<string, Promise<T>>()
13-
return (params: P) => {
14-
const key = toKey(params)
13+
return (parameters: P) => {
14+
const key = toKey(parameters)
1515
const hit = cache.get(key)
1616
if (hit) {
1717
return hit
1818
}
19-
const p = func(params)
20-
p.then(null, () => cache.delete(key))
21-
cache.set(key, p)
22-
return p
19+
const promise = func(parameters)
20+
promise.then(null, () => cache.delete(key))
21+
cache.set(key, promise)
22+
return promise
2323
}
2424
}

0 commit comments

Comments
 (0)