{"record":{"id":"970d5a56914ec9e7","repo":"denoland/deno","slug":"no-rules-have-been-configured-970d5a","errorCode":null,"errorMessage":"No rules have been configured","messagePattern":"No rules have been configured","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/tools/lint/rules/mod.rs","lineNumber":160,"sourceCode":"pub struct LintRuleProvider {\n  workspace_resolver: Option<Arc<WorkspaceResolver<CliSys>>>,\n}\n\nimpl LintRuleProvider {\n  pub fn new(\n    workspace_resolver: Option<Arc<WorkspaceResolver<CliSys>>>,\n  ) -> Self {\n    Self { workspace_resolver }\n  }\n\n  pub fn resolve_lint_rules_err_empty(\n    &self,\n    rules: LintRulesConfig,\n    maybe_workspace_dir: Option<&WorkspaceDirectory>,\n  ) -> Result<ConfiguredRules, AnyError> {\n    let lint_rules = self.resolve_lint_rules(rules, maybe_workspace_dir);\n    if lint_rules.rules.is_empty() {\n      bail!(\"No rules have been configured\")\n    }\n    Ok(lint_rules)\n  }\n\n  pub fn all_rules(&self) -> Vec<CliLintRule> {\n    let deno_lint_rules = deno_lint::rules::get_all_rules();\n    let cli_lint_rules = vec![CliLintRule(CliLintRuleKind::Extended(\n      Box::new(no_sloppy_imports::NoSloppyImportsRule::new(\n        self.workspace_resolver.clone(),\n      )),\n    ))];\n    let cli_graph_rules = vec![CliLintRule(CliLintRuleKind::Package(\n      Box::new(no_slow_types::NoSlowTypesRule),\n    ))];\n    deno_lint_rules\n      .into_iter()\n      .map(|rule| CliLintRule(CliLintRuleKind::DenoLint(rule)))\n      .chain(cli_lint_rules)","sourceCodeStart":142,"sourceCodeEnd":178,"githubUrl":"https://github.com/denoland/deno/blob/9ad36f7a2cce60488e6ec52283efb32efddaf93a/cli/tools/lint/rules/mod.rs#L142-L178","documentation":"Thrown by `deno lint` after rule resolution when the configured rule set resolves to zero rules. The CLI refuses to lint because running with no rules would silently report nothing while appearing to succeed. It comes from `resolve_lint_rules_err_empty` (cli/tools/lint/rules/mod.rs:153), called once from the lint command entry (cli/tools/lint/mod.rs:606).","triggerScenarios":"Running `deno lint` when the deno.json lint config disables every rule, e.g. `{\"lint\": {\"rules\": {\"tags\": {\"recommended\": false}}}}` with no other rules included, or excluding/excluding-by-tag the full set so `ConfiguredRules.rules` is empty.","commonSituations":"A deno.json copied from a strict template that turns off the `recommended` tag, or a config that only uses `exclude` lists; also projects that intentionally run with one custom tag and forget to include it.","solutions":["Add at least one rule source to deno.json: `{\"lint\": {\"rules\": {\"tags\": {\"recommended\": true}}}}` or list specific rules under `include`.","If you truly want zero lint checks, remove/disable the lint step in CI instead of emptying the rule set.","Check for a stray `--config` pointing at a minimal deno.json that omits the `lint` section while the main config had rules.","Run `deno lint --rules` to inspect what the current config resolves to."],"exampleFix":"// deno.json (before)\n{\n  \"lint\": { \"rules\": { \"tags\": { \"recommended\": false } } }\n}\n// deno.json (after)\n{\n  \"lint\": { \"rules\": { \"tags\": { \"recommended\": true } } }\n}","handlingStrategy":"validation","validationCode":"// Before running lint, assert the config yields rules (Node wrapper example)\nimport { readFileSync } from \"node:fs\";\nconst cfg = JSON.parse(readFileSync(\"deno.json\", \"utf8\")).lint ?? {};\nconst tagsOff = cfg.rules?.tags?.recommended === false;\nconst hasInclude = Array.isArray(cfg.rules?.include) && cfg.rules.include.length > 0;\nif (tagsOff && !hasInclude) {\n  console.error(\"lint config resolves to zero rules; add a tag or include list\");\n  process.exit(1);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never ship `{\"tags\": {\"recommended\": false}}` without a replacement rule source.","Run `deno lint` once locally after editing lint config; empty rule sets fail loudly and early.","Treat lint config changes like code: review them in CI."],"tags":["lint","config","rules"],"backgroundTag":"lint-rules-not-configured","analyzedSha":"9ad36f7a2cce60488e6ec52283efb32efddaf93a","analyzedAt":"2026-08-20T13:07:44.778Z","schemaVersion":2},"datasetVersion":"2026-08-31T09:17:48.483Z"}