Skip to content

Commit 667e8d5

Browse files
skulidropekclaude
andcommitted
fix(lint): address remaining unicorn v65 violations and pin React to 19.2.4
- prefer-includes: host-errors.ts (error._tag chain → .includes()) - prefer-includes: lib/core/auto-agent-flags.ts (same find() pattern as frontend-lib) - prefer-includes: app-terminal-session-handlers.ts (split 3-undefined chain into individual early returns to preserve TypeScript narrowing) - consistent-compound-words: rename isUnixUserName→isUnixUsername, sshUserNamePatternDescription→sshUsernamePatternDescription, unixUserNamePattern→unixUsernamePattern across frontend-lib/core/domain.ts, frontend-lib/core/command-builders-shared.ts, lib/core/domain.ts, lib/core/command-builders-shared.ts, lib/shell/config.ts - React: re-pin react/react-dom to 19.2.4 in root overrides, packages/app, packages/terminal (Renovate bumped them back to 19.2.7) All 448 tests pass locally. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 679bd08 commit 667e8d5

11 files changed

Lines changed: 37 additions & 40 deletions

File tree

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@
6262
"unrs-resolver"
6363
],
6464
"overrides": {
65-
"react": "19.2.7",
66-
"react-dom": "19.2.7"
65+
"react": "19.2.4",
66+
"react-dom": "19.2.4"
6767
},
6868
"repository": {
6969
"type": "git",

packages/app/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@
8080
"@gridland/bun": "0.4.3",
8181
"@gridland/web": "0.4.3",
8282
"effect": "^3.21.3",
83-
"react": "19.2.7",
84-
"react-dom": "19.2.7",
83+
"react": "19.2.4",
84+
"react-dom": "19.2.4",
8585
"react-reconciler": "^0.33.0",
8686
"ts-morph": "^28.0.0"
8787
},

packages/app/src/docker-git/frontend-lib/core/command-builders-shared.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ import {
66
defaultTemplateConfig,
77
isDockerNetworkMode,
88
isGpuMode,
9-
isUnixUserName,
9+
isUnixUsername,
1010
type ParseError,
11-
sshUserNamePatternDescription
11+
sshUsernamePatternDescription
1212
} from "./domain.js"
1313

