Skip to content

eslint crash because of react/no-adjacent-inline-elements #2575

Closed
@CleyFaye

Description

@CleyFaye

Versions:

  • eslint-plugin-react: 7.18.3
  • eslint: 6.8.0
  • react: 16.12.0

When enabling the rule "react/no-adjacent-inline-elements", the following code causes eslint to crash:

React.createElement(a, b);

Minimal .eslintrc.js that trigger the issue:

module.exports = {
  plugins: ["react"],
  rules: {"react/no-adjacent-inline-elements": ["warn"]},
};

(setting react version does not change the issue)

Output:

$ npx eslint index.js 
Cannot read property 'elements' of undefined
Occurred while linting …/index.js:1

Expected:
Not crashing eslint, even if something's wrong with the code :)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions