Command-line interface for BrowserStack Accessibility Linter
npm install @browserstack/accessibility-devtools-cliA command line interface to run accessibility checks on your React and HTML files.
First, install the BrowserStack Accessibility DevTools CLI via npm
``bash`
npm install -g accessibility-devtools-cli
1. Sign up on http://browserstack.com
2. Get your Username and Access Key by logging in to http://browserstack.com and going to Profile → Account & Profile → My Profile → Authentication & Security
3. Set up the two environment variables BROWSERSTACK_USERNAME and BROWSERSTACK_ACCESS_KEY
a. For Zsh, add in ~/.zshrc~/.bashrc
b. For Bash, add in or ~/.bash_profile~/.config/fish/config.fish
c. For Fish Shell, add in
Run the CLI on your file(s) or directory
`bash`
npx accessibility-devtools-cli --include src/**.jsx
``
--version: Show version number
--include or -i: Glob pattern(s) for files to lint
--exclude or -e: Glob pattern(s) for files to exclude from linting
--browserstack-username or -u: BrowserStack username (if not provided, taken from BROWSERSTACK_USERNAME env variable)
--browserstack-access-key or -k: BrowserStack access key (if not provided, taken from BROWSERSTACK_ACCESS_KEY env variable)
-non-strict or -n: Run in non-strict mode (only print violations, do not exit with non-success code)
--help: Show help
0 - no issues
1 - open accessibility issues
2 - BrowserStack connection issues
`bash
#!/usr/bin/env bashIdentify project root
GIT_ROOT=$(git rev-parse --show-toplevel)