Skip to content

summary-first-child ​

Require summary as first child of details.

Severity ​

error

❌ Incorrect ​

html
<details>
  <p>x</p>
  <summary>S</summary>
</details>

✅ Correct ​

html
<details>
  <summary>S</summary>
  <p>x</p>
</details>

Reference ​

Configuration ​

json
{
  "rules": {
    "summary-first-child": "error"
  }
}

Released under the MIT License.