## Prevent accessing the immediate children of this.template (no-template-children) Directly accessing the shadow root children elements via `this.template` can produce inconsistent results across browsers and across native and synthetic shadow DOM. This rule prevents accessing these unsafe properties. ### Rule details Let's assume a `Test` component with the following template: ```html ``` The `Test` component will have to get a reference to the `
` element rendered in its shadow tree. Example of **incorrect** code: ```js import { LightningElement } from 'lwc'; export default class Test extends LightningElement { renderedCallback() { const element = this.template.firstChild; // ^ Accessing firstChild on this.template is unsafe. } } ``` In the code above, accessing `firstChild` on `this.template` could return the following results: - A `