gitmyhub

prettier-atom

JavaScript ★ 6 updated 9y ago ⑂ fork

An atom package for the prettier formatter.

An Atom editor plugin that automatically formats your JavaScript code using Prettier, either with a keystroke or on every save, optionally respecting your ESLint rules.

JavaScriptAtomsetup: easycomplexity 1/5

Prettier for Atom

This is a plugin that automatically formats your JavaScript code in the Atom text editor. Instead of worrying about spacing, indentation, and other formatting details yourself, this tool cleans up your code to follow a consistent style with a single keystroke or automatically whenever you save a file.

The plugin works by integrating with Prettier, a popular code formatter. You can trigger formatting manually by pressing Ctrl+Alt+F (or Cmd+Option+F on Mac), or you can enable an option to format your code automatically every time you save. The README doesn't go into detail about exactly how Prettier decides on formatting, but the idea is that it removes the need for style debates—there's one opinionated way to format, and the tool enforces it.

If your project uses ESLint (a tool that catches bugs and style problems in code), the plugin can work with that too. When ESLint integration is turned on, the formatter will respect your ESLint configuration files and settings, automatically finding them as it searches up your project folder. This means your code gets formatted in a way that also passes your linting rules.

This would be useful for any JavaScript developer using Atom who wants to save time on code formatting and keep their team's code looking consistent. A solo developer might use it to stop thinking about indentation; a team might use it to avoid formatting disagreements in code reviews. The plugin is open to pull requests and contributions if you run into issues or want to improve it.

Where it fits