Registry / testing / eslint-plugin-webdriverio

eslint-plugin-webdriverio

JSON →
library1.0.1jsnpmunverified

ESLint plugin that provides environment settings for WebdriverIO globals (browser, $, $$). Current stable version is 1.0.1. It is a small, focused plugin that adds a custom environment 'webdriverio/wdio' to ESLint, preventing no-undef errors when using WebdriverIO's globally available helpers. Unlike generic globals configuration, this plugin allows granular control by scoping to the 'wdio' environment, making it easy to combine with other environments like Mocha. Primarily used in WebdriverIO test projects.

npm install eslint-plugin-webdriverio
INSTALL
IMPORT
SIG · ESLINT-PLUGIN-WEBD
E
eslint-plugin-webdriverio
testingjavascriptv1.0.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

plugin (eslint-plugin)
plugins: ['webdriverio']
plugins: ['eslint-plugin-webdriverio']
ESLint plugin names are specified without the 'eslint-plugin-' prefix.
environment (webdriverio/wdio)
env: { 'webdriverio/wdio': true }
env: { wdio: true }
The environment key includes the plugin name prefix, as 'webdriverio/wdio'.
environment directive
/* eslint-env webdriverio/wdio */
/* eslint-env wdio */
Inline environment directives must also use the full 'webdriverio/wdio' name.

Shows how to configure ESLint with the webdriverio environment to avoid no-undef errors for WebdriverIO globals.

// .eslintrc.json { "plugins": ["webdriverio"], "env": { "webdriverio/wdio": true, "mocha": true } } // test.spec.js /* eslint-env webdriverio/wdio, mocha */ describe('My test', () => { it('should work', () => { browser.url('https://example.com'); const heading = $('h1'); console.log(heading.getText()); }); });
Debug
Known issues
gotchaEnvironment must be 'webdriverio/wdio' not just 'wdio'
fix
Use 'webdriverio/wdio' in env or eslint-env comment.
affects: >=1.0.0
gotchaPlugin name in plugins array must be 'webdriverio' not 'eslint-plugin-webdriverio'
fix
Use 'webdriverio' in plugins array.
affects: >=0.0.0
Errors
Common errors & fixes
Parsing error: The keyword 'env' is reserved
Using 'env' property incorrectly in .eslintrc (e.g. without proper JSON structure).
fix
Ensure .eslintrc is valid JSON and 'env' is an object.
Environment key "webdriverio/wdio" is unknown
The plugin is not added to the 'plugins' array.
fix
Add 'plugins: ["webdriverio"]' to your ESLint config.
Upgrade
Version history
1.0.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
2 hits · last 30 days
node
2
Resources
eslint-plugin-webdriverio — npm install eslint-plugin-webdriverio · libregistry