{"record":{"id":"653906473f02cbae","repo":"denoland/deno","slug":"lint-watch-on-standard-input-is-not-supported","errorCode":null,"errorMessage":"Lint watch on standard input is not supported.","messagePattern":"Lint watch on standard input is not supported\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/tools/lint/mod.rs","lineNumber":87,"sourceCode":"pub use linter::CliLinterOptions;\npub use plugins::PluginHostProxy;\npub use plugins::PluginLogger;\npub use plugins::create_runner_and_load_plugins;\npub use rules::ConfiguredRules;\npub use rules::LintRuleProvider;\npub use rules::collect_no_slow_type_diagnostics;\n\nconst JSON_SCHEMA_VERSION: u8 = 1;\n\nstatic STDIN_FILE_NAME: &str = \"$deno$stdin.mts\";\n\npub async fn lint(\n  flags: Arc<Flags>,\n  lint_flags: LintFlags,\n) -> Result<(), AnyError> {\n  if flags.watch.is_some() {\n    if lint_flags.is_stdin() {\n      return Err(anyhow!(\"Lint watch on standard input is not supported.\",));\n    }\n\n    return lint_with_watch(flags, lint_flags).await;\n  }\n\n  let factory = CliFactory::from_flags(flags);\n  let cli_options = factory.cli_options()?;\n  let lint_rule_provider = factory.lint_rule_provider().await?;\n  let is_stdin = lint_flags.is_stdin();\n  let compiler_options_resolver = factory.compiler_options_resolver()?;\n  let workspace_lint_options =\n    cli_options.resolve_workspace_lint_options(&lint_flags)?;\n  let success = if is_stdin {\n    lint_stdin(\n      cli_options,\n      lint_rule_provider,\n      workspace_lint_options,\n      lint_flags,","sourceCodeStart":69,"sourceCodeEnd":105,"githubUrl":"https://github.com/denoland/deno/blob/89f33cbef296a2b287f323d42de54c871fa69c77/cli/tools/lint/mod.rs#L69-L105","documentation":"`deno lint` reads source from standard input when no files are given (or '-' is used). Watching requires watchable filesystem paths, so combining --watch with stdin input is rejected up front before anything is linted.","triggerScenarios":"Invoking `deno lint --watch` with no path arguments while data is piped in (or with explicit stdin input), e.g. `cat file.ts | deno lint --watch -`.","commonSituations":"Editor/format-on-save hooks and lint-staged-style pipelines that pipe buffers but reuse a --watch flag from a dev script; CI configs copying a watch-based lint command verbatim.","solutions":["Drop --watch when linting stdin: cat src/mod.ts | deno lint -","Or write the buffer to a temp .ts file and lint that path if you need watching","Reserve --watch for interactive terminal sessions on real paths"],"exampleFix":"# before\ncat src/mod.ts | deno lint --watch -\n# after\ncat src/mod.ts | deno lint -","handlingStrategy":"validation","validationCode":"# strip --watch from the args when stdin is not a tty (input is piped)\nif [ ! -t 0 ]; then\n  set -- $(printf '%s\\n' \"$@\" | grep -v -- '--watch')\nfi\ndeno lint \"$@\" -","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Gate --watch on interactive stdin ([ -t 0 ]) in wrapper scripts","Keep CI lint commands free of --watch entirely"],"tags":["lint","watch","stdin","cli"],"backgroundTag":null,"analyzedSha":"89f33cbef296a2b287f323d42de54c871fa69c77","analyzedAt":"2026-08-16T07:54:21.310Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}