Tools
In order to properly work, each Ink checkbox needs an id
. This rule prevents non-functional checkboxes by enforcing the use of ids on Checkbox
and NewCheckbox
and throwing an error when an id is not provided.
Recommended Severity: error
rules: {'@carta/ink-rules/checkbox-with-id': 2,}
Checkbox
and NewCheckbox
.
<NewCheckbox />
<Checkbox />
<NewCheckbox id="any-id" />
<Checkbox id="any-other-id" />
Don't
Use Checkboxes without ids
Do
Add ids to your Checkboxes so they can properly work
<NewCheckbox />
<Checkbox />
Don't
Use Checkboxes without ids
<NewCheckbox id="any-id" />
<Checkbox id="any-other-id" />
Do
Add ids to your Checkboxes so they can properly work
To investigate how this rule works, check out this gist on AST Explorer.
Is this page helpful?