{"id":19760,"library":"eslint-plugin-flowtype","title":"eslint-plugin-flowtype","description":"ESLint plugin providing Flow type linting rules. Current stable version is 8.0.3, released October 2021. It adds over 40 rules specific to Flow type annotations, such as enforcing type styles, preventing duplicates, and requiring type declarations. Key differentiators: it is the primary ESLint plugin for Flow, with extensive rule coverage and shareable configs. It requires ESLint 8+ and Node 12+. Maintenance is active but may slow as Flow usage declines. Alternative: use TypeScript with `@typescript-eslint` instead.","status":"active","version":"8.0.3","language":"javascript","source_language":"en","source_url":"https://github.com/gajus/eslint-plugin-flowtype","tags":["javascript","eslint","plugin","flowtype"],"install":[{"cmd":"npm install eslint-plugin-flowtype","lang":"bash","label":"npm"},{"cmd":"yarn add eslint-plugin-flowtype","lang":"bash","label":"yarn"},{"cmd":"pnpm add eslint-plugin-flowtype","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency; plugin works as an ESLint plugin","package":"eslint","optional":false},{"reason":"peer dependency; required for parsing Flow syntax with Babel","package":"@babel/plugin-syntax-flow","optional":false},{"reason":"peer dependency; required for React JSX support when using Flow","package":"@babel/plugin-transform-react-jsx","optional":true}],"imports":[{"note":"ESLint automatically adds prefix; just use 'flowtype'.","wrong":"plugins: ['eslint-plugin-flowtype']","symbol":"plugin","correct":"// In .eslintrc: 'plugins': ['flowtype']"},{"note":"Rules must be prefixed with 'flowtype/'.","wrong":"rules: { 'boolean-style': 'error' }","symbol":"rules","correct":"// In .eslintrc: 'rules': { 'flowtype/boolean-style': 'error' }"},{"note":"Use plugin: prefix for shareable configs.","wrong":"extends: ['eslint-plugin-flowtype/recommended']","symbol":"configs","correct":"// In .eslintrc: 'extends': ['plugin:flowtype/recommended']"}],"quickstart":{"code":"// Install: npm install --save-dev eslint eslint-plugin-flowtype @babel/plugin-syntax-flow @babel/plugin-transform-react-jsx\n\n// .eslintrc.json\n{\n  \"plugins\": [\"flowtype\"],\n  \"extends\": [\"plugin:flowtype/recommended\"],\n  \"rules\": {\n    \"flowtype/boolean-style\": [2, \"boolean\"],\n    \"flowtype/define-flow-type\": 1,\n    \"flowtype/delimiter-dangle\": [1, \"never\"],\n    \"flowtype/generic-spacing\": [1, \"never\"],\n    \"flowtype/no-mixed\": 2,\n    \"flowtype/no-primitive-constructor-types\": 2,\n    \"flowtype/no-weak-types\": 2,\n    \"flowtype/object-type-delimiter\": [1, \"comma\"],\n    \"flowtype/require-parameter-type\": 2,\n    \"flowtype/require-return-type\": [2, \"always\", { \"annotateUndefined\": \"never\" }],\n    \"flowtype/require-valid-file-annotation\": 2,\n    \"flowtype/semi\": [1, \"always\"],\n    \"flowtype/space-after-type-colon\": [1, \"always\"],\n    \"flowtype/space-before-generic-bracket\": [1, \"never\"],\n    \"flowtype/space-before-type-colon\": [1, \"never\"],\n    \"flowtype/type-id-match\": [2, \"^([A-Z][a-z0-9]+)+Type$\"],\n    \"flowtype/union-intersection-spacing\": [1, \"always\"],\n    \"flowtype/use-flow-type\": 1,\n    \"flowtype/valid-syntax\": 1\n  }\n}\n\n// Example .js file with Flow\n// @flow\nfunction square(n: number): number {\n  return n * n;\n}","lang":"javascript","description":"Installation and basic ESLint configuration with recommended rules and a simple Flow-annotated function."},"warnings":[{"fix":"Upgrade to ESLint 8+ and Node 12+.","message":"v8.0.0 drops support for ESLint v7 and Node v10.","severity":"breaking","affected_versions":">=8.0.0"},{"fix":"Review changelog for full list of updated dependencies.","message":"v6.0.0 contains potentially breaking dependency updates.","severity":"breaking","affected_versions":">=6.0.0 <7.0.0"},{"fix":"Use Node >=12.","message":"v7.0.0 dropped Node v10 support.","severity":"deprecated","affected_versions":">=7.0.0 <8.0.0"},{"fix":"Use 'flowtype' without prefix.","message":"Adding 'eslint-plugin-flowtype' as plugin name will not work.","severity":"gotcha","affected_versions":">=4.0.0"},{"fix":"Use 'flowtype/rule-name' instead of just 'rule-name'.","message":"Rules must be prefixed with 'flowtype/' in rule configuration.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"npm install --save-dev eslint-plugin-flowtype","cause":"Missing eslint-plugin-flowtype dependency","error":"Error: Failed to load plugin 'flowtype' - Cannot find module 'eslint-plugin-flowtype'"},{"fix":"Use 'plugins': ['flowtype']","cause":"Wrong format for plugins field","error":"Error: ESLint configuration in .eslintrc.json is invalid: \"plugins\" must be an array"},{"fix":"npm install --save-dev @babel/plugin-syntax-flow @babel/plugin-transform-react-jsx","cause":"Missing peer dependency","error":"Error: Cannot find module '@babel/plugin-syntax-flow'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}