Skip to content
This repository has been archived by the owner on Aug 31, 2023. It is now read-only.

fix(rome_js_formatter): Arrow with JSX Body #3505

Merged
merged 1 commit into from
Oct 27, 2022
Merged

Commits on Oct 26, 2022

  1. fix(rome_js_formatter): Arrow with JSX Body

    This PR fixes two issues related to formatting arrow function expressions with an arrow body:
    
    ```javascript
    function ArrowBodyIsJsxWithComment({ action }) {
    	return (action) => (
    		// eslint-disable-next-line react/no-array-index-key
    		<li />
    	);
    }
    
    ```
    
    Keep the opening `(` on the same line as the arrow for JSX Tag expressions with a leading comment.
    
    ```javascript
    <div
      onClick={() =>
        doSomething({
          foo: bar
        })
      }
    />;
    ```
    
    Place the closing `}` of the arrow body on a new line if the arrow is inside a jsx attribute
    
    ## Tests
    
    I added new snapshot tests
    Micha Reiser committed Oct 26, 2022
    Configuration menu
    Copy the full SHA
    d6de41b View commit details
    Browse the repository at this point in the history