Registry / testing / eslint-plugin-protractor

eslint-plugin-protractor

JSON →
library2.1.1jsnpmunverified

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.

npm install eslint-plugin-protractor
INSTALL
IMPORT
SIG · ESLINT-PLUGIN-PROT
E
eslint-plugin-protractor
testingjavascriptv2.1.1
Install
—
Import
—
Disk
—
Pass rate
0/ 6
Env Coverage0 / 6
glibc
18–22
musl
18–22
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18–226 runs
build_error
glibc
node 18–226 runs
build_error
Code
Verified usage

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

plugin
✓ const protractorPlugin = require('eslint-plugin-protractor');
✗ import protractorPlugin from 'eslint-plugin-protractor';
Plugin is typically used in .eslintrc config, not imported directly. If used programmatically, CommonJS require is expected. ESM import may not work without interop.
rules
✓ rules: { 'protractor/no-promise-in-if': 'error' }
✗ rules: { 'no-promise-in-if': 'error' }
When configuring rules in .eslintrc, always prefix rule names with 'protractor/' to avoid conflicts with other plugins.
configs
✓ extends: ['plugin:protractor/recommended']
✗ extends: ['protractor/recommended']
Use the 'plugin:' prefix to reference plugin configs. Omitting it will not load the config correctly.

Shows installation and basic configuration of eslint-plugin-protractor in .eslintrc to enable rules for Protractor test files.

// Install: npm install --save-dev eslint eslint-plugin-protractor // .eslintrc.yml plugins: - protractor rules: protractor/no-promise-in-if: error protractor/missing-perform: warn protractor/no-array-finder-methods: error
Debug
Known issues
breakingVersion 2.0.0 requires ESLint >= 6.x; older ESLint versions are incompatible.
fix
Upgrade ESLint to version 6 or later, or use plugin version 1.x for ESLint <6.
affects: >=2.0.0
deprecatedRule 'no-get-inner-outer-html' warns about deprecated Protractor methods getInnerHtml() and getOuterHtml() which are removed in newer Protractor versions.
fix
Use Protractor's getAttribute('innerHTML') or similar alternatives. The rule will flag usage.
affects: >=2.0.0
gotchaRule 'array-callback-return' may produce false positives if used with non-standard ElementArrayFinder methods that do not require return values.
fix
Disable rule for specific patterns or file globs if false positives occur.
affects: >=1.0.0
gotchaPlugin is designed for Protractor test files only; applying to non-test code may cause spurious warnings.
fix
Scope ESLint configuration to test file patterns using overrides in .eslintrc.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Failed to load plugin 'protractor' declared in '.eslintrc': Cannot find module 'eslint-plugin-protractor'
eslint-plugin-protractor is not installed or not in node_modules.
fix
Run npm install --save-dev eslint-plugin-protractor and ensure it is in the project's devDependencies.
Configuration for rule 'protractor/no-promise-in-if' is invalid: Value "error" is not a recognized severity.
Using incorrect severity level (e.g., 'warning' instead of 'warn' or 'error').
fix
Use valid severity: 'off', 'warn', or 'error'.
Definition for rule 'protractor/no-promise-in-if' was not found.
Rule name is misspelled or the plugin version does not include that rule.
fix
Check rule names in the plugin documentation and ensure correct spelling (e.g., 'no-promise-in-if').
Upgrade
Version history
2.1.1latest on npm
Audit
Dependencies
eslintrequiredpeer dependency: ESLint is required for the plugin to function; plugin is compatible with ESLint >=2.0.0
Agent activity
4 hits · last 30 days
node
4
Resources
eslint-plugin-protractor — npm install eslint-plugin-protractor · libregistry