Registry / testing / eslint-plugin-flow

eslint-plugin-flow

JSON →
library2.29.1jsnpmunverified

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-flow
INSTALL
IMPORT
SIG · ESLINT-PLUGIN-FLOW
E
eslint-plugin-flow
testingjavascriptv2.29.1
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

plugin as default
import plugin from 'eslint-plugin-flowtype'
const plugin = require('eslint-plugin-flow')
The 'eslint-plugin-flow' package is deprecated; use 'eslint-plugin-flowtype' instead. ESM import works in ESLint 8+.
rules
import { rules } from 'eslint-plugin-flowtype'
const { rules } = require('eslint-plugin-flow')
Accessing rules from the deprecated alias may still work but is not recommended.
configs
import { configs } from 'eslint-plugin-flowtype'
Configs are recommended. Not available in the deprecated alias.

This shows how to configure ESLint with the flowtype plugin using recommended config and custom rules. Avoid the deprecated eslint-plugin-flow package.

// .eslintrc.js module.exports = { plugins: ['flowtype'], extends: ['plugin:flowtype/recommended'], rules: { 'flowtype/boolean-style': [2, 'boolean'], 'flowtype/no-weak-types': 2, }, }; // Install: // npm install --save-dev eslint eslint-plugin-flowtype // Do not use eslint-plugin-flow (deprecated).
Debug
Known issues
breakingeslint-plugin-flowtype v8 drops support for ESLint 7. Requires ESLint 8+.
fix
Upgrade ESLint to version 8 or later, or use eslint-plugin-flowtype@^7 if you must stay on ESLint 7.
affects: >=8.0.0
breakingeslint-plugin-flowtype v7 drops Node.js 10 support.
fix
Use Node.js 12 or later.
affects: >=7.0.0
deprecatedeslint-plugin-flow is deprecated. Use eslint-plugin-flowtype instead.
fix
Replace 'eslint-plugin-flow' with 'eslint-plugin-flowtype' in your package.json and update all imports/requires.
affects: all
gotchaThe plugin's default export is the plugin object, not a function. You cannot use it with ESLint's 'plugin' key incorrectly.
fix
In .eslintrc, use: plugins: ['flowtype'] and rules: { 'flowtype/no-weak-types': 2 }.
affects: >=2.0.0
gotchaSome rules require specific Flow version schemas; not all rules work with older Flow versions.
fix
Ensure your Flow version is compatible with the rule semantics (e.g., sort-type-union-intersection-members requires Flow 0.155+).
affects: >=2.0.0
Errors
Common errors & fixes
Cannot find module 'eslint-plugin-flow'
The package is deprecated and may not be published to npm under that name.
fix
npm install --save-dev eslint-plugin-flowtype and replace all references.
Error: ESLint configuration in .eslintrc is invalid: Environment key "eslint-plugin-flowtype/rules" is not valid.
Using the deprecated alias to try to access rules.
fix
Use valid rule names like 'flowtype/no-weak-types' in rules.
TypeError: plugin is not a function
Attempting to call the default export as a function (e.g., plugin()).
fix
The default export is an object, not a function. Use it as part of ESLint's plugin system.
Upgrade
Version history
2.29.1latest on npm
Audit
Dependencies
eslintrequiredpeer dependency, ESLint 2.0+ compatible, but v8 requires ESLint 8
Agent activity
12 hits · last 30 days
node
10
Resources
eslint-plugin-flow — npm install eslint-plugin-flow · libregistry