Skip to content

Commit 33dbecb

Browse files
committed
lint
1 parent 4435869 commit 33dbecb

File tree

7 files changed

+24
-13
lines changed

7 files changed

+24
-13
lines changed

src/shared/sam/cli/samCliLocator.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,13 @@ export class DefaultSamCliLocationProvider implements SamCliLocationProvider {
3434
const cachedLoc = DefaultSamCliLocationProvider.cachedSamLocation
3535

3636
// Avoid searching the system for `sam` (especially slow on Windows).
37-
if (cachedLoc && await DefaultSamCliLocationProvider.isValidSamLocation(cachedLoc.path)) {
37+
if (cachedLoc && (await DefaultSamCliLocationProvider.isValidSamLocation(cachedLoc.path))) {
3838
perflog.done()
3939
return cachedLoc
4040
}
4141

42-
DefaultSamCliLocationProvider.cachedSamLocation = await DefaultSamCliLocationProvider.getSamCliLocator().getLocation()
42+
DefaultSamCliLocationProvider.cachedSamLocation =
43+
await DefaultSamCliLocationProvider.getSamCliLocator().getLocation()
4344
perflog.done()
4445
return DefaultSamCliLocationProvider.cachedSamLocation
4546
}
@@ -105,7 +106,9 @@ abstract class BaseSamCliLocator {
105106
BaseSamCliLocator.didFind = true
106107
return { path: fullPath, version: validationResult.version }
107108
}
108-
this.logger.warn(`samCliLocator: found invalid SAM CLI: (${validationResult.validation}): ${fullPath}`)
109+
this.logger.warn(
110+
`samCliLocator: found invalid SAM CLI: (${validationResult.validation}): ${fullPath}`
111+
)
109112
} catch (e) {
110113
const err = e as Error
111114
this.logger.error('samCliLocator failed: %s', err.message)

src/shared/systemUtilities.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,12 @@ export class SystemUtilities {
192192
* @param doLog log failures
193193
* @param expected output must contain this string
194194
*/
195-
public static async tryRun(p: string, args: string[], logging: 'yes' | 'no' | 'noresult' = 'yes', expected?: string): Promise<boolean> {
195+
public static async tryRun(
196+
p: string,
197+
args: string[],
198+
logging: 'yes' | 'no' | 'noresult' = 'yes',
199+
expected?: string
200+
): Promise<boolean> {
196201
const proc = new ChildProcess(p, args, { logging: 'no' })
197202
const r = await proc.run()
198203
const ok = r.exitCode === 0 && (expected === undefined || r.stdout.includes(expected))

src/shared/utilities/asyncCollection.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,11 +222,11 @@ async function promise<T>(iterable: AsyncIterable<T>): Promise<T[]> {
222222
function addToMap<T, U extends string>(map: Map<string, T>, selector: KeySelector<T, U> | StringProperty<T>, item: T) {
223223
const key = typeof selector === 'function' ? selector(item) : item[selector]
224224
if (key) {
225-
if (map.has(key as keyof typeof map['keys'])) {
225+
if (map.has(key as keyof (typeof map)['keys'])) {
226226
throw new Error(`Duplicate key found when converting AsyncIterable to map: ${key}`)
227227
}
228228

229-
map.set(key as keyof typeof map['keys'], item)
229+
map.set(key as keyof (typeof map)['keys'], item)
230230
}
231231
}
232232

src/shared/utilities/functionUtils.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,10 @@ export function onceChanged<T, U extends any[]>(fn: (...args: U) => T): (...args
5656
let ran = false
5757
let prevArgs = ''
5858

59-
return (...args) => ((ran && prevArgs === args.map(String).join(':'))
60-
? val
61-
: ((val = fn(...args)), (ran = true), (prevArgs = args.map(String).join(':')), val))
59+
return (...args) =>
60+
ran && prevArgs === args.map(String).join(':')
61+
? val
62+
: ((val = fn(...args)), (ran = true), (prevArgs = args.map(String).join(':')), val)
6263
}
6364

6465
/**

src/shared/utilities/typeConstructors.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export type FromDescriptor<T extends TypeDescriptor> = {
5151

5252
// `Symbol` and `BigInt` are included here, though in-practice
5353
const primitives = [Number, String, Boolean, Object, Symbol, BigInt]
54-
function isPrimitiveConstructor(type: unknown): type is typeof primitives[number] {
54+
function isPrimitiveConstructor(type: unknown): type is (typeof primitives)[number] {
5555
return !!primitives.find(p => p === type)
5656
}
5757

src/stepFunctions/activation.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,9 @@ async function registerStepFunctionCommands(
8888
)
8989
}
9090

91-
export function initalizeWebviewPaths(context: vscode.ExtensionContext): typeof globals['visualizationResourcePaths'] {
91+
export function initalizeWebviewPaths(
92+
context: vscode.ExtensionContext
93+
): (typeof globals)['visualizationResourcePaths'] {
9294
// Location for script in body of webview that handles input from user
9395
// and calls the code to render state machine graph
9496

src/test/shared/sam/cli/samCliTestUtils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ export class MockSamCliProcessInvoker implements SamCliProcessInvoker {
2121

2222
this.validateArgs(invokeSettings.arguments)
2323

24-
return ({
24+
return {
2525
exitCode: 0,
26-
} as any) as ChildProcessResult
26+
} as any as ChildProcessResult
2727
}
2828
}
2929

0 commit comments

Comments
 (0)