This package (eslint-plugin-flow) is a legacy alias for eslint-plugin-flowtype, which provides Flowtype linting rules for ESLint. The current stable version of eslint-plugin-flowtype is 8.0.3 (October 2021). The package enforces Flow type annotations with over 30 rules, including type-id-match, no-weak-types, and sort-type-union-intersection-members. It is designed for projects using Flow with ESLint 8+. Key differentiators: it is the most mature Flow linting plugin, supports ESLint 8, and is maintained by the community. However, note that this alias package is deprecated and should be replaced with eslint-plugin-flowtype directly.
npm install eslint-plugin-flowVerified import paths — ran on the pinned version, not inferred.
This shows how to configure ESLint with the flowtype plugin using recommended config and custom rules. Avoid the deprecated eslint-plugin-flow package.
Upgrade ESLint to version 8 or later, or use eslint-plugin-flowtype@^7 if you must stay on ESLint 7.
Use Node.js 12 or later.
Replace 'eslint-plugin-flow' with 'eslint-plugin-flowtype' in your package.json and update all imports/requires.
In .eslintrc, use: plugins: ['flowtype'] and rules: { 'flowtype/no-weak-types': 2 }.Ensure your Flow version is compatible with the rule semantics (e.g., sort-type-union-intersection-members requires Flow 0.155+).
npm install --save-dev eslint-plugin-flowtype and replace all references.
Use valid rule names like 'flowtype/no-weak-types' in rules.
The default export is an object, not a function. Use it as part of ESLint's plugin system.