eslint-plugin-promise is an ESLint plugin designed to enforce best practices and prevent common pitfalls when working with JavaScript Promises. It ensures proper promise chain construction, error handling, and discourages anti-patterns like callbacks inside `then()` blocks. The current stable version is `7.2.1`, released in November 2024, indicating an active development and maintenance cadence with several releases throughout the year addressing bugs and adding features. Key differentiators include its comprehensive set of rules covering various promise use cases, from enforcing `catch()` or `return` to disallowing multiple resolutions and improper nesting, thereby enhancing code readability and reliability in asynchronous operations. It supports both legacy `.eslintrc.*` configurations and modern ESLint flat configurations.
Verified import paths — ran on the pinned version, not inferred.
For use in `eslint.config.js` with ESLint's new flat configuration system (ESLint v9+).
In legacy `.eslintrc.*` files, plugins are referenced by their short name in the `plugins` array. The plugin is loaded by ESLint itself; direct JavaScript imports are not used for configuration.
Applies the plugin's recommended set of rules for common best practices in `.eslintrc.*`.
Utilizes the plugin's recommended flat configuration object, typically spread into the `export default []` array in `eslint.config.js`.
Demonstrates setting up `eslint-plugin-promise` in an `eslint.config.js` (flat config) file, including importing the plugin, applying its recommended rules, and illustrating some problematic promise patterns the plugin targets.
Breaking-change detection hasn't run for this library yet.
CVE tracking and dependency tree are planned for a later release.