Eslint-plugin-react: "Node must be provided when reporting error if location is not provided" error in 7.12.3

Created on 9 Jan 2019  路  3Comments  路  Source: yannickcr/eslint-plugin-react

Linting this code with 7.12.3 gives me an error "AssertionError [ERR_ASSERTION]: Node must be provided when reporting error if location is not provided":

import React from "react";

export default class Controller extends React.Component {
    handleAdd = id => {
        this.setState((state, { name }) => {
            const item = this.buildItem(id);
        });
    };
}

Looks similar to #2095. Works fine in 7.11.0.

bug

Most helpful comment

Probably so, but this fix passed the test :-) improvements welcome!

All 3 comments

Thanks, ESLint works fine now in my monorepo.

@ljharb looking at your fix, it seems that we're still incorrectly detecting something as a prop being used (where in reality this example is not using any props). I'll see if I get time to figure it out.

Probably so, but this fix passed the test :-) improvements welcome!

Was this page helpful?
0 / 5 - 0 ratings