denoland/deno · error
No rules have been configured
Error message
No rules have been configured
What it means
`deno lint` resolves the configured rule set from deno.json's lint section. If no plugins are registered AND the resolved built-in rule list comes back empty — a lint config that disables/excludes every rule — there is literally nothing to lint with, so the command bails instead of silently passing.
Source
Thrown at cli/tools/lint/mod.rs:348
if is_err {
eprint!("{}", msg);
} else {
print!("{}", msg);
}
}
let mut plugin_runner = None;
if !plugin_specifiers.is_empty() {
let logger = plugins::PluginLogger::new(logger_printer);
let runner = plugins::create_runner_and_load_plugins(
plugin_specifiers,
logger,
exclude,
)
.await?;
plugin_runner = Some(Arc::new(runner));
} else if lint_rules.rules.is_empty() {
bail!("No rules have been configured")
}
let linter = Arc::new(CliLinter::new(CliLinterOptions {
configured_rules: lint_rules,
fix: lint_options.fix,
deno_lint_config: resolve_lint_config(
&self.compiler_options_resolver,
member_dir.dir_url(),
)?,
maybe_plugin_runner: plugin_runner,
}));
let has_error = self.has_error.clone();
let reporter_lock = self.reporter_lock.clone();
let mut futures = Vec::with_capacity(2);
if linter.has_package_rules()
&& let Some(fut) = self.run_package_rules(&linter, &member_dir, &paths)View on GitHub (pinned to 9ad36f7a2c)
Solutions
- Add rules back in deno.json: "lint": { "rules": { "recommended": true } }
- Trim the exclude list so it no longer covers every rule
- If you intended plugin-only linting, register the plugin: "lint": { "plugins": ["./my-plugin.ts"] } (plugins suppress this check)
Example fix
// before — deno.json (everything excluded, no plugins)
{ "lint": { "rules": { "recommended": false, "include": [] } } }
// after
{ "lint": { "rules": { "recommended": true } } }
// or plugin-only linting:
{ "lint": { "plugins": ["./lint-plugin.ts"] } } Defensive patterns
Strategy: validation
Validate before calling
// validate the lint config before running lint (Node/js):
import json from './deno.json' with { type: 'json' };
const lint = json.lint ?? {};
const rules = lint.rules ?? {};
const hasPlugins = (lint.plugins ?? []).length > 0;
const selectsRules =
rules.recommended !== false || (rules.include ?? []).length > 0;
if (!hasPlugins && !selectsRules) {
throw new Error('lint config selects no rules and no plugins');
} Try / catch
Catch lint startup failure; if the message is 'No rules have been configured', rewrite deno.json to add "lint": { "rules": { "recommended": true } } (or register the intended plugin) and retry. Prevention
- Keep "recommended": true (the default) unless you consciously replace it
- Audit exclude lists after Deno upgrades — rule sets grow and excludes can over-match
- Plugin-only setups must declare plugins in deno.json's lint section
When it happens
Trigger: lint_options.plugins is empty and resolve_lint_rules(lint_options.rules, ...) returns an empty rules vec: e.g. a deno.json that excludes the whole recommended set ("rules": { "exclude": [...] } covering all defaults) or otherwise selects zero rules, combined with no plugin entries.
Common situations: Copy-pasted lint configs from older Deno versions whose exclude lists grew to cover everything; configs that define "rules": {} in a nested workspace member where no defaults apply; disabling all rules while intending to use only a plugin, but forgetting to declare the plugin.
Related errors
- No rules have been configured
- Could not get parent of {} ({})
- remote deno.json files are not supported
- `deno {}` is not supported when configuration file contains
- No target files found.
AI-assisted analysis of denoland/deno@9ad36f7a2c (2026-08-20).
Data as JSON: /api/errors/866bbb06cc40438e.
Report an issue: GitHub.