1

I'm looking for an ESLint or Prettier plugin that is going to format my React code in the following way:

Javascript

Single, or double function calls, and function declarations are on single lines, three or more arguments format on separate lines.

eg.

function foo(alpha, beta) {
   //
}

foo("biz", 'baz"); 

function bar(
   alpha, 
   beta, 
   charlie
){
    //
}

bar(
 "a", 
 "b", 
 "c"
); 

JSX

All tags format arguments on new lines:

<MyComponent
    foo = {foo}
    bar = "bar" 
    classes = {{
      foo: classes.foo
      innerObj: {
         biz: "bash"
      }
    }}
/> 

Is there an existing ESLint or Prettier plugin that will give me this kind of formatting?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.