Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

prettier-plugin-compactify

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

prettier-plugin-compactify

# Introduction

  • 0.1.0
  • npm
  • Socket score

Version published
Weekly downloads
412
decreased by-41.06%
Maintainers
1
Weekly downloads
 
Created
Source

prettier-plugin-compactify

Introduction

This plugin collapses objects' formatting before passing the code to Prettier.

Effectively it preprocesses the code such that:

const obj = {
  foo: "bar"
}

Becomes:

const obj = {foo: "bar"
}

Which prettier will try to fit in a single line:

const obj = { foo: "bar" }

This plugin was created because Prettier keeps arbitrary newlines after a { even if they are not wanted. For more context see issue 10757.

Development

  1. Install pre-commit
  2. Install pre-commit hooks
  3. cd to this repository
  4. Run pre-commit install

Additionally:

  • yarn fix formats all files
  • yarn lint lints all files

Release

  1. yarn pack
  2. yarn publish *.tgz

FAQs

Package last updated on 02 Aug 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc