• Packages
  • Themes
  • Documentation
  • Blog
  • Discussions
Sign in

atom-auto-prettier

An Atom package that semantically reformats Javascript based on the window size
  • #prettier
  • #javascript
  • #format
gnestor
0.1.1 2,186
3
  • Repo
  • Bugs
  • Versions
  • License
Flag as spam or malicious

📏 atom-auto-prettier

An Atom package that semantically reformats Javascript based on the window size.

Powered by prettier and inspired by refmt for Reason.

🎥 Demo

Without auto-prettier:

Notice how Atom simply breaks lines at whitespace characters:

screenshot

With auto-prettier:

Notice how prettier breaks lines at Javascript-specific boundaries, such as blocks, object properties, and function arguments:

screenshot

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

Install both atom-auto-prettier and prettier-atom via Atom's Install view or via apm:

apm intall atom-auto-prettier prettier-atom

💻 Usage

Use Atom's command palette to toggle auto-prettier on/off or use the CTRL+ALT+SHIFT+F shortcut.

👍 Contributing

See the Atom contributing guidelines

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!

I think this package is bad news.

Good catch. Let us know what about this package looks wrong to you, and we'll investigate right away.

  • Terms of Use
  • Privacy
  • Code of Conduct
  • Releases
  • FAQ
  • Contact
with by