# Require or prevent a new line after jsx elements and expressions (`react/jsx-newline`) 🔧 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). ## Rule Details This is a stylistic rule intended to make JSX code more readable by requiring or preventing lines between adjacent JSX elements and expressions. ## Rule Options ```json5 ... "react/jsx-newline": [, { "prevent": , "allowMultilines": }] ... ``` - enabled: for enabling the rule. 0=off, 1=warn, 2=error. Defaults to 0. - prevent: optional boolean. If `true` prevents empty lines between adjacent JSX elements and expressions. Defaults to `false`. - allowMultilines: optional boolean. If `true` and `prevent` is also equal to `true`, it allows newlines after multiline JSX elements and expressions. Defaults to `false`. ## Examples Examples of **incorrect** code for this rule, when configured with `{ "prevent": false }`: ```jsx
``` ```jsx
{showSomething === true && }
``` ```jsx
{showSomething === true && } {showSomethingElse === true ? ( ) : ( )}
``` Examples of **correct** code for this rule, when configured with `{ "prevent": false }`: ```jsx
{showSomething === true && } {showSomethingElse === true ? ( ) : ( )}
``` Examples of **incorrect** code for this rule, when configured with `{ "prevent": true }`: ```jsx
{showSomething === true && } {showSomethingElse === true ? ( ) : ( )}
``` Examples of **correct** code for this rule, when configured with `{ "prevent": true }`: ```jsx
``` ```jsx
{showSomething === true && }
``` ```jsx
{showSomething === true && } {showSomethingElse === true ? ( ) : ( )}
``` Examples of **incorrect** code for this rule, when configured with `{ "prevent": true, "allowMultilines": true }`: ```jsx
{showSomething === true && } {showSomethingElse === true ? ( ) : ( )}
``` Examples of **correct** code for this rule, when configured with `{ "prevent": true, "allowMultilines": true }`: ```jsx
{showSomething === true && } {showSomethingElse === true ? ( ) : ( )}
``` ## When Not To Use It You can turn this rule off if you are not concerned with spacing between your JSX elements and expressions.