Files
hyperframes/.oxlintrc.json
James RussoandClaude Opus 5.5 0bdc128cb5 fix(cli): never prompt or auto-install when nobody is at the terminal (#6617)
* fix(cli): never prompt or auto-install when nobody is at the terminal

publish and upgrade called the confirmation prompt with no terminal check.
With stdin from /dev/null, publish exited 13; with an open pipe it hung.
Unattended and without --yes, both now exit 2 before doing any work, and
stderr names --yes (upgrade also names --check).

All prompts and spinners now go through ui/prompts.ts, the only module allowed
to import @clack/prompts (a lint rule and a contract test enforce it). Its
confirm, select, text and password refuse to prompt in an unattended run, and
its spinner prints only the final line, on stderr. init, feedback, catalog and
cloud delete decide whether to ask with isUnattended() instead of a TTY check
of their own.

The background auto-install no longer starts in an unattended run, and the
update notice ("Run: npm install -g ...") is not shown while an install for
that version is pending. CI now counts as set for any value but "false" or "0".

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* test(cli): neutralize agent detection in the catalog offer tests through isAgentDriven

Attendance now reads isAgentDriven(), so that is what the catalog tests stub to
stay independent of the agent running the suite.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-28 07:56:20 +00:00

119 lines
3.7 KiB
JSON

{
"$schema": "https://raw.githubusercontent.com/oxc-project/oxc/main/npm/oxlint/configuration_schema.json",
"categories": {
"correctness": "error"
},
"plugins": ["react", "react-hooks", "typescript"],
"ignorePatterns": [
".scratch/",
"dist/",
"coverage/",
"node_modules/",
"playground/",
"packages/producer/tests/**/src/vendor/**",
"docs/public/catalog/",
"registry/blocks/**/lib/*.iife.js",
"registry/blocks/{glass-shard-title,code-slice-hero,cuboid-carousel,frost-sequence-camera-orbit,orbit-card}/**/*.{js,mjs}",
"registry/blocks/frost-sequence-camera-orbit/source/**",
"chrome/",
"packages/cli/src/media-use/lib/svg-sanitize.mjs"
],
"overrides": [
{
"files": [
"packages/cli/src/capture/**/*.ts",
"packages/cli/src/registry/**/*.ts",
"packages/cli/src/templates/**/*.ts",
"packages/cli/src/telemetry/**/*.ts",
"packages/engine/src/services/browserManager.ts",
"packages/engine/src/services/frameCapture.ts",
"packages/engine/src/services/parallelCoordinator.ts"
],
"excludeFiles": ["**/*.test.ts", "**/*.test.tsx", "packages/cli/src/telemetry/feedback.ts"],
"rules": {
"no-console": [
"error",
{
"allow": ["error", "warn"]
}
]
}
},
{
"files": ["docs/snippets/**/*.jsx", "docs/snippets/**/*.tsx"],
"globals": {
"CodeBlock": "readonly"
},
"rules": {
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "warn"
}
},
{
"files": ["packages/studio/src/**/*.ts", "packages/studio/src/**/*.tsx"],
"excludeFiles": [
"**/*.test.ts",
"**/*.test.tsx",
"**/*TestUtils.ts",
"**/*TestUtils.tsx",
"**/*TestHarness.ts",
"**/*TestHarness.tsx",
"packages/studio/src/utils/studioApiFetch.ts"
],
"rules": {
"no-restricted-globals": [
"error",
{
"name": "fetch",
"message": "Use studioApiFetch (utils/studioApiFetch.ts): it keeps Studio's requests off the preview media's sockets."
}
],
"no-restricted-properties": [
"error",
{
"object": "window",
"property": "fetch",
"message": "Use studioApiFetch (utils/studioApiFetch.ts): it keeps Studio's requests off the preview media's sockets."
},
{
"object": "globalThis",
"property": "fetch",
"message": "Use studioApiFetch (utils/studioApiFetch.ts): it keeps Studio's requests off the preview media's sockets."
},
{
"object": "self",
"property": "fetch",
"message": "Use studioApiFetch (utils/studioApiFetch.ts): it keeps Studio's requests off the preview media's sockets."
}
]
}
},
{
"files": ["packages/cli/src/**/*.ts"],
"excludeFiles": [
"**/*.test.ts",
"packages/cli/src/utils/defineCommand.ts",
"packages/cli/src/ui/prompts.ts"
],
"rules": {
"no-restricted-imports": [
"error",
{
"paths": [
{
"name": "citty",
"importNames": ["defineCommand"],
"message": "Define commands with defineCommand from packages/cli/src/utils/defineCommand.ts so the shared guards and the agent-mode contract test cover them."
},
{
"name": "@clack/prompts",
"message": "Import prompts and spinners from packages/cli/src/ui/prompts.ts: it refuses to prompt when nobody can answer."
}
]
}
]
}
}
]
}