{"id":26962,"library":"eslint-plugin-webdriverio","title":"eslint-plugin-webdriverio","description":"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.","status":"active","version":"1.0.1","language":"javascript","source_language":"en","source_url":null,"tags":["javascript","eslint","eslintplugin"],"install":[{"cmd":"npm install eslint-plugin-webdriverio","lang":"bash","label":"npm"},{"cmd":"yarn add eslint-plugin-webdriverio","lang":"bash","label":"yarn"},{"cmd":"pnpm add eslint-plugin-webdriverio","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"ESLint plugin names are specified without the 'eslint-plugin-' prefix.","wrong":"plugins: ['eslint-plugin-webdriverio']","symbol":"plugin (eslint-plugin)","correct":"plugins: ['webdriverio']"},{"note":"The environment key includes the plugin name prefix, as 'webdriverio/wdio'.","wrong":"env: { wdio: true }","symbol":"environment (webdriverio/wdio)","correct":"env: { 'webdriverio/wdio': true }"},{"note":"Inline environment directives must also use the full 'webdriverio/wdio' name.","wrong":"/* eslint-env wdio */","symbol":"environment directive","correct":"/* eslint-env webdriverio/wdio */"}],"quickstart":{"code":"// .eslintrc.json\n{\n  \"plugins\": [\"webdriverio\"],\n  \"env\": {\n    \"webdriverio/wdio\": true,\n    \"mocha\": true\n  }\n}\n\n// test.spec.js\n/* eslint-env webdriverio/wdio, mocha */\ndescribe('My test', () => {\n  it('should work', () => {\n    browser.url('https://example.com');\n    const heading = $('h1');\n    console.log(heading.getText());\n  });\n});\n","lang":"javascript","description":"Shows how to configure ESLint with the webdriverio environment to avoid no-undef errors for WebdriverIO globals."},"warnings":[{"fix":"Use 'webdriverio/wdio' in env or eslint-env comment.","message":"Environment must be 'webdriverio/wdio' not just 'wdio'","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use 'webdriverio' in plugins array.","message":"Plugin name in plugins array must be 'webdriverio' not 'eslint-plugin-webdriverio'","severity":"gotcha","affected_versions":">=0.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Ensure .eslintrc is valid JSON and 'env' is an object.","cause":"Using 'env' property incorrectly in .eslintrc (e.g. without proper JSON structure).","error":"Parsing error: The keyword 'env' is reserved"},{"fix":"Add 'plugins: [\"webdriverio\"]' to your ESLint config.","cause":"The plugin is not added to the 'plugins' array.","error":"Environment key \"webdriverio/wdio\" is unknown"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}