react/no-adjacent-inline-elements
eslint-plugin-react
No autofix
eslint.config.js
import react from "eslint-plugin-react";
export default [
{
plugins: { react },
rules: {
"react/no-adjacent-inline-elements": "error",
},
},
];Disallow adjacent inline elements not separated by whitespace.
<div><a></a><a></a></div>
<div><a></a><span></span></div>
React.createElement("div", undefined, [React.createElement("a"), React.createElement("span")]);<div><div></div><div></div></div>
<div><a></a> <a></a></div>
React.createElement("div", undefined, [React.createElement("a"), " ", React.createElement("a")]);Examples from the ESLint documentation.
No tracked preset enables this rule, so it has no reach yet.
None of the tracked presets enable this rule. Turn it on with the config below.
react/no-adjacent-inline-elements
eslint-plugin-react
import react from "eslint-plugin-react";
export default [
{
plugins: { react },
rules: {
"react/no-adjacent-inline-elements": "error",
},
},
];Oxlint does not have this rule.
Biome does not have this rule.
Enforce React components to have a shouldComponentUpdate method
Require or prevent a new line after jsx elements and expressions.