rome-format
v1.0.0
Published
Format code with Rome.
Downloads
6
Readme
rome-format
Format code with Rome.
Install
yarn add rome-format
Usage
import format from 'rome-format'
await format('hello ( "world" )')
// => hello("world");\n
API
format(source, options?)
Returns promise
resolves with formatted code.
source
Type: string
Source code you want to format.
options
Type: object
except formatter.enabled
, formatter.ignore
await format('hello ( "world" )', {lineWidth: 10, semicolons: 'asNeeded'})
// => hello(\n\t"world",\n)\n
options.filePath
Type: string
Related
- prettier-format auto load config and run prettier on code.
- write-prettier-file write formatted code to file.