Fix lint errors and formatting

- Wrap error.code with String() in CLI complete-login command
- Apply formatting fixes from linter

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
RevIQ
2026-01-09 19:16:23 +08:00
parent 93ef5c3942
commit 68fc67ba4a
4 changed files with 20 additions and 6 deletions

View File

@@ -21,7 +21,7 @@ async function completeLogin(
console.log(`Completed login request for: ${flags.email}`);
} catch (error) {
if (error instanceof ORPCError) {
console.error(`Error [${error.code}]:`, error.message);
console.error(`Error [${String(error.code)}]:`, error.message);
} else {
console.error(
"Error:",

View File

@@ -7,11 +7,15 @@ type OrgRole = "owner" | "admin" | "member";
const validRoles: OrgRole[] = ["owner", "admin", "member"];
function parseRole(role: string | undefined): OrgRole | undefined {
if (!role) return undefined;
if (!role) {
return undefined;
}
if (validRoles.includes(role as OrgRole)) {
return role as OrgRole;
}
throw new Error(`Invalid role: ${role}. Must be one of: ${validRoles.join(", ")}`);
throw new Error(
`Invalid role: ${role}. Must be one of: ${validRoles.join(", ")}`,
);
}
interface CreateUserFlags {