Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gnestor/atom-auto-prettier
An Atom package that semantically reformats Javascript based on the window size
https://github.com/gnestor/atom-auto-prettier
atom format javascript prettier
Last synced: 3 months ago
JSON representation
An Atom package that semantically reformats Javascript based on the window size
- Host: GitHub
- URL: https://github.com/gnestor/atom-auto-prettier
- Owner: gnestor
- License: mit
- Created: 2017-02-27T22:02:30.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-02-28T21:58:55.000Z (almost 8 years ago)
- Last Synced: 2024-10-14T02:12:33.241Z (3 months ago)
- Topics: atom, format, javascript, prettier
- Language: JavaScript
- Size: 7.81 KB
- Stars: 62
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
# 📏 atom-auto-prettier
An Atom package that semantically reformats Javascript based on the window size.
Powered by [prettier](https://github.com/prettier/prettier) and inspired by [refmt](https://facebook.github.io/reason/tools.html) for Reason.
## 🎥 Demo
### Without auto-prettier:
Notice how Atom simply breaks lines at whitespace characters:
![screenshot](http://g.recordit.co/crI712NXmx.gif)
### With auto-prettier:
Notice how prettier breaks lines at Javascript-specific boundaries, such as blocks, object properties, and function arguments:
![screenshot](http://g.recordit.co/Q7cyk3wk5r.gif)
> Does this package modify my source code?
Yes, in the author of prettier's words: "[Prettier] removes all original styling and ensures that all outputted JavaScript conforms to a consistent style".
## 💾 Install
### atom-auto-prettier depends on [prettier-atom](https://github.com/jlongster/prettier-atom)
Install both **atom-auto-prettier** and **prettier-atom** via Atom's [Install view](http://flight-manual.atom.io/using-atom/sections/atom-packages/#atom-packages) or via [apm](http://flight-manual.atom.io/using-atom/sections/atom-packages/#command-line):
```
apm install atom-auto-prettier prettier-atom
```## 💻 Usage
Use Atom's [command palette](http://flight-manual.atom.io/getting-started/sections/atom-basics/#command-palette) to toggle auto-prettier on/off or use the CTRL+ALT+SHIFT+F shortcut.
## 👍 Contributing
See the Atom [contributing guidelines](https://github.com/atom/atom/blob/master/CONTRIBUTING.md)
### Workflow
* Fork this repo
* Clone your fork
* `git clone https://github.com/[YOUR_NAME]/atom-auto-prettier.git && cd atom-auto-prettier`
* Install dependencies
* `npm install`
* Link your repo (which installs this local version of the package and allows you to test changes in Atom)
* `apm link`
* Reload Atom to test changes
* Atom Command Palette > "Window: Reload"
* Submit a pull request!