mirror of
https://github.com/murashit/codex-panel.git
synced 2026-07-22 06:57:10 +00:00
24 lines
832 B
Text
24 lines
832 B
Text
language js
|
|
|
|
private pattern js_module_reference() {
|
|
or {
|
|
JsImport(),
|
|
JsExportNamedFromClause(),
|
|
JsExportFromClause(),
|
|
TsImportType(),
|
|
JsImportCallExpression()
|
|
}
|
|
}
|
|
|
|
or {
|
|
js_module_reference() as $stmt where {
|
|
$stmt <: contains `$source` where { $source <: r"^[\"'].*shared/ui/ui-root\.dom[\"']$" },
|
|
not { $filename <: r".*\.(?:dom|obsidian|measure)\.tsx?$" },
|
|
register_diagnostic(span=$stmt, message="Import the Preact root adapter only from explicit root bridge files.", severity="error")
|
|
},
|
|
`require($source)` as $stmt where {
|
|
$source <: r"^[\"'].*shared/ui/ui-root\.dom[\"']$",
|
|
not { $filename <: r".*\.(?:dom|obsidian|measure)\.tsx?$" },
|
|
register_diagnostic(span=$stmt, message="Import the Preact root adapter only from explicit root bridge files.", severity="error")
|
|
}
|
|
}
|