{"id":19882,"library":"eslint-plugin-protractor","title":"eslint-plugin-protractor","description":"ESLint plugin providing lint rules specific to Protractor end-to-end tests for AngularJS applications. Current stable version is 2.1.1, last released in September 2019, with infrequent updates. It helps catch common Protractor errors, enforce best practices for element locators, and avoid deprecated API usage. Differentiates from general ESLint by focusing on Protractor-specific patterns, including rules for correct chaining, promise handling, and locator quality. The plugin is intended to be integrated into IDEs for real-time feedback during test development.","status":"maintenance","version":"2.1.1","language":"javascript","source_language":"en","source_url":"https://github.com/alecxe/eslint-plugin-protractor","tags":["javascript","eslint","eslint-plugin","eslintplugin","protractor"],"install":[{"cmd":"npm install eslint-plugin-protractor","lang":"bash","label":"npm"},{"cmd":"yarn add eslint-plugin-protractor","lang":"bash","label":"yarn"},{"cmd":"pnpm add eslint-plugin-protractor","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency: ESLint is required for the plugin to function; plugin is compatible with ESLint >=2.0.0","package":"eslint","optional":false}],"imports":[{"note":"Plugin is typically used in .eslintrc config, not imported directly. If used programmatically, CommonJS require is expected. ESM import may not work without interop.","wrong":"import protractorPlugin from 'eslint-plugin-protractor';","symbol":"plugin","correct":"const protractorPlugin = require('eslint-plugin-protractor');"},{"note":"When configuring rules in .eslintrc, always prefix rule names with 'protractor/' to avoid conflicts with other plugins.","wrong":"rules: { 'no-promise-in-if': 'error' }","symbol":"rules","correct":"rules: { 'protractor/no-promise-in-if': 'error' }"},{"note":"Use the 'plugin:' prefix to reference plugin configs. Omitting it will not load the config correctly.","wrong":"extends: ['protractor/recommended']","symbol":"configs","correct":"extends: ['plugin:protractor/recommended']"}],"quickstart":{"code":"// Install: npm install --save-dev eslint eslint-plugin-protractor\n// .eslintrc.yml\nplugins:\n  - protractor\nrules:\n  protractor/no-promise-in-if: error\n  protractor/missing-perform: warn\n  protractor/no-array-finder-methods: error\n","lang":"yaml","description":"Shows installation and basic configuration of eslint-plugin-protractor in .eslintrc to enable rules for Protractor test files."},"warnings":[{"fix":"Upgrade ESLint to version 6 or later, or use plugin version 1.x for ESLint <6.","message":"Version 2.0.0 requires ESLint >= 6.x; older ESLint versions are incompatible.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Use Protractor's getAttribute('innerHTML') or similar alternatives. The rule will flag usage.","message":"Rule 'no-get-inner-outer-html' warns about deprecated Protractor methods getInnerHtml() and getOuterHtml() which are removed in newer Protractor versions.","severity":"deprecated","affected_versions":">=2.0.0"},{"fix":"Disable rule for specific patterns or file globs if false positives occur.","message":"Rule 'array-callback-return' may produce false positives if used with non-standard ElementArrayFinder methods that do not require return values.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Scope ESLint configuration to test file patterns using overrides in .eslintrc.","message":"Plugin is designed for Protractor test files only; applying to non-test code may cause spurious warnings.","severity":"gotcha","affected_versions":">=1.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 --save-dev eslint-plugin-protractor and ensure it is in the project's devDependencies.","cause":"eslint-plugin-protractor is not installed or not in node_modules.","error":"Error: Failed to load plugin 'protractor' declared in '.eslintrc': Cannot find module 'eslint-plugin-protractor'"},{"fix":"Use valid severity: 'off', 'warn', or 'error'.","cause":"Using incorrect severity level (e.g., 'warning' instead of 'warn' or 'error').","error":"Configuration for rule 'protractor/no-promise-in-if' is invalid: Value \"error\" is not a recognized severity."},{"fix":"Check rule names in the plugin documentation and ensure correct spelling (e.g., 'no-promise-in-if').","cause":"Rule name is misspelled or the plugin version does not include that rule.","error":"Definition for rule 'protractor/no-promise-in-if' was not found."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}