Skip to content

skellock/gluegun-prettier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gluegun-prettier

format

Formats a string containing JavaScript code through prettier.

const prettierCode = context.prettier.format("console.log ('hi!!' )")

reformat

Reformats an existing file through prettier.

context.prettier.reformat('/path/to/file')

Prettier Options

Both format and reformat accept a 2nd parameter with overrides for prettier's formatting options.

These are the default options.

{
  useTabs: false,
  printWidth: 80,
  tabWidth: 2,
  singleQuote: false,
  trailingComma: 'none',
  bracketSpacing: true,
  jsxBracketSameLine: false,
  parser: 'babylon',
  semi: true
}

About

A prettier plugin for gluegun.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published