Unexpected new line before the body of a concise arrow function
See original GitHub issuePrettier 1.15.3 Playground link
--parser babylon
Input:
expect(
() => new GraphQLObjectType({
field1: 'foo',
field2: 'bar'
})
);
Output:
expect(
() =>
new GraphQLObjectType({
field1: "foo",
field2: "bar"
})
);
Expected behavior:
expect(
() => new GraphQLObjectType({
field1: 'foo',
field2: 'bar'
})
);
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (5 by maintainers)
Top Results From Across the Web
Line break within arrow function throws “Uncaught SyntaxError
Show activity on this post. I'm getting the error “Uncaught SyntaxError: Unexpected token => ” on my console when I put the e...
Read more >Arrow function expressions - JavaScript - MDN Web Docs
Arrow functions can have either a concise body or the usual block body. In a concise body, only a single expression is specified,...
Read more >implicit-arrow-linebreak - ESLint - Pluggable JavaScript Linter
An arrow function body can contain an implicit return as an expression instead of a block body ... "below" requires a newline before...
Read more >Arrow Functions in JavaScript: Fat & Concise Syntax - SitePoint
When you only have one expression in your function body, you can make ES6 arrow syntax even more concise. You can keep everything...
Read more >Arrow function expressions - JavaScript
Before arrow functions, every new function defined its own this value based on how ... In a concise body, only an expression is...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
FWIW, this isn’t a result of the expect() special-casing
anyone working on this bug?