Skip to content

rule bool attribute value

Hanxing Yang edited this page Jul 9, 2016 · 2 revisions

name

bool-attribute-value

description

Value of boolean attributes should not be set. If found set, it reports.

sample

<!-- Bad -->
<script async="true"></script>
<input type="checkbox" value="1" checked>
<script defer="true"></script>
<input type="text" disabled="true">
<input type="text" readonly="true">
<input type="text" required="true">
  
<!-- Good -->
<script async></script>
<input type="checkbox" value="1" checked="true">
<script defer></script>
<input type="text" disabled>
<input type="text" readonly>
<input type="text" required>

code

  • 003

    Value of boolean attributes found set.

config

  • true

    Do check / format.

  • false

    Do not check / format.

format support

No.

Clone this wiki locally