You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 31, 2023. It is now read-only.
// Prettier doesn't insert a whitespace before a block comment if it is after a `(` token// Prettier doesn't insert a whitespace character after a block comment if it is immediately followed by a `(` or `)` tokenclassC{name/*comment*/(){}};({name/*comment*/(){}});classFoo{f(/* ... */){}f()/* ... */{}f=(/* ... */)=>{};staticf(/* ... */){};staticf=(/* ... */)=>{};staticf=function(/* ... */){};staticf=functionf(/* ... */){};}letf1=(/* ... */)=>{}(function(/* ... */){})(/* ... */)functionf2(/* ... */){}constobj={f(/* ... */){},f: (/* ... */)=>{},f: function(/* ... */){},f: functionf(/* ... */){}}f(/* ... */);f(a,/* ... */);f(a,/* ... */b);f(/* ... */a,b);letf3=()=>import(a/* ... */);letf4=()=>doThing(a,/* ... */b);if(code===92/* '\' */){}if(code===92/* '\' *//* '\' */){}if(code===92)/* '\' */{}if(code===92){/* '\' */}if(1// Comment){a;}
Prettier
// Prettier doesn't insert a whitespace before a block comment if it is after a `(` token// Prettier doesn't insert a whitespace character after a block comment if it is immediately followed by a `(` or `)` tokenclassC{name/*comment*/(){}}({name/*comment*/(){},});classFoo{f(/* ... */){}f()/* ... */{}f=(/* ... */)=>{};staticf(/* ... */){}staticf=(/* ... */)=>{};staticf=function(/* ... */){};staticf=functionf(/* ... */){};}letf1=(/* ... */)=>{};(function(/* ... */){})(/* ... */);functionf2(/* ... */){}constobj={f(/* ... */){},f: (/* ... */)=>{},f: function(/* ... */){},f: functionf(/* ... */){},};f(/* ... */);f(a/* ... */);f(a,/* ... */b);f(/* ... */a,b);letf3=()=>import(a/* ... */);letf4=()=>doThing(a,/* ... */b);if(code===92/* '\' */){}if(code===92/* '\' *//* '\' */){}if(code===92){/* '\' */}if(code===92){/* '\' */}if(1// Comment){a;}
Rome
// Prettier doesn't insert a whitespace before a block comment if it is after a `(` token// Prettier doesn't insert a whitespace character after a block comment if it is immediately followed by a `(` or `)` tokenclassC{name/*comment*/(){}}({name/*comment*/(){}});classFoo{f(/* ... */){}f()/* ... */{}f=(/* ... */)=>{};staticf(/* ... */){}staticf=(/* ... */)=>{};staticf=function(/* ... */){};staticf=functionf(/* ... */){};}letf1=(/* ... */)=>{};(function(/* ... */){})(/* ... */);functionf2(/* ... */){}constobj={f(/* ... */){},f: (/* ... */)=>{},f: function(/* ... */){},f: functionf(/* ... */){},};f(/* ... */);f(a/* ... */);f(a,/* ... */b);f(/* ... */a,b);letf3=()=>import(a/* ... */);letf4=()=>doThing(a,/* ... */b);if(code===92/* '\' */){}if(code===92/* '\' *//* '\' */){}if(code===92)/* '\' */{}if(code===92){/* '\' */}if(1// Comment){a;}
Expected
Rome's formatting to match Prettier's
The text was updated successfully, but these errors were encountered:
Prettier's rule is more generic than this and overall, uses very different rules for formatting comments than Rome. I'm currently looking into this as part of making our comment formatting more predictable.
Rome always inserts a whitespace character before and after a block comment. Prettier doesn't do so:
(
token(
or)
token.Playground
Input
Prettier
Rome
Expected
Rome's formatting to match Prettier's
The text was updated successfully, but these errors were encountered: