Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
CleyFaye opened this issue Feb 20, 2020 · 1 comment
Closed

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

CleyFaye opened this issue Feb 20, 2020 · 1 comment

Comments

@CleyFaye
Copy link

CleyFaye commented Feb 20, 2020

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 :)

@ljharb
Copy link
Member

ljharb commented Feb 20, 2020

Ouch, definitely a bug (altho i have no idea how you'd run into this)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants