Registry / testing / eslint-plugin-cucumber

eslint-plugin-cucumber

JSON →
library2.0.0jsnpmunverified

ESLint plugin providing rules for Cucumber step definitions and hooks. The latest stable version is 2.0.0, which updates no-arrow-functions for ESLint 7 compatibility. Released as a major version bump for safety, though the change is backward compatible. Earlier versions (1.x) added features like async-then, expression-type, no-restricted-tags, and no-arrow-functions rules. It supports Cucumber v2+ syntax and is designed to enforce best practices in Cucumber test files. Minimal dependencies, lightweight, and focused on linting step definitions.

npm install eslint-plugin-cucumber
INSTALL
IMPORT
SIG · ESLINT-PLUGIN-CUCU
E
eslint-plugin-cucumber
testingjavascriptv2.0.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
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 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

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

cucumber
Add 'cucumber' to plugins in .eslintrc
require('eslint-plugin-cucumber')
ESLint plugin is loaded via plugins array, not via import/require in code.
async-then
"cucumber/async-then": 2
"cucumber/async-then": "error"
Rule severity can be numeric (0,1,2) or string ('off','warn','error').
expression-type
"cucumber/expression-type": [2, "CucumberExpression"]
"cucumber/expression-type": 2
Rule accepts options as an array after severity.

Configures ESLint to lint Cucumber step definitions with four rules: async-then, expression-type, no-restricted-tags, and no-arrow-functions.

// .eslintrc.json { "plugins": ["cucumber"], "rules": { "cucumber/async-then": 2, "cucumber/expression-type": [2, "CucumberExpression"], "cucumber/no-restricted-tags": [2, "wip", "broken"], "cucumber/no-arrow-functions": 2 } }
Debug
Known issues
breakingv2.0.0 updates no-arrow-functions rule for ESLint 7 compatibility, may break if using older ESLint version.
fix
Update ESLint to version 7 or later.
affects: >=2.0.0
gotchaPlugin must be installed locally if ESLint is installed globally.
fix
Install plugin globally if ESLint is global: npm install -g eslint-plugin-cucumber
affects: all
gotchaRule 'no-arrow-functions' restricts arrow functions on step definitions; may conflict with async/await usage.
fix
Prefer regular functions for step definitions.
affects: >=1.2.0
Errors
Common errors & fixes
ESLint couldn't find the plugin "eslint-plugin-cucumber".
Plugin not installed or not in node_modules.
fix
Run npm install eslint-plugin-cucumber --save-dev
Configuration for rule "cucumber/async-then" is invalid: Value "2" is not a valid severity.
Incorrect rule configuration format.
fix
Use numeric severity or string: "cucumber/async-then": 2 or "cucumber/async-then": "error"
Parsing error: The keyword 'Given' is not defined.
ESLint is parsing step definitions as regular code without Cucumber globals.
fix
Add an environment or use a global define for step keywords.
Upgrade
Version history
2.0.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

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