A simple JavaScript code-formatter powered by prettier
- Zero config necessary
- Automatic - you don't need to do anything
- Fully configurable
$ npm install -g formatted
cd my-project
formatted
# that's it
Although no configuration is necessary formatted can be configured to your needs.
Custom configurations can be stored in .formattedrc
, formatted.config.js
and in the formatted
property in your package.json
.
Name | Description | Default |
---|---|---|
semi | If set to true expressions must end with a semicolon |
true |
printWidth | The maximum length of a line | 100 |
tabWidth | The number of spaces per indentation-level | 2 |
useTabs | If set to true formatted will indent with tabs |
false |
singleQuote | Use single quotes instead of double quotes | true |
trailingComma | Where to add trailing commas | none |
bracketSpacing | Spaces between brackets in object literals | true |
For more details check out prettier's docs
MIT © Tobias Herber