123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122 |
- function jsx() {
- return (
- // Comment
- <div />
- );
- }
- function unary() {
- return (
- // Comment
- !!x
- );
- }
- function numericLiteralNoParen() {
- return 1337; // Comment
- }
- function logical() {
- return (
- // Reason for 42
- 42
- ) && 84
- }
- function binary() {
- return (
- // Reason for 42
- 42
- ) * 84
- }
- function binaryInBinaryLeft() {
- return (
- // Reason for 42
- 42
- ) * 84 + 2
- }
- function binaryInBinaryRight() {
- return (
- // Reason for 42
- 42
- ) + 84 * 2
- }
- function conditional() {
- return (
- // Reason for 42
- 42
- ) ? 1 : 2
- }
- function binaryInConditional() {
- return (
- // Reason for 42
- 42
- ) * 3 ? 1 : 2
- }
- function call() {
- return (
- // Reason for a
- a
- )()
- }
- function memberInside() {
- return (
- // Reason for a.b
- a.b
- ).c
- }
- function memberOutside() {
- return (
- // Reason for a
- a
- ).b.c
- }
- function memberInAndOutWithCalls() {
- return (
- // Reason for a
- aFunction.b()
- ).c.d()
- }
- function excessiveEverything() {
- return (
- // Reason for stuff
- a.b() * 3 + 4 ? (a`hi`, 1) ? 1 : 1 : 1
- )
- }
- // See https://github.com/prettier/prettier/issues/2392
- // function sequenceExpression() {
- // return (
- // // Reason for a
- // a
- // ), b
- // }
- function sequenceExpressionInside() {
- return ( // Reason for a
- a, b
- );
- }
- function taggedTemplate() {
- return (
- // Reason for a
- a
- )`b`
- }
- function inlineComment() {
- return (
- /* hi */ 42
- ) || 42
- }
|