{"id":19984,"library":"eslint-plugin-wdio","title":"eslint-plugin-wdio","description":"An ESLint plugin providing WebdriverIO-specific lint rules to catch common mistakes like missing await on expect calls, debug statements left in code, and floating promises. Version 9.27.0, part of the WebdriverIO v9 monorepo, follows ESLint v9 flat config spec. Ships TypeScript types. Key differentiator: integrates with @typescript-eslint to replace generic await-expect rule with no-floating-promise for type-aware checking. Requires ESLint ^9.39.2, globals ^16.5.0, and typescript-eslint ^8.54.0 as peer dependencies. Release cadence: active, multiple minor releases per month.","status":"active","version":"9.27.0","language":"javascript","source_language":"en","source_url":"https://github.com/webdriverio/webdriverio","tags":["javascript","eslint","eslintplugin","eslint-plugin","webdriver","wdio","typescript"],"install":[{"cmd":"npm install eslint-plugin-wdio","lang":"bash","label":"npm"},{"cmd":"yarn add eslint-plugin-wdio","lang":"bash","label":"yarn"},{"cmd":"pnpm add eslint-plugin-wdio","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency: required to run ESLint plugin","package":"eslint","optional":false},{"reason":"Peer dependency: provides global variable definitions for ESLint","package":"globals","optional":false},{"reason":"Peer dependency: required for type-aware no-floating-promise rule and TypeScript support","package":"typescript-eslint","optional":true}],"imports":[{"note":"ESM-only since v9. Use named import from package; CommonJS require may not work as expected with the flat config export.","wrong":"const configs = require('eslint-plugin-wdio').configs;","symbol":"configs","correct":"import { configs } from 'eslint-plugin-wdio';"},{"note":"Access individual rules programmatically. Ensure ESLint v9 flat config environment.","wrong":"const rules = require('eslint-plugin-wdio').rules;","symbol":"rules","correct":"import { rules } from 'eslint-plugin-wdio';"},{"note":"ESLint v9 uses flat config. The old .eslintrc extends syntax is not supported. Use configs['flat/recommended'] from the plugin.","wrong":"export default [ { extends: ['plugin:wdio/recommended'] } ];","symbol":"flat/recommended","correct":"import { configs } from 'eslint-plugin-wdio'; export default [ configs['flat/recommended'] ];"}],"quickstart":{"code":"// eslint.config.mjs\nimport { configs as wdioConfig } from 'eslint-plugin-wdio';\nimport js from '@eslint/js';\n\nexport default [\n  js.configs.recommended,\n  wdioConfig['flat/recommended'],\n  {\n    rules: {\n      'wdio/no-pause': 'warn',\n      'wdio/no-debug': 'error',\n    }\n  }\n];","lang":"javascript","description":"Shows how to configure eslint-plugin-wdio with ESLint v9 flat config, enabling recommended rules and customizing no-pause/no-debug."},"warnings":[{"fix":"Migrate to flat config: use eslint.config.mjs and import { configs } from 'eslint-plugin-wdio' to get the recommended config.","message":"ESLint v9 flat config is required starting from eslint-plugin-wdio v9. Legacy .eslintrc format is not supported.","severity":"breaking","affected_versions":">=9.0.0"},{"fix":"Install typescript-eslint and use 'wdio/no-floating-promise' instead; the recommended config auto-switches if typescript-eslint is detected.","message":"The 'wdio/await-expect' rule is deprecated in favor of 'wdio/no-floating-promise' when using TypeScript with @typescript-eslint.","severity":"deprecated","affected_versions":">=9.0.0"},{"fix":"Set 'type': 'module' in package.json or use .mjs extension for config file and use import syntax.","message":"CommonJS require() may not load the plugin correctly with flat config. Use ES module import.","severity":"gotcha","affected_versions":">=9.0.0"},{"fix":"Run 'npm install globals@^16.5.0 --save-dev'.","message":"The plugin peer dependency on globals ^16.5.0 must be satisfied; otherwise ESLint may fail to resolve globals.","severity":"gotcha","affected_versions":">=9.0.0"},{"fix":"Install 'typescript' and '@typescript-eslint/eslint-plugin' as dev dependencies.","message":"If using TypeScript, the recommended config automatically replaces 'wdio/await-expect' with 'wdio/no-floating-promise', but this requires @typescript-eslint/eslint-plugin and typescript installed.","severity":"gotcha","affected_versions":">=9.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Run 'npm install eslint-plugin-wdio --save-dev'.","cause":"eslint-plugin-wdio is not installed or not in node_modules.","error":"Error: Failed to load plugin 'wdio' declared in 'plugins': Cannot find module 'eslint-plugin-wdio'"},{"fix":"Use: import { configs } from 'eslint-plugin-wdio'; export default [ configs['flat/recommended'] ];","cause":"Importing configs object directly without accessing the correct key, or using CommonJS require() on an ESM-only export.","error":"TypeError: configs is not iterable"},{"fix":"Switch to flat config format: export default [ ... ] and use configs['flat/recommended'].","cause":"Trying to use the old .eslintrc extends syntax with a flat config file.","error":"Configuration for rule 'wdio/await-expect' is invalid: has no 'meta' property"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}