mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-25 12:34:38 -07:00
Disallow and suppress unsafe assignment (#19736)
This commit is contained in:
committed by
GitHub
parent
b746524a1b
commit
58d637f919
@@ -166,6 +166,7 @@ async function searchResourceCandidates(
|
||||
const fzf = new AsyncFzf(candidates, {
|
||||
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,
|
||||
});
|
||||
@@ -188,6 +189,7 @@ async function searchAgentCandidates(
|
||||
const fzf = new AsyncFzf(candidates, {
|
||||
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,
|
||||
});
|
||||
|
||||
@@ -57,6 +57,7 @@ export const useSessionBrowser = (
|
||||
const originalFilePath = path.join(chatsDir, fileName);
|
||||
|
||||
// Load up the conversation.
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
||||
const conversation: ConversationRecord = JSON.parse(
|
||||
await fs.readFile(originalFilePath, 'utf8'),
|
||||
);
|
||||
|
||||
@@ -271,6 +271,7 @@ function useCommandSuggestions(
|
||||
const fzfInstance = getFzfForCommands(commandsToSearch);
|
||||
if (fzfInstance) {
|
||||
try {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
||||
const fzfResults = await fzfInstance.fzf.find(partial);
|
||||
if (signal.aborted) return;
|
||||
const uniqueCommands = new Set<SlashCommand>();
|
||||
|
||||
@@ -22,6 +22,7 @@ export const useStateAndRef = <
|
||||
(newStateOrCallback) => {
|
||||
let newValue: T;
|
||||
if (typeof newStateOrCallback === 'function') {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
||||
newValue = newStateOrCallback(ref.current);
|
||||
} else {
|
||||
newValue = newStateOrCallback;
|
||||
|
||||
Reference in New Issue
Block a user