check_shadow_dom_js
Analyzes JavaScript code for anti-patterns that break Shadow DOM encapsulation, such as accessing shadowRoot.querySelector or overwriting slot content.
Instructions
Detects JavaScript anti-patterns that violate Shadow DOM encapsulation from consumer code. Catches: accessing .shadowRoot.querySelector() to bypass encapsulation, calling attachShadow() on existing components, setting innerHTML on web components (overwriting slot content), and using style.cssText instead of CSS custom properties.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| codeText | Yes | JavaScript/TypeScript code to analyze | |
| tagName | No | Optional tag name of the web component for context-aware checks (e.g., "sl-button") |