https://github.com/skellock/gluegun-prettier
A prettier plugin for gluegun.
https://github.com/skellock/gluegun-prettier
gluegun prettier
Last synced: about 1 month ago
JSON representation
A prettier plugin for gluegun.
- Host: GitHub
- URL: https://github.com/skellock/gluegun-prettier
- Owner: skellock
- Created: 2017-04-14T21:35:50.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-04-14T21:53:23.000Z (about 9 years ago)
- Last Synced: 2025-06-02T07:42:45.159Z (about 1 year ago)
- Topics: gluegun, prettier
- Language: JavaScript
- Size: 1.95 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# gluegun-prettier
## format
Formats a string containing JavaScript code through prettier.
```js
const prettierCode = context.prettier.format("console.log ('hi!!' )")
```
## reformat
Reformats an existing file through prettier.
```js
context.prettier.reformat('/path/to/file')
```
## Prettier Options
Both `format` and `reformat` accept a 2nd parameter with [overrides](https://github.com/prettier/prettier#api) for prettier's formatting options.
These are the default options.
```js
{
useTabs: false,
printWidth: 80,
tabWidth: 2,
singleQuote: false,
trailingComma: 'none',
bracketSpacing: true,
jsxBracketSameLine: false,
parser: 'babylon',
semi: true
}
```