denoland/deno · error
No rules have been configured
Error message
No rules have been configured
What it means
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).
Source
Thrown at cli/tools/lint/rules/mod.rs:160
pub struct LintRuleProvider {
workspace_resolver: Option<Arc<WorkspaceResolver<CliSys>>>,
}
impl LintRuleProvider {
pub fn new(
workspace_resolver: Option<Arc<WorkspaceResolver<CliSys>>>,
) -> Self {
Self { workspace_resolver }
}
pub fn resolve_lint_rules_err_empty(
&self,
rules: LintRulesConfig,
maybe_workspace_dir: Option<&WorkspaceDirectory>,
) -> Result<ConfiguredRules, AnyError> {
let lint_rules = self.resolve_lint_rules(rules, maybe_workspace_dir);
if lint_rules.rules.is_empty() {
bail!("No rules have been configured")
}
Ok(lint_rules)
}
pub fn all_rules(&self) -> Vec<CliLintRule> {
let deno_lint_rules = deno_lint::rules::get_all_rules();
let cli_lint_rules = vec![CliLintRule(CliLintRuleKind::Extended(
Box::new(no_sloppy_imports::NoSloppyImportsRule::new(
self.workspace_resolver.clone(),
)),
))];
let cli_graph_rules = vec![CliLintRule(CliLintRuleKind::Package(
Box::new(no_slow_types::NoSlowTypesRule),
))];
deno_lint_rules
.into_iter()
.map(|rule| CliLintRule(CliLintRuleKind::DenoLint(rule)))
.chain(cli_lint_rules)View on GitHub (pinned to 9ad36f7a2c)
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.
Example fix
// deno.json (before)
{
"lint": { "rules": { "tags": { "recommended": false } } }
}
// deno.json (after)
{
"lint": { "rules": { "tags": { "recommended": true } } }
} Defensive patterns
Strategy: validation
Validate before calling
// Before running lint, assert the config yields rules (Node wrapper example)
import { readFileSync } from "node:fs";
const cfg = JSON.parse(readFileSync("deno.json", "utf8")).lint ?? {};
const tagsOff = cfg.rules?.tags?.recommended === false;
const hasInclude = Array.isArray(cfg.rules?.include) && cfg.rules.include.length > 0;
if (tagsOff && !hasInclude) {
console.error("lint config resolves to zero rules; add a tag or include list");
process.exit(1);
} Prevention
- 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.
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- No rules have been configured
- Bench attempted to exit with exit code: ${exitCode}
- Unsupported 'certFile' / 'keyFile' options provided: use 'ce
- Unsupported 'alpnProtocols' option provided. 'h2' and 'http/
- Both 'cert' and 'key' must be provided to enable HTTPS
AI-assisted analysis of denoland/deno@9ad36f7a2c (2026-08-20).
Data as JSON: /api/errors/970d5a56914ec9e7.
Report an issue: GitHub.