ESLint plugin providing linting rules for Jasmine test suites. Current stable version is 4.2.2 (September 2024). Release cadence is irregular with minor patches and occasional feature releases. Key differentiators: it is the most widely used ESLint plugin for Jasmine, with a comprehensive set of rules covering common anti-patterns like focused tests, disabled tests, missing expectations, and improper use of spies. Includes a recommended configuration. Note: v4.2.0+ supports ESLint v9 flat config with some caveats (beta). Requires Node >=8 and npm >=6. Alternative: eslint-plugin-jasmine-no-describe-variables (lighter scope).
npm install eslint-plugin-jasmineVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to set up eslint-plugin-jasmine using both legacy .eslintrc and flat config. Includes enabling the plugin, setting the Jasmine environment, extending the recommended config, and customizing rules.
Follow flat config example in README. Use stable v4.1.x if not ready for betas.
Remove rule from config; use built-in ESLint valid-expect or other rules.
Add env: { jasmine: true } in your ESLint config.Upgrade to v4.2.2 or configure rule to allow no arguments.
Update custom rules to follow ESLint rule format: module.exports = { meta: {...}, create(context) { return {...} } }.Update to eslint-plugin-jasmine@4.1.2+ and ensure rule name is correct: 'prefer-toBeUndefined' (with two 'e's).
Run npm install --save-dev eslint-plugin-jasmine. Ensure you're in the correct project directory.
Set rule severity to 0, 1, or 2. E.g., 'jasmine/no-focused-tests': 'error' works as well.
Use plugin.languageOptions?.globals or manually set globals. Upgrade to latest version.