0.1.6 • Published 4 years ago
prettier-plugin-compactify v0.1.6
prettier-plugin-compactify
Available on npm as 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 the user does not want them. For more context see
issue 10757.
Development
- Install pre-commit
- Install pre-commit hooks
cdto this repository- Run
pre-commit install
Additionally:
yarn fixfor formattingyarn lintfor linting
Release
yarn release