eslint-plugin-wdio
ESLint rules for WebdriverIO
Installation
You'll first need to install ESLint:
npm i eslint --save-dev
Next, install eslint-plugin-wdio
:
npm install eslint-plugin-wdio --save-dev
Note: If you installed ESLint globally (using the -g
flag) then you must also install eslint-plugin-wdio
globally.
Recommended configuration
This plugin export a recommended configuration that enforce good practices.
With Eslint v8 and below
To enable this configuration use the extends property in your .eslintrc
config file:
{
"plugins": ["wdio"],
"extends": [
"eslint:recommended",
"plugin:wdio/recommended"
]
}
With Eslint v9 and Flat Config
If you are using the latest version of Eslint with the flat configuration, you can embed this plugin as follows:
import { config as wdioConfig } from "eslint-plugin-wdio";
export default [
{
extends: [
wdioConfig['flat/recommended'],
]
}
];
See ESLint documentation for more information about extending configuration files.
List of supported rules