{"record":{"id":"f6f41ae5c1162fec","repo":"denoland/deno","slug":"no-target-files-found-f6f41a","errorCode":null,"errorMessage":"No target files found.","messagePattern":"No target files found\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/tools/lint/mod.rs","lineNumber":248,"sourceCode":"  cli_options: &CliOptions,\n  lint_flags: &LintFlags,\n) -> Result<Vec<PathsWithOptions>, AnyError> {\n  let members_lint_options =\n    cli_options.resolve_lint_options_for_members(lint_flags)?;\n  let mut paths_with_options_batches =\n    Vec::with_capacity(members_lint_options.len());\n  for (dir, lint_options) in members_lint_options {\n    let files = collect_lint_files(cli_options, lint_options.files.clone());\n    if !files.is_empty() {\n      paths_with_options_batches.push(PathsWithOptions {\n        dir,\n        paths: files,\n        options: lint_options,\n      });\n    }\n  }\n  if paths_with_options_batches.is_empty() && !lint_flags.permit_no_files {\n    return Err(anyhow!(\"No target files found.\"));\n  }\n  Ok(paths_with_options_batches)\n}\n\ntype WorkspaceModuleGraphFuture =\n  SharedLocal<LocalBoxFuture<'static, Result<Rc<ModuleGraph>, Rc<AnyError>>>>;\n\nstruct WorkspaceLinter {\n  caches: Arc<Caches>,\n  lint_rule_provider: LintRuleProvider,\n  module_graph_creator: Arc<ModuleGraphCreator>,\n  compiler_options_resolver: Arc<CompilerOptionsResolver>,\n  workspace_dir: Arc<WorkspaceDirectory>,\n  reporter_lock: Arc<Mutex<Box<dyn LintReporter + Send>>>,\n  workspace_module_graph: Option<WorkspaceModuleGraphFuture>,\n  has_error: Arc<AtomicFlag>,\n  file_count: usize,\n}","sourceCodeStart":230,"sourceCodeEnd":266,"githubUrl":"https://github.com/denoland/deno/blob/89f33cbef296a2b287f323d42de54c871fa69c77/cli/tools/lint/mod.rs#L230-L266","documentation":"After collecting files for every workspace member, `deno lint` refuses to proceed when the matched set is empty and --permit-no-files was not passed. This is a deliberate guard against silently-successful runs where include/exclude patterns accidentally match nothing (especially in CI).","triggerScenarios":"`deno lint` in a tree with no matching JS/TS files; deno.json lint include/exclude patterns that filter out everything; running from a cwd whose glob base contains no sources.","commonSituations":"Fresh or generated repos with no sources yet; overly broad \"exclude\" entries; monorepo cwd confusion; CI templates linting directories that may legitimately be empty.","solutions":["Verify you are in the intended directory and that source files exist","Review the \"lint\": { \"include\": ..., \"exclude\": ... } block in deno.json and loosen patterns that exclude everything","For directories that may legitimately contain nothing to lint, pass --permit-no-files","Treat --permit-no-files as an explicit per-project decision, not a blanket default"],"exampleFix":"// deno.json before\n\"lint\": { \"include\": [\"src/**/*.ts\"], \"exclude\": [\"src\"] }\n// after\n\"lint\": { \"include\": [\"src/**/*.ts\"] }","handlingStrategy":"validation","validationCode":"# fail with your own message before deno does\nshopt -s globstar nullglob\nfiles=(**/*.mts **/*.cts **/*.ts **/*.tsx **/*.js **/*.jsx)\nif [ ${#files[@]} -eq 0 ]; then\n  echo \"no lintable files under $PWD — check lint include/exclude\" >&2\n  exit 2\nfi\ndeno lint","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep lint include patterns anchored at the package root and minimal","Decide per project whether zero files is acceptable and encode it explicitly with --permit-no-files"],"tags":["lint","files","globs","ci","config"],"backgroundTag":null,"analyzedSha":"89f33cbef296a2b287f323d42de54c871fa69c77","analyzedAt":"2026-08-16T07:54:21.310Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}