npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

sizuhiko.brackets.prettier

v1.1.1

Published

Brackets extension for formatting JavaScript using prettier.

Downloads

28

Readme

npm Version Brackets Extension Registry Version Brackets Extension Registry Downloads

Brackets Prettier

Brackets Extension that formats open JavaScript, JSX, Flow, TypeScript, CSS, Less, SCSS, JSON, GraphQL and Markdown files using prettier version 1.13.4.

Installation

Latest Release

To install the latest release of this extension use the built-in Brackets Extension Manager which downloads the extension from the extension registry.

Usage

Brackets Prettier can be run manually on the whole file or on a selection. Use the Toolbar Button with the wand icon, the menu entry Edit > Prettier, the context-menu entry Prettier, or one of the keyboard shortcuts Ctrl-Alt-B (Windows/Linux), Ctrl-Shift-L (Windows), Cmd-Shift-L (Mac), or define your own.

Alternatively it can be enabled to run automatically on save. Use the menu entry Edit > Prettier on Save or the more advanced settings to activate.

Configuration

Prettier Options

Brackets Prettier supports the same options as prettier. The options can be specified in a .prettierrc file on project level. A .prettierrc file, only support written in JSON format.

File Options for Prettier on Save

Brackets Beautify leverages Brackets preferences, which means that you can specify per project settings by defining a .brackets.json in the root directory of your project. With Brackets preferences you can even define per file settings, which is really handy when dealing with third party libraries or minified resources.

Brackets Prettier also support per language settings, which enables you to enable/disabled Prettier on Save for your documents using the Brackets language layer.

The sample .brackets.json below generally enables Prettier on Save and disables it for any JavaScript file in thirdparty, any JavaScript file whose filename contains min, and any JSON file.

{
  "sizuhiko.brackets.prettier.onSave": true,
  "path": {
    "thirdparty/**.js": {
      "sizuhiko.brackets.prettier.onSave": false
    },
    "**min**.js": {
      "sizuhiko.brackets.prettier.onSave": false
    }
  },
  "language": {
    "json": {
      "sizuhiko.brackets.prettier.onSave": false
    }
  }
}

User Key Map for Prettier

Open the keymap.json with the menu entry Debug > Open User Key Map and add an overrides entry. For example:

{
  "documentation": "https://github.com/adobe/brackets/wiki/User-Key-Bindings",
  "overrides": {
    "Ctrl-Alt-F": "sizuhiko.brackets.prettier"
  }
}

Issues

Brackets Prettier uses prettier to format files and is therefore limited to its capabilities. For any issues concerning the actual formatting please refer to the prettier issues.

License

Brackets Beautify is licensed under the MIT license. prettier is also licensed under the MIT license.