
Security News
Crates.io Users Targeted by Phishing Emails
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
prettier-plugin-package
Advanced tools
An opinionated package.json
formatter plugin for Prettier
Prettier is an opinionated code formatter. It enforces a consistent style by parsing your code and re-printing, taking various rules into account.
This plugin adds support for package.json
files used within NPM modules.
prettier-plugin-package
is an evergreen module. 🌲 This module requires an LTS Node version (v8.0.0+).
Using npm:
npm install prettier prettier-plugin-package --save-dev
Please consider donating if you find this project useful.
Once installed, Prettier plugins should be automatically recognized by Prettier. To use this plugin, confirm that it's installed and run Prettier using your preferred method. For example:
$ npx prettier --write package.json
This plugin enforces its own set of opinionated rules:
Keys in scripts
are ordered alphabetically. Use prefixes wisely to properly order child scripts. e.g. lint
, lint:ts
.
Top-level keys are sorted according to a style commonly seen in the packages of @sindresorhus. Known keys, and their order are:
[
// meta
'name',
'version',
'flat',
'private',
'publishConfig',
'description',
'license',
'repository',
'author',
'homepage',
'bugs',
// entry
'main',
'bin',
// constraints
'engines',
'cpu',
'os',
// content and util
'scripts',
'files',
'keywords',
// dependencies
'bundledDependencies',
'optionalDependencies',
'peerDependencies',
'dependencies',
'devDependencies',
'resolutions'
]
Unknown keys, or keys not part of the list above, will be alphabetically sorted and added to the end of the file. Note that this list takes into account both npm
and yarn
keys.
Forthcoming rules include:
FAQs
An opinionated package.json formatter plugin for Prettier
The npm package prettier-plugin-package receives a total of 13,224 weekly downloads. As such, prettier-plugin-package popularity was classified as popular.
We found that prettier-plugin-package demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
Product
Socket now lets you customize pull request alert headers, helping security teams share clear guidance right in PRs to speed reviews and reduce back-and-forth.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.