mirror of
https://github.com/anthropics/claude-code.git
synced 2026-02-19 04:27:33 -08:00
Compare commits
2 Commits
90c07d1c7e
...
claude/sla
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1e1f4306d1 | ||
|
|
d5912a011d |
22
scripts/no-box-in-text.grit
Normal file
22
scripts/no-box-in-text.grit
Normal file
@@ -0,0 +1,22 @@
|
||||
// Biome GritQL Plugin: Prevent <Box> from being nested inside <Text>
|
||||
// This catches the Ink error: "<Box> can't be nested inside <Text> component"
|
||||
|
||||
language js;
|
||||
|
||||
// Match Text elements that contain Box children (direct nesting)
|
||||
`<Text$_>$children</Text>` where {
|
||||
$children <: contains `<Box$_>$_</Box>`,
|
||||
register_diagnostic(
|
||||
span = $children,
|
||||
message = "<Box> can't be nested inside <Text> component. Use <Box> as a sibling or wrap <Text> inside <Box> instead."
|
||||
)
|
||||
}
|
||||
|
||||
// Also match self-closing Box inside Text
|
||||
`<Text$_>$children</Text>` where {
|
||||
$children <: contains `<Box$_ />`,
|
||||
register_diagnostic(
|
||||
span = $children,
|
||||
message = "<Box> can't be nested inside <Text> component. Use <Box> as a sibling or wrap <Text> inside <Box> instead."
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user