language js

private pattern js_module_reference() {
  or {
    JsImport(),
    JsImportCallExpression()
  }
}

js_module_reference() as $stmt where {
  $stmt <: contains `$source` where { $source <: r"^[\"'].*shared/dom/events\.dom[\"']$" },
  register_diagnostic(span=$stmt, message="Import DOM event listener helpers only from explicit .dom, .obsidian, or .measure bridge files.", severity="error")
}
