denoland/deno · error · Error
Linter plugin name must not have consequtive hyphens.
Error message
${prefix}Linter plugin name must not have consequtive hyphens. What it means
The third naming rule for Deno lint plugins: the name must not contain two hyphens in a row (plugin.name.includes("--") in cli/js/40_lint.js). Like the other checks it runs at plugin install time and keeps names canonical kebab-case. Note the message contains a source-level typo — "consequtive" instead of "consecutive" — so search logs and docs for the exact misspelled text.
Solutions
- Collapse repeated hyphens to a single one: "my--plugin" → "my-plugin".
- If the name is assembled from parts, filter out empty segments before joining with '-'.
- Apply name.replace(/-{2,}/g, "-") at generation time, then re-run `deno lint`.
Example fix
// before
export default {
name: "team--lint-rules",
rules: {},
};
// after
export default {
name: "team-lint-rules",
rules: {},
}; Defensive patterns
Strategy: validation
Validate before calling
const name = raw.replace(/-{2,}/g, "-"); // collapse doubles before exporting
export default { name, rules }; Type guard
/** @param {unknown} name @returns {boolean} */
function hasNoConsecutiveHyphens(name) {
return typeof name === "string" && !name.includes("--");
} Prevention
- If names are generated, run .replace(/-{2,}/g, "-") at build time.
- Remember the error text misspells 'consequtive' — search logs for the exact string.
When it happens
Trigger: Installing a lint plugin whose `name` is "my--plugin", "a---b", or any name containing "--". The name already passed the charset and edge-hyphen checks.
Common situations: Concatenating name parts with '-' where one part is empty ("team" + "-" + "" + "-rules"); hand-editing a name and doubling the hyphen; normalizing "my plugin" to "my--plugin" by mistake.
Related errors
- Linter plugin name must only contain lowercase letters…
- Linter plugin name must start and end with a lowercase…
- Linter plugin rules must be an object
- Destroy hook of " " errored
- Empty node
AI-assisted analysis of denoland/deno@9ad36f7a2c (2026-08-20).
Data as JSON: /api/errors/c5a085e9035c995c.
Report an issue: GitHub.
Appendix: source
Thrown at cli/js/40_lint.js:499
: "";
if (typeof plugin !== "object") {
throw new Error(`${prefix}Linter plugin must be an object`);
}
if (typeof plugin.name !== "string") {
throw new Error(`${prefix}Linter plugin name must be a string`);
}
if (!/^[a-z-]+$/.test(plugin.name)) {
throw new Error(
`${prefix}Linter plugin name must only contain lowercase letters (a-z) or hyphens (-).`,
);
}
if (plugin.name.startsWith("-") || plugin.name.endsWith("-")) {
throw new Error(
`${prefix}Linter plugin name must start and end with a lowercase letter.`,
);
}
if (plugin.name.includes("--")) {
throw new Error(
`${prefix}Linter plugin name must not have consequtive hyphens.`,
);
}
if (typeof plugin.rules !== "object") {
throw new Error(`${prefix}Linter plugin rules must be an object`);
}
if (state.installedPlugins.has(plugin.name)) {
throw new Error(`Linter plugin ${plugin.name} has already been registered`);
}
state.plugins.push(plugin);
state.installedPlugins.add(plugin.name);
return {
name: plugin.name,
ruleNames: Object.keys(plugin.rules),
};
}
View on GitHub (pinned to 9ad36f7a2c)