Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F7188132
prettier.ts
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
514 B
Referenced Files
None
Subscribers
None
prettier.ts
View Options
import
Prettier
from
"prettier"
;
import
{
Options
}
from
"prettier"
;
import
_locreq
from
"locreq"
;
const
target_locreq
=
_locreq
(
process
.
cwd
());
export
async
function
getPrettierConfig
(
parser
=
"typescript"
)
:
Promise
<
Options
>
{
return
{
...(
await
Prettier
.
resolveConfig
(
target_locreq
.
resolve
(
"src/back/routes"
)
)),
parser
,
};
}
export
async
function
formatWithPrettier
(
content
:
string
,
lang
=
"typescript"
)
:
Promise
<
string
>
{
return
Prettier
.
format
(
content
,
await
getPrettierConfig
(
lang
));
}
File Metadata
Details
Attached
Mime Type
text/x-java
Expires
Tue, Jul 8, 07:53 (1 d, 5 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
624983
Default Alt Text
prettier.ts (514 B)
Attached To
Mode
rSGEN sealgen
Attached
Detach File
Event Timeline
Log In to Comment