From 3592c4bfe8a344db06e74b18763972e77062c9f3 Mon Sep 17 00:00:00 2001 From: Daniel Salazar Date: Thu, 6 Nov 2025 15:26:40 -0800 Subject: [PATCH] chore: ts lint stuff (#1934) --- eslint.config.js | 1 + extensions/api.d.ts | 13 +++++++------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/eslint.config.js b/eslint.config.js index 81197e48..490ce07c 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -53,6 +53,7 @@ const rules = { '@stylistic/no-mixed-spaces-and-tabs': ['error', 'smart-tabs'], 'custom/space-unary-ops-with-exception': ['error', { words: true, nonwords: false }], '@stylistic/no-multi-spaces': ['error', { exceptions: { 'VariableDeclarator': true } }], + '@stylistic/type-annotation-spacing': 'error', }; export default defineConfig([ diff --git a/extensions/api.d.ts b/extensions/api.d.ts index dc0cfa6b..3fe2f934 100644 --- a/extensions/api.d.ts +++ b/extensions/api.d.ts @@ -14,7 +14,7 @@ import type * as ExtensionControllerExports from './ExtensionController/src/Exte declare global { namespace Express { interface Request { - services: { get: (string: T)=> T extends keyof ServiceNameMap ? ServiceNameMap[T] : unknown } + services: { get: (string: T) => T extends keyof ServiceNameMap ? ServiceNameMap[T] : unknown } actor: Actor, rawBody: Buffer, /** @deprecated use actor instead */ @@ -68,11 +68,12 @@ interface ServiceNameMap { } interface Extension extends RouterMethods { exports: Record, - on(event: string, listener: (...args: T)=> void): void, // TODO DS: type events better - import(module:'core'): CoreRuntimeModule, - import(module:'fs'): FilesystemModule, - import(module:'extensionController'): typeof ExtensionControllerExports - import(module: T): T extends `service:${infer R extends keyof ServiceNameMap}` + on(event: string, listener: (...args: T) => void): void, // TODO DS: type events better + import(module: 'data'): { db: BaseDatabaseAccessService, kv: DBKVStore, cache: unknown }// TODO DS: type cache better + import(module: 'core'): CoreRuntimeModule, + import(module: 'fs'): FilesystemModule, + import(module: 'extensionController'): typeof ExtensionControllerExports + import(module: T): T extends `service:${infer R extends keyof ServiceNameMap}` ? ServiceNameMap[R] : unknown; }