{"record":{"id":"c5a085e9035c995c","repo":"denoland/deno","slug":"prefix-linter-plugin-name-must-not-have-consequt","errorCode":null,"errorMessage":"${prefix}Linter plugin name must not have consequtive hyphens.","messagePattern":"(.+?)Linter plugin name must not have consequtive hyphens\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"cli/js/40_lint.js","lineNumber":499,"sourceCode":"    : \"\";\n  if (typeof plugin !== \"object\") {\n    throw new Error(`${prefix}Linter plugin must be an object`);\n  }\n  if (typeof plugin.name !== \"string\") {\n    throw new Error(`${prefix}Linter plugin name must be a string`);\n  }\n  if (!/^[a-z-]+$/.test(plugin.name)) {\n    throw new Error(\n      `${prefix}Linter plugin name must only contain lowercase letters (a-z) or hyphens (-).`,\n    );\n  }\n  if (plugin.name.startsWith(\"-\") || plugin.name.endsWith(\"-\")) {\n    throw new Error(\n      `${prefix}Linter plugin name must start and end with a lowercase letter.`,\n    );\n  }\n  if (plugin.name.includes(\"--\")) {\n    throw new Error(\n      `${prefix}Linter plugin name must not have consequtive hyphens.`,\n    );\n  }\n  if (typeof plugin.rules !== \"object\") {\n    throw new Error(`${prefix}Linter plugin rules must be an object`);\n  }\n  if (state.installedPlugins.has(plugin.name)) {\n    throw new Error(`Linter plugin ${plugin.name} has already been registered`);\n  }\n  state.plugins.push(plugin);\n  state.installedPlugins.add(plugin.name);\n\n  return {\n    name: plugin.name,\n    ruleNames: Object.keys(plugin.rules),\n  };\n}\n","sourceCodeStart":481,"sourceCodeEnd":517,"githubUrl":"https://github.com/denoland/deno/blob/89f33cbef296a2b287f323d42de54c871fa69c77/cli/js/40_lint.js#L481-L517","documentation":"Thrown by installPlugin() in cli/js/40_lint.js (message spelled \"consequtive\") when the plugin name contains two or more hyphens in a row (plugin.name.includes(\"--\")). Runs after the character-set and edge-hyphen checks, so it only fires for names that are otherwise valid.","triggerScenarios":"A plugin `name` like \"my--plugin\" or \"a---b\"; anything produced by joining parts with hyphens where one part was empty.","commonSituations":"Building the name dynamically, e.g. `\\`my-${scope}-plugin\\`` where `scope` is an empty string; hand-editing a name and accidentally doubling the hyphen.","solutions":["Collapse consecutive hyphens into one: \"my-plugin\"","If the name is generated from parts, filter out empty segments before joining"],"exampleFix":"// before\nconst name = [vendor, \"\", \"plugin\"].join(\"-\"); // \"my--plugin\"\n\n// after\nconst name = [vendor, \"plugin\"].filter(Boolean).join(\"-\"); // \"my-plugin\"","handlingStrategy":"validation","validationCode":"function assertNoConsecutiveHyphens(name) {\n  if (name.includes(\"--\")) {\n    throw new TypeError(`'${name}' must not contain consecutive hyphens`);\n  }\n}","typeGuard":"function hasNoConsecutiveHyphens(name) {\n  return !name.includes(\"--\");\n}","tryCatchPattern":null,"preventionTips":["When composing names from parts, filter empty parts before joining with '-'","Prefer a single hardcoded literal name over string concatenation"],"tags":["lint","plugin","validation","naming"],"backgroundTag":null,"analyzedSha":"89f33cbef296a2b287f323d42de54c871fa69c77","analyzedAt":"2026-08-16T07:54:21.310Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}