Fix additional ESLint warnings and auto-fix issues (56 total warnings fixed)

Co-authored-by: johndoe6345789 <224850594+johndoe6345789@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-01-06 18:42:12 +00:00
parent 6ac9949e8a
commit a061fb3241
5 changed files with 11 additions and 13 deletions

View File

@@ -27,7 +27,7 @@ interface TenantLayoutProps {
*/
async function getPackageDependencies(packageId: string): Promise<{ id: string; name?: string }[]> {
const metadata = await loadPackageMetadata(packageId) as { dependencies?: string[]; name?: string; minLevel?: number } | null
if (metadata === null || metadata.dependencies === undefined || metadata.dependencies.length === 0) {
if (metadata?.dependencies === undefined || metadata.dependencies.length === 0) {
return []
}

View File

@@ -125,10 +125,10 @@ async function handleRequest(
if (!result.success) {
// Map common errors to appropriate status codes
const errorMsg = result.error ?? 'Operation failed'
if (errorMsg !== null && errorMsg !== undefined && errorMsg.includes('not found')) {
if (errorMsg?.includes('not found') === true) {
return errorResponse(errorMsg, STATUS.NOT_FOUND)
}
if (errorMsg !== null && errorMsg !== undefined && errorMsg.includes('required')) {
if (errorMsg?.includes('required') === true) {
return errorResponse(errorMsg, STATUS.BAD_REQUEST)
}
return errorResponse(errorMsg, STATUS.INTERNAL_ERROR)

View File

@@ -38,11 +38,9 @@ export class AuthStore {
}
async ensureSessionChecked(): Promise<void> {
if (this.sessionCheckPromise === null) {
this.sessionCheckPromise = this.refresh().finally(() => {
this.sessionCheckPromise = null
})
}
this.sessionCheckPromise ??= this.refresh().finally(() => {
this.sessionCheckPromise = null
})
return this.sessionCheckPromise
}
@@ -110,7 +108,7 @@ export class AuthStore {
try {
const user = await fetchSession()
if (user) {
if (user !== null && user !== undefined) {
this.setState({
user: mapUserToAuthUser(user),
isAuthenticated: true,

View File

@@ -18,9 +18,9 @@ export const mapUserToAuthUser = (user: User): AuthUser => {
username: user.username,
role: user.role as AuthUser['role'],
level: getRoleLevel(user.role),
tenantId: user.tenantId || undefined,
profilePicture: user.profilePicture || undefined,
bio: user.bio || undefined,
tenantId: (user.tenantId !== null && user.tenantId.length > 0) ? user.tenantId : undefined,
profilePicture: user.profilePicture ?? undefined,
bio: user.bio ?? undefined,
isInstanceOwner: user.isInstanceOwner,
}
}

View File

@@ -275,7 +275,7 @@ function evaluateSimpleExpression(expr: string, context: RenderContext): JsonVal
if (value !== null && value !== undefined && typeof value === 'object' && !Array.isArray(value)) {
value = (value as Record<string, JsonValue>)[innerPart]
}
return !value
return value === null || value === undefined || value === false || value === 0 || value === '' ? true : false
}
// Handle array access or simple property