1414
const parsePort = (value: string): Either.Either<number, ParseError> => {
@@ -106,11 +106,11 @@ export const parseSshUser = (
106106
option: "--ssh-user"
107107
})
108108
}
109-
if (!isUnixUserName(candidate)) {
109+
if (!isUnixUsername(candidate)) {
110110
return Either.left({
111111
_tag: "InvalidOption",
112112
option: "--ssh-user",
113-
reason: `expected Linux user name matching ${sshUserNamePatternDescription}`
113+
reason: `expected Linux user name matching ${sshUsernamePatternDescription}`
114114
})
115115
}
116116
return Either.right(candidate)

packages/app/src/docker-git/frontend-lib/core/domain.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,20 +64,20 @@ export type AgentMode = "claude" | "codex" | "gemini" | "grok"
6464
export type DockerNetworkMode = "shared" | "project"
6565
export type GpuMode = "none" | "all"
6666

67-
const unixUserNamePattern = /^[a-z_][a-z0-9_-]{0,31}$/
67+
const unixUsernamePattern = /^[a-z_][a-z0-9_-]{0,31}$/
6868

69-
export const sshUserNamePatternDescription = "^[a-z_][a-z0-9_-]{0,31}$"
69+
export const sshUsernamePatternDescription = "^[a-z_][a-z0-9_-]{0,31}$"
7070

7171
// CHANGE: define the SSH user name invariant in the core domain
7272
// WHY: generated Dockerfiles and entrypoints interpolate sshUser into shell-sensitive user commands
7373
// QUOTE(ТЗ): n/a
7474
// REF: PR-281-coderabbit-sshUser-validation
7575
// SOURCE: n/a
76-
// FORMAT THEOREM: forall u: isUnixUserName(u) -> not contains_shell_metacharacters(u)
76+
// FORMAT THEOREM: forall u: isUnixUsername(u) -> not contains_shell_metacharacters(u)
7777
// PURITY: CORE
7878
// INVARIANT: accepted user names contain only lowercase Linux account-name characters
7979
// COMPLEXITY: O(n)/O(1) where n = |value|
80-
export const isUnixUserName = (value: string): boolean => unixUserNamePattern.test(value)
80+
export const isUnixUsername = (value: string): boolean => unixUsernamePattern.test(value)
8181

8282
export interface TemplateConfig {
8383
readonly containerName: string

packages/app/src/docker-git/host-errors.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,7 @@ export type HostError =
5656
export type CliError = ParseError | HostError
5757

5858
const isParseError = (error: CliError): error is ParseError =>
59-
error._tag === "UnknownCommand" ||
60-
error._tag === "UnknownOption" ||
61-
error._tag === "MissingOptionValue" ||
62-
error._tag === "MissingRequiredOption" ||
63-
error._tag === "InvalidOption" ||
64-
error._tag === "UnexpectedArgument"
59+
["UnknownCommand", "UnknownOption", "MissingOptionValue", "MissingRequiredOption", "InvalidOption", "UnexpectedArgument"].includes(error._tag)
6560

6661
const renderApiRequestError = (error: ApiRequestError): string =>
6762
error.displayOnlyMessage === true

packages/app/src/lib/core/auto-agent-flags.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@ export const resolveAutoAgentFlags = (
1414
if (requested === "auto") {
1515
return Either.right({ agentMode: undefined, agentAuto: true })
1616
}
17-
if (requested === "claude" || requested === "codex" || requested === "gemini" || requested === "grok") {
18-
return Either.right({ agentMode: requested, agentAuto: true })
17+
const agentModes: readonly AgentMode[] = ["claude", "codex", "gemini", "grok"]
18+
const matchedMode = agentModes.find((mode) => mode === requested)
19+
if (matchedMode !== undefined) {
20+
return Either.right({ agentMode: matchedMode, agentAuto: true })
1921
}
2022
return Either.left({
2123
_tag: "InvalidOption",

packages/app/src/lib/core/command-builders-shared.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ import {
66
defaultTemplateConfig,
77
isDockerNetworkMode,
88
isGpuMode,
9-
isUnixUserName,
9+
isUnixUsername,
1010
type ParseError,
11-
sshUserNamePatternDescription
11+
sshUsernamePatternDescription
1212
} from "./domain.js"
1313

1414
const parsePort = (value: string): Either.Either<number, ParseError> => {
@@ -106,11 +106,11 @@ export const parseSshUser = (
106106
option: "--ssh-user"
107107
})
108108
}
109-
if (!isUnixUserName(candidate)) {
109+
if (!isUnixUsername(candidate)) {
110110
return Either.left({
111111
_tag: "InvalidOption",
112112
option: "--ssh-user",
113-
reason: `expected Linux user name matching ${sshUserNamePatternDescription}`
113+
reason: `expected Linux user name matching ${sshUsernamePatternDescription}`
114114
})
115115
}
116116
return Either.right(candidate)

packages/app/src/lib/core/domain.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,20 +64,20 @@ export type AgentMode = "claude" | "codex" | "gemini" | "grok"
6464
export type DockerNetworkMode = "shared" | "project"
6565
export type GpuMode = "none" | "all"
6666

67-
const unixUserNamePattern = /^[a-z_][a-z0-9_-]{0,31}$/
67+
const unixUsernamePattern = /^[a-z_][a-z0-9_-]{0,31}$/
6868

69-
export const sshUserNamePatternDescription = "^[a-z_][a-z0-9_-]{0,31}$"
69+
export const sshUsernamePatternDescription = "^[a-z_][a-z0-9_-]{0,31}$"
7070

7171
// CHANGE: define the SSH user name invariant in the core domain
7272
// WHY: generated Dockerfiles and entrypoints interpolate sshUser into shell-sensitive user commands
7373
// QUOTE(ТЗ): n/a
7474
// REF: PR-281-coderabbit-sshUser-validation
7575
// SOURCE: n/a
76-
// FORMAT THEOREM: forall u: isUnixUserName(u) -> not contains_shell_metacharacters(u)
76+
// FORMAT THEOREM: forall u: isUnixUsername(u) -> not contains_shell_metacharacters(u)
7777
// PURITY: CORE
7878
// INVARIANT: accepted user names contain only lowercase Linux account-name characters
7979
// COMPLEXITY: O(n)/O(1) where n = |value|
80-
export const isUnixUserName = (value: string): boolean => unixUserNamePattern.test(value)
80+
export const isUnixUsername = (value: string): boolean => unixUsernamePattern.test(value)
8181

8282
export interface TemplateConfig {
8383
readonly containerName: string

packages/app/src/lib/shell/config.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ import { Effect, Either } from "effect"
99

1010
import {
1111
defaultTemplateConfig,
12-
isUnixUserName,
12+
isUnixUsername,
1313
type ProjectConfig,
14-
sshUserNamePatternDescription
14+
sshUsernamePatternDescription
1515
} from "../core/domain.js"
1616
import { ConfigDecodeError, ConfigNotFoundError } from "./errors.js"
1717
import { resolveBaseDir } from "./paths.js"
@@ -102,12 +102,12 @@ const validateProjectConfig = (
102102
path: string,
103103
config: ProjectConfig
104104
): Effect.Effect<ProjectConfig, ConfigDecodeError> =>
105-
isUnixUserName(config.template.sshUser)
105+
isUnixUsername(config.template.sshUser)
106106
? Effect.succeed(config)
107107
: Effect.fail(
108108
new ConfigDecodeError({
109109
path,
110-
message: `template.sshUser must match ${sshUserNamePatternDescription}`
110+
message: `template.sshUser must match ${sshUsernamePatternDescription}`
111111
})
112112
)
113113

packages/app/src/web/app-terminal-session-handlers.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -183,12 +183,12 @@ const projectTerminalAction = (
183183
projectKey: string | undefined,
184184
terminalSessionId: string | undefined,
185185
action: (projectKey: string, terminalSessionId: string) => void
186-
): (() => void) | undefined =>
187-
projectId === undefined || projectKey === undefined || terminalSessionId === undefined
188-
? undefined
189-
: () => {
190-
action(projectKey, terminalSessionId)
191-
}
186+
): (() => void) | undefined => {
187+
if (projectId === undefined) return undefined
188+
if (projectKey === undefined) return undefined
189+
if (terminalSessionId === undefined) return undefined
190+
return () => { action(projectKey, terminalSessionId) }
191+
}
192192

193193
export const useProjectActionHandlers = (
194194
{ onOpenTaskManagerRequest, projectId, projectKey, projectLabel, setMessage, terminalSessionId }:

0 commit comments

Comments
 (0)