https://github.com/herber/formatted
✨🎨 Simple JavaScript code-formatter
https://github.com/herber/formatted
formatter javascript prettier
Last synced: about 2 months ago
JSON representation
✨🎨 Simple JavaScript code-formatter
- Host: GitHub
- URL: https://github.com/herber/formatted
- Owner: herber
- License: mit
- Created: 2017-12-30T11:13:26.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-12-30T11:14:47.000Z (over 8 years ago)
- Last Synced: 2025-03-17T09:41:13.208Z (over 1 year ago)
- Topics: formatter, javascript, prettier
- Language: JavaScript
- Homepage:
- Size: 3.91 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# Formatted
A simple JavaScript code-formatter powered by [prettier](https://github.com/prettier/prettier)
## Features
- Zero config necessary
- Automatic - you don't need to do anything
- Fully configurable
## Install
```bash
$ npm install -g formatted
```
## Usage
```bash
cd my-project
formatted
# that's it
```
## Configuration
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`.
### Configuration properties
| 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](https://prettier.io/docs/en/options.html)
## License
MIT © [Tobias Herber](http://tobihrbr.com)