Skip to main content

no-hard-code-id

Warn it hard-coded the value of the id attribute when the element is a fragment.

❌ Examples of incorrect code for this rule

<div id="foo"></div>

✅ Examples of correct code for this rule

const id = uid();
<div id={id}></div>;
const Component = ({ id }) => <div id={id}></div>;

Interface

{
"no-hard-code-id": boolean
}

Default Severity

warning