@modus/gimbal-plugin-axe
Version:
Plugin to add axe audits to Gimbal
83 lines (60 loc) • 5.04 kB
Markdown
# Gimbal `axe` Plugin
[](https://www.npmjs.com/package/@modus/gimbal-plugin-axe)
[](https://www.npmjs.com/package/@modus/gimbal-plugin-axe)
[](https://circleci.com/gh/ModusCreateOrg/gimbal)
[](http://makeapullrequest.com)
[](./LICENSE)
[](https://moduscreate.com)
The `axe` plugin adds axe auditing to [Gimbal](https://labs.modus.app/gimbal-web-performance-audit-budgeting). This plugin will check for violations reported by axe and check the impact of the violations against the configured thresholds.
## Installation
First, you need to install the plugin to your project:
```sh
# with npm
npm install --save-dev @modus/gimbal-plugin-axe
# or with yarn
yarn add --dev @modus/gimbal-plugin-axe
```
Next, you need to add the plugin to your Gimbal configuration file:
### YAML
```yaml
plugins:
- '@modus/gimbal-plugin-axe'
```
### JSON
```json
{
"plugins": ["@modus/gimbal-plugin-axe"]
}
```
### JavaScript
```javascript
modules.exports = {
plugins: ['@modus/gimbal-plugin-axe'],
};
```
## Configuration
There are three configs that you can change:
- `disabledRules` - An optional string or array of strings that will disable certain rules. For more, see [here](https://www.npmjs.com/package/axe-puppeteer#axepuppeteerdisablerulesrules-string--string).
- `exclude` - An optional string or array of strings that will allow certain CSS selectors to be excluded from the axe analysis. For more, see [here](https://www.npmjs.com/package/axe-puppeteer#axepuppeteerexcludeselector-string--string).
- `include` - An optional string or array of strings that will only allow certain CSS selectors to be included in the axe analysis. For more, see [here](https://www.npmjs.com/package/axe-puppeteer#axepuppeteerincludeselector-string--string).
- `rules` - An optional string or array of strings that will only allow certain axe rules to be run in the axe analysis. For more, see [here](https://www.npmjs.com/package/axe-puppeteer#axepuppeteerwithrulesrules-string--string).
- `showSuccesses` - If set to `false`, the output of the final report will now show the successful rules.
- `tags` - An optional string or array of strings that will allow only the specified rule IDs in the axe analysis. For more, see [here](https://www.npmjs.com/package/axe-puppeteer#axepuppeteerwithtagstags-string--string).
- `threshold` - This is the object of thresholds. Each rule can have it's own threshold.
### Threshold
By default, there is a single threshold that is set to `minor` meaning only minor violations will be allowed. Each rule can have it's own threshold defined:
```yaml
plugins:
- plugin: '@modus/gimbal-plugin-axe'
thresholds:
bypass: serious
```
The acceptable levels in order from least to greater impact are: none, minor, moderate, serious, critical.
### Default Configuration
```yaml
plugins:
- plugin: '@modus/gimbal-plugin-axe'
showSuccesses: true
thresholds:
impact: none
```