Lighthouse: can i configure axe rules somehow

Created on 12 Jun 2019  路  5Comments  路  Source: GoogleChrome/lighthouse

I can see the axe rules defined here in the lighthouse source.

Can I provide a custom config file that I specify in the config-path argument?

I'd like do enable and disable my own rules but struggling to know how to this in lighthouse.

question

All 5 comments

Those are the gather rules which setup gathering config to power those a11y audits. You probably want to look into the Default-Config a11y section as a jumping off place for a custom config. And the config README.md, which explains more about the config that LH uses.

Yeah you should be able to add a custom config with the config-path flag:

lighthouse --config-path=path/to/custom-config.js https://example.com

@exterkamp's excellent custom config suggestion will let you receive fewer of our a11y audit results and let you run your own audits and gatherers to collect whatever you need. If you're hoping to change what our invocation of axe is running under the hood though, that's currently not possible. You will need to create a custom gatherer that runs axe separately with the extra rules you want, and then create custom audits for each rule you enable.

Thank you for the answers. I am really struggling with how to create my own accessibility audit.

Do you have an example file?

Yes see our custom audit recipe @dagda1

Let us know if our docs are unclear on how to proceed. thanks.

But perhaps you'd find more value in the Axe browser extension. https://chrome.google.com/webstore/detail/axe/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US

Was this page helpful?
0 / 5 - 0 ratings

Related issues

workjalexanderfox picture workjalexanderfox  路  3Comments

wizardnet972 picture wizardnet972  路  3Comments

motiejuss picture motiejuss  路  3Comments

mbparvezme picture mbparvezme  路  3Comments

bitttttten picture bitttttten  路  3Comments