Disallow unsafe returns. (#19767)

This commit is contained in:
Christian Gunderman
2026-02-21 01:12:56 +00:00
committed by GitHub
parent 09218572d0
commit dfd7721e69
26 changed files with 42 additions and 7 deletions

View File

@@ -149,6 +149,7 @@ class RecursiveFileSearch implements FileSearch {
filteredCandidates = await this.fzf
.find(pattern)
.then((results: Array<FzfResultItem<string>>) =>
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
results.map((entry: FzfResultItem<string>) => entry.item),
)
.catch(() => {

View File

@@ -27,6 +27,7 @@ export function safeJsonStringify(
}
seen.add(value);
}
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
return value;
},
space,
@@ -60,6 +61,7 @@ export function safeJsonStringifyBooleanValuesOnly(obj: any): string {
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
if ((value as Config) !== null && !configSeen) {
configSeen = true;
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
return value;
}
if (typeof value === 'boolean') {

View File

@@ -91,8 +91,10 @@ export function createWorkingStdio() {
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
const value = Reflect.get(target, prop, receiver);
if (typeof value === 'function') {
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
return value.bind(target);
}
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
return value;
},
});
@@ -105,8 +107,10 @@ export function createWorkingStdio() {
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
const value = Reflect.get(target, prop, receiver);
if (typeof value === 'function') {
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
return value.bind(target);
}
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
return value;
},
});