Skip to content

An atom package for the prettier formatter.

License

Notifications You must be signed in to change notification settings

bloom/prettier-atom

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Prettier for Atom Watch on GitHubStar on GitHubTweet

Version Downloads Build Status Code Coverage MIT License All Contributors PRs Welcome

Atom package to format your JavaScript using Prettier. Comes with powerful optional ESLint integration.

Demo

prettier demo

Installation

apm install prettier-atom

Or go to Settings → Install and search for prettier-atom.

Make sure to restart Atom after the package is installed.

Usage

There are two modes you can use:

  • Invoke manually using the keyboard shortcut (if no selection, whole file is formatted): CTRL + ALT + F
  • Automatically format on save (requires enabling in Packages → Prettier → Toggle Format on Save)

If you use ESLint, check the "ESLint Integration" checkbox and *poof*, everything should work (we use Kent Dodds's prettier-eslint plugin under the hood). We will recursively search up the file tree for your package.json and ESLint settings, and use them when formatting.

prettier-eslint demo

More detailed descriptions of each option can be found in the Atom settings for this plugin.

Please open a pull request or file an issue if you notice bugs or something doesn't work as it should!

Troubleshooting

If prettier (or prettier-eslint, if eslint integration is enabled) is not formatting something properly, please make an issue on the relevant GitHub repo. This package is just the Atom integration of those projects.

Some users have reported getting the following error after updating:

Validation Error:
 Option "tabWidth" must be of type:
   number
 but instead received:
   string
 Example:
 {
   "tabWidth": 2
 }

To fix the problem, open you configuration file and manually ensure that there are no quotation marks around the setting. We suspect this may be a bug with Atom.

Inspiration

This repository was created by James Long to go along with his Prettier project. Kent C. Dodds extended Prettier to add eslint --fix integration as prettier-eslint and forked the original prettier-atom plugin to create the prettier-eslint-atom plugin. Because it became clear that the plugins were very similar and thus maintenance made easier by combining the two, Rob Wise merged prettier-eslint-atom back into prettier-atom.

Maintainers

Rob Wise

Contributors

Thanks goes to these people (emoji key):


James Long

💬 💻 📖 🔌 👀

Rob Wise

💻 📖 💬 💡 👀 ⚠️

Kent C. Dodds

💻 📖 🚇

Luca Barone


Arnar Þór Sveinsson

💻

Adam Miskiewicz

💻

Ori Livni

💻

Leon Chen

💻

Christopher Chedeau

💬 💻 🔌

Christoph Geschwind

💻

Andrew Hutchings

💻

David Schnurr

💻

Ryan Cole

💻

Dara Hak

💻 📖

Stephen John Sorensen

💻

Lukas Geiger

💻 ⚠️

Viktor Charypar

💻 ⚠️

Mats Högberg

💻

Roman

💻

vaibhav

💻

Karl Horky

💻

Dan Abramov

💻

Murphy Randle

💻 🐛

This project follows the all-contributors specification. Contributions of any kind are welcome!

LICENSE

MIT

About

An atom package for the prettier formatter.

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 99.8%
  • CSS 0.2%