All rules
- aria_role: Elements with ARIA roles must use a valid, non-abstract ARIA role
- django_forms_rendering: Disallows using Django’s convenience form rendering helpers, for which the markup isn’t screen-reader-friendly
- html_has_lang:
<html>
elements must have alang
attribute, using a BCP 47 language tag. - image_alt:
<img>
elements must have aalt
attribute, either with meaningful text, or an empty string for decorative images - indent: Enforce consistent indentation
- meta_viewport: The
viewport
meta tag should not useuser-scalable=no
, andmaximum-scale
should be 2 or above, so end users can zoom - no_autofocus: Enforce autofocus is not used on inputs. Autofocusing elements can cause usability issues for sighted and non-sighted users.
- tabindex_no_positive: Prevents using positive
tabindex
values, which are very easy to misuse with problematic consequences for keyboard users.
#
Try them allHere is a sample configuration with all of Curlylint’s rules enabled. Note this isn’t a recommended configuration, just a convenient way to try it all at once:
- TOML
- Shell
[tool.curlylint.rules]# All role attributes must be valid.# See https://www.curlylint.org/docs/rules/aria_role.aria_role = true# Forms cannot be rendered with as_table, as_ul, or as_p# See https://www.curlylint.org/docs/rules/django_forms_rendering.django_forms_rendering = true# The `lang` attribute must be present.# See https://www.curlylint.org/docs/rules/html_has_lang.html_has_lang = true# The `alt` attribute must be present.# See https://www.curlylint.org/docs/rules/image_alt.image_alt = true# Use tabs.# See https://www.curlylint.org/docs/rules/indent.indent = "tab"# `user-scalable=no` must not be used, and `maximum-scale` should be 2 or above.# See https://www.curlylint.org/docs/rules/meta_viewport.meta_viewport = true# The `autofocus` attribute must not be used.# See https://www.curlylint.org/docs/rules/no_autofocus.no_autofocus = true# Avoid positive `tabindex` values, change the order of elements on the page instead.# See https://www.curlylint.org/docs/rules/tabindex_no_positive.tabindex_no_positive = true
curlylint --rule 'aria_role: true' --rule 'django_forms_rendering: true' --rule 'html_has_lang: true' --rule 'image_alt: true' --rule 'indent: "tab"' --rule 'meta_viewport: true' --rule 'no_autofocus: true' --rule 'tabindex_no_positive: true' .