Eslint-plugin-react: `no-unknown-property` doesn't prevent use of unknown properties?

Created on 10 Aug 2016  路  5Comments  路  Source: yannickcr/eslint-plugin-react

Today React gave me an "unknown prop" warning:

image
In this example, I gave my div element an abc attribute, which is obviously invalid HTML.

I was surprised that my linter didn't pick up on this. Looking at the documentation, the name and description of the no-unknown-property rule lead me to believe that this should be caught, but that doesn't appear to be the case.

So, I suppose this is a feature request: add a rule to catch invalid DOM properties.

bug enhancement help wanted

All 5 comments

Were you using spread props, or was it an explicit prop directly on a DOM element?

It was explicit.

I definitely think no-unknown-property should be erroring out on all the same DOM element props that React 15.3 now does.

was this fixed at some point? I can confirm it doesn't work as expected :/

@mvirbicianskas no, but a PR would be welcome.

Was this page helpful?
0 / 5 - 0 ratings