mirror of
https://github.com/johndoe6345789/metabuilder.git
synced 2026-04-24 13:54:57 +00:00
Auto-fix 7 TypeScript warnings (prefer-readonly, no-confusing-void-expression)
Co-authored-by: johndoe6345789 <224850594+johndoe6345789@users.noreply.github.com>
This commit is contained in:
@@ -18,7 +18,7 @@ export class AuthStore {
|
||||
isLoading: false,
|
||||
}
|
||||
|
||||
private listeners = new Set<() => void>()
|
||||
private readonly listeners = new Set<() => void>()
|
||||
private sessionCheckPromise: Promise<void> | null = null
|
||||
|
||||
getState(): AuthState {
|
||||
@@ -34,7 +34,7 @@ export class AuthStore {
|
||||
|
||||
private setState(newState: AuthState): void {
|
||||
this.state = newState
|
||||
this.listeners.forEach(listener => listener())
|
||||
this.listeners.forEach(listener => { listener(); })
|
||||
}
|
||||
|
||||
async ensureSessionChecked(): Promise<void> {
|
||||
|
||||
@@ -11,7 +11,7 @@ export function useAuth(): UseAuthReturn {
|
||||
const [state, setState] = useState<AuthState>(authStore.getState())
|
||||
|
||||
useEffect(() => {
|
||||
const unsubscribe = authStore.subscribe(() => setState({ ...authStore.getState() }))
|
||||
const unsubscribe = authStore.subscribe(() => { setState({ ...authStore.getState() }); })
|
||||
void authStore.ensureSessionChecked()
|
||||
return unsubscribe
|
||||
}, [])
|
||||
|
||||
@@ -13,7 +13,7 @@ export interface ComponentCatalogEntry {
|
||||
* TODO: Implement full component catalog functionality
|
||||
*/
|
||||
export class ComponentCatalog {
|
||||
private components = new Map<string, ComponentCatalogEntry>()
|
||||
private readonly components = new Map<string, ComponentCatalogEntry>()
|
||||
|
||||
register(name: string, entry: ComponentCatalogEntry): void {
|
||||
this.components.set(name, entry)
|
||||
|
||||
@@ -14,7 +14,7 @@ export interface ComponentMetadata {
|
||||
* TODO: Implement full component registry functionality
|
||||
*/
|
||||
export class ComponentRegistry {
|
||||
private registry = new Map<string, ComponentMetadata>()
|
||||
private readonly registry = new Map<string, ComponentMetadata>()
|
||||
|
||||
register(id: string, metadata: ComponentMetadata): void {
|
||||
this.registry.set(id, metadata)
|
||||
|
||||
@@ -7,7 +7,7 @@ import { readFileSync, writeFileSync, existsSync } from 'fs'
|
||||
import { join } from 'path'
|
||||
|
||||
export class SchemaRegistry {
|
||||
private schemas: Map<string, ModelSchema> = new Map()
|
||||
private readonly schemas: Map<string, ModelSchema> = new Map()
|
||||
packages: Record<string, unknown> = {}
|
||||
|
||||
register(schema: ModelSchema): void {
|
||||
@@ -40,7 +40,7 @@ export function loadSchemaRegistry(path?: string): SchemaRegistry {
|
||||
const { schemas, packages } = parsed as { schemas?: unknown; packages?: unknown }
|
||||
|
||||
if (Array.isArray(schemas)) {
|
||||
schemas.forEach((schema: ModelSchema) => schemaRegistry.register(schema))
|
||||
schemas.forEach((schema: ModelSchema) => { schemaRegistry.register(schema); })
|
||||
}
|
||||
|
||||
if (packages !== null && packages !== undefined && typeof packages === 'object') {
|
||||
|
||||
Reference in New Issue
Block a user