mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-07-15 20:40:35 -07:00
Refactor: Eliminate no-unsafe-return suppressions via strict type validation (#20668)
Signed-off-by: M-DEV-1 <mahadevankizhakkedathu@gmail.com> Co-authored-by: Tommaso Sciortino <sciortino@gmail.com>
This commit is contained in:
@@ -170,13 +170,13 @@ async function searchResourceCandidates(
|
||||
selector: (candidate: ResourceSuggestionCandidate) => candidate.searchKey,
|
||||
});
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
||||
const results = await fzf.find(normalizedPattern, {
|
||||
limit: MAX_SUGGESTIONS_TO_SHOW * 3,
|
||||
});
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
||||
return results.map(
|
||||
(result: { item: ResourceSuggestionCandidate }) => result.item.suggestion,
|
||||
const results: Array<{ item: ResourceSuggestionCandidate }> = await fzf.find(
|
||||
normalizedPattern,
|
||||
{
|
||||
limit: MAX_SUGGESTIONS_TO_SHOW * 3,
|
||||
},
|
||||
);
|
||||
return results.map((result) => result.item.suggestion);
|
||||
}
|
||||
|
||||
async function searchAgentCandidates(
|
||||
@@ -194,11 +194,13 @@ async function searchAgentCandidates(
|
||||
selector: (s: Suggestion) => s.label,
|
||||
});
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
||||
const results = await fzf.find(normalizedPattern, {
|
||||
limit: MAX_SUGGESTIONS_TO_SHOW,
|
||||
});
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
||||
return results.map((r: { item: Suggestion }) => r.item);
|
||||
const results: Array<{ item: Suggestion }> = await fzf.find(
|
||||
normalizedPattern,
|
||||
{
|
||||
limit: MAX_SUGGESTIONS_TO_SHOW,
|
||||
},
|
||||
);
|
||||
return results.map((r) => r.item);
|
||||
}
|
||||
|
||||
export function useAtCompletion(props: UseAtCompletionProps): void {
|
||||
|
||||
Reference in New Issue
Block a user