Move DOM bridge lint exclusions to Biome includes

This commit is contained in:
murashit 2026-06-27 15:10:08 +09:00
parent e39d4b90a4
commit e5f65736d6
3 changed files with 18 additions and 4 deletions

View file

@ -47,7 +47,16 @@
// UI and DOM source boundaries.
{
"path": "./scripts/lint/no-implicit-dom-bridges.grit",
"includes": ["**/src/**/*.ts", "**/src/**/*.tsx"]
"includes": [
"**/src/**/*.ts",
"**/src/**/*.tsx",
"!**/src/**/*.dom.ts",
"!**/src/**/*.dom.tsx",
"!**/src/**/*.obsidian.ts",
"!**/src/**/*.obsidian.tsx",
"!**/src/**/*.measure.ts",
"!**/src/**/*.measure.tsx"
]
},
{
"path": "./scripts/lint/no-dom-events-imports.grit",
@ -64,7 +73,14 @@
},
{
"path": "./scripts/lint/no-ui-root-imports.grit",
"includes": ["**/src/**/*.ts", "**/src/**/*.tsx"]
"includes": [
"**/src/**/*.ts",
"**/src/**/*.tsx",
"!**/src/**/*.dom.ts",
"!**/src/**/*.dom.tsx",
"!**/src/**/*.obsidian.ts",
"!**/src/**/*.obsidian.tsx"
]
},
{
"path": "./scripts/lint/no-uncontrolled-preact-form-state.grit",

View file

@ -50,7 +50,6 @@ or {
`$target.defaultView` as $stmt,
`$target.style.$property` as $stmt
} where {
not { $filename <: r".*\.(?:dom|obsidian|measure)\.tsx?$" },
not { $stmt <: `$target.addEventListener("abort", $...)` },
not { $stmt <: `$target.removeEventListener("abort", $...)` },
register_diagnostic(span=$stmt, message="Keep DOM reads, writes, measurements, hit-tests, focus, and event wiring in files named with a .dom, .obsidian, or .measure suffix.", severity="error")

View file

@ -12,6 +12,5 @@ private pattern js_module_reference() {
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")
}