Eslint-plugin-react: False Positive: "react/prop-types [PROP_NAME] is missing in props validation" when using stateless components + Flow

Created on 25 Feb 2016  ·  3Comments  ·  Source: yannickcr/eslint-plugin-react

The issue is only applicable when I name my function argument "props" but if I change that, the warning goes away. See screenshots:

screenshot 2016-02-25 17 47 11
screenshot 2016-02-25 17 48 07

bug flow rule

Most helpful comment

FYI - My issue was a bug with flow (nothing with this plugin!): https://github.com/facebook/flow/issues/1908

All 3 comments

Wow, so much fix. So many speed. Thanks @yannickcr!

I'm seeing this issue with 5.1.1 as not fixed or my configuration is wrong.

Here's my eslintrc:

{
  "parser"  : "babel-eslint",
  "extends" : [
    "standard",
    "standard-react"
  ],
  "env"     : {
    "browser" : true
  },
  "globals" : {
    "__DEV__"      : false,
    "__PROD__"     : false,
    "__DEBUG__"    : false,
    "__COVERAGE__" : false,
    "__BASENAME__" : false
  },
  "rules": {
  }
}
/Users/kross/projects/my-relay-starter-kit/src/App.js
  83:13  error  'routes' is missing in props validation   react/prop-types
  83:21  error  'history' is missing in props validation  react/prop-types
~/p/my-relay-starter-kit ❯❯❯ npm ls eslint-plugin-react                                                                                                                                                                                                                                                                                           ⏎ master ✭ ✱ ◼
[email protected] /Users/kross/projects/my-relay-starter-kit
└── [email protected] 

Do you spot anything I'm doing to misconfigure this?

FYI - My issue was a bug with flow (nothing with this plugin!): https://github.com/facebook/flow/issues/1908

Was this page helpful?
0 / 5 - 0 ratings