mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-25 21:41:12 -07:00
chore(lint): enforce zero warnings and cleanup syntax restrictions (#22902)
This commit is contained in:
@@ -163,6 +163,7 @@ export class FolderTrustDiscoveryService {
|
||||
for (const event of Object.values(hooksConfig)) {
|
||||
if (!Array.isArray(event)) continue;
|
||||
for (const hook of event) {
|
||||
// eslint-disable-next-line no-restricted-syntax
|
||||
if (this.isRecord(hook) && typeof hook['command'] === 'string') {
|
||||
hooks.add(hook['command']);
|
||||
}
|
||||
|
||||
@@ -136,7 +136,9 @@ describe('Telemetry Sanitization', () => {
|
||||
const attributes = event.toOpenTelemetryAttributes(config);
|
||||
|
||||
// Should be JSON stringified
|
||||
// eslint-disable-next-line no-restricted-syntax
|
||||
expect(typeof attributes['hook_input']).toBe('string');
|
||||
// eslint-disable-next-line no-restricted-syntax
|
||||
expect(typeof attributes['hook_output']).toBe('string');
|
||||
|
||||
const parsedInput = JSON.parse(attributes['hook_input'] as string);
|
||||
|
||||
@@ -62,7 +62,6 @@ export class MockMessageBus {
|
||||
if (!this.subscriptions.has(type)) {
|
||||
this.subscriptions.set(type, new Set());
|
||||
}
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
|
||||
this.subscriptions.get(type)!.add(listener as (message: Message) => void);
|
||||
},
|
||||
);
|
||||
@@ -74,7 +73,6 @@ export class MockMessageBus {
|
||||
<T extends Message>(type: T['type'], listener: (message: T) => void) => {
|
||||
const listeners = this.subscriptions.get(type);
|
||||
if (listeners) {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
|
||||
listeners.delete(listener as (message: Message) => void);
|
||||
}
|
||||
},
|
||||
@@ -103,7 +101,6 @@ export class MockMessageBus {
|
||||
* Create a mock MessageBus for testing
|
||||
*/
|
||||
export function createMockMessageBus(): MessageBus {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
|
||||
return new MockMessageBus() as unknown as MessageBus;
|
||||
}
|
||||
|
||||
@@ -113,6 +110,5 @@ export function createMockMessageBus(): MessageBus {
|
||||
export function getMockMessageBusInstance(
|
||||
messageBus: MessageBus,
|
||||
): MockMessageBus {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
|
||||
return messageBus as unknown as MockMessageBus;
|
||||
}
|
||||
|
||||
@@ -19,7 +19,6 @@ export function createMockWorkspaceContext(
|
||||
): WorkspaceContext {
|
||||
const allDirs = [rootDir, ...additionalDirs];
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
|
||||
const mockWorkspaceContext = {
|
||||
addDirectory: vi.fn(),
|
||||
getDirectories: vi.fn().mockReturnValue(allDirs),
|
||||
|
||||
@@ -674,6 +674,7 @@ describe('ReadFileTool', () => {
|
||||
const parts = result.llmContent as Array<Record<string, unknown>>;
|
||||
const jitTextPart = parts.find(
|
||||
(p) =>
|
||||
// eslint-disable-next-line no-restricted-syntax
|
||||
typeof p['text'] === 'string' && p['text'].includes('Auth rules'),
|
||||
);
|
||||
expect(jitTextPart).toBeDefined();
|
||||
|
||||
Reference in New Issue
Block a user