That solution currently won't work because of a bug in html_codesniffer (https://github.com/squizlabs/HTML_CodeSniffer/pull/94)

I see three options here:
1) Ignore this rule for now
2) Use the other solution
3) Implement our own fork and configure pa11y to use it

What are your thoughts @kabel ?