An ESLint plugin providing rules to enforce best practices and catch common errors in Jasmine test suites.
eslint-plugin-jasmine is an ESLint plugin that provides linting rules specifically for projects using the Jasmine testing framework. It helps developers enforce coding standards, prevent common testing errors, and maintain consistency across test suites. The plugin integrates directly with ESLint to catch issues like focused tests, improper spy usage, and structural problems in describe and it blocks.
JavaScript developers and teams who write unit tests with the Jasmine framework and want to improve their test code quality through automated linting. It's particularly valuable for projects with large test suites where consistency and error prevention are critical.
Developers choose this plugin because it provides Jasmine-specific linting rules that aren't available in standard ESLint, helping catch framework-specific anti-patterns early. It offers a recommended configuration that enforces best practices out of the box, reducing configuration time while improving test reliability.
ESLint rules for Jasmine
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
The plugin provides a recommended configuration that enforces good practices out of the box, saving configuration time and ensuring consistency across test suites as highlighted in the README.
It strictly flags focused tests (fit/fdescribe) with an error severity (level 2), reducing the risk of accidentally committing tests that skip others, a key feature mentioned in the rules table.
Rules like new-line-between-declarations enforce structural clarity by organizing test blocks, making code easier to navigate and maintain, as specified in the test structure rules.
Catches Jasmine-specific anti-patterns like unsafe spy usage and duplicate suite names, which standard ESLint rules don't cover, providing targeted error prevention.
Setup differs significantly between ESLint v9 and earlier versions, requiring separate configurations that can confuse users and complicate CI pipelines, as detailed in the usage section.
It provides no value for projects using other testing frameworks, making it a niche tool with restricted applicability and no cross-framework support.
Includes deprecated rules like valid-expect, and some rules like prefer-toBeUndefined are off by default, suggesting uneven maintenance or adoption that might confuse users.