{"id":19699,"library":"eslint-plugin-bdd","title":"eslint-plugin-bdd","description":"This ESLint plugin provides rules to enforce best practices and prevent common mistakes in BDD-style test suites, such as accidentally leaving focused tests (fit, fdescribe, etc.) or excluded tests (xit, xdescribe). Version 2.1.1 is the current stable release, with a lightweight peer dependency on ESLint >=0.8.0. Unlike similar plugins targeting specific frameworks (mocha, jasmine), this plugin covers multiple BDD frameworks with generic rules.","status":"active","version":"2.1.1","language":"javascript","source_language":"en","source_url":"ssh://git@github.com/nate-wilkins/eslint-plugin-bdd","tags":["javascript","eslintplugin","eslint-plugin","eslint","bdd","tdd","testing","focus","exclude"],"install":[{"cmd":"npm install eslint-plugin-bdd","lang":"bash","label":"npm"},{"cmd":"yarn add eslint-plugin-bdd","lang":"bash","label":"yarn"},{"cmd":"pnpm add eslint-plugin-bdd","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Required as a peer dependency to provide the ESLint runtime environment for the plugin rules.","package":"eslint","optional":false}],"imports":[{"note":"The plugin is typically used via ESLint configuration file, not imported directly. Use plugins: ['bdd'] in .eslintrc or import for custom rule configuration.","wrong":"","symbol":"Plugin object","correct":"import plugin from 'eslint-plugin-bdd' // or const plugin = require('eslint-plugin-bdd')"},{"note":"Rules must be referenced with the plugin prefix 'bdd/' in your ESLint configuration.","wrong":"rules: { 'focus': 2 } // Missing plugin prefix","symbol":"Rules","correct":"// Configure rules in .eslintrc: rules: { 'bdd/focus': 2, 'bdd/exclude': 1 }"}],"quickstart":{"code":"// .eslintrc.json\n{\n  \"plugins\": [\"bdd\"],\n  \"rules\": {\n    \"bdd/focus\": \"error\",\n    \"bdd/exclude\": \"warn\"\n  }\n}\n\n// Example test file that will be flagged:\ndescribe('suite', () => {\n  it('test', () => { /* ... */ });\n  fit('focused test', () => { /* ... */ }); // Error: focused test\n});","lang":"javascript","description":"Shows how to configure eslint-plugin-bdd in .eslintrc and demonstrates rule detection of a focused test."},"warnings":[{"fix":"Consider supplementing with framework-specific plugins for more comprehensive coverage.","message":"The plugin only provides two rules (focus and exclude). It does not cover all BDD anti-patterns or framework-specific features.","severity":"gotcha","affected_versions":">=2.0.0"},{"fix":"Use ESLint comment overrides or configure rule options if available. Check docs for regex options.","message":"The focus rule may produce false positives for legitimate test names containing 'fit' or 'fdescribe' as substrings.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Set rule severity to 'warn' or disable it during development.","message":"The exclude rule treats 'xit', 'xdescribe', etc. as errors, but these are sometimes intentionally used during development.","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 eslint-plugin-bdd --save-dev","cause":"Package not installed or not in node_modules.","error":"Error: Cannot find module 'eslint-plugin-bdd'"},{"fix":"Use 0, 1, 2 or 'off', 'warn', 'error' (as string) for rule severity.","cause":"Invalid severity value in ESLint config.","error":"Configuration for rule \"bdd/focus\" is invalid: Severity should be one of the following: 0 = off, 1 = warn, 2 = error"},{"fix":"Add \"bdd\" to plugins array in .eslintrc and ensure package is installed.","cause":"Plugin not listed in plugins array or package not installed.","error":"ESLint couldn't find the plugin \"eslint-plugin-bdd\"."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}