New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

prettierify

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

prettierify

Adds `prettier` to your project in one command. Just run `npx prettierify` in the root of your project.

latest
npmnpm
Version
0.1.0
Version published
Maintainers
1
Created
Source

prettierify

Adds prettier to your project in one command. Just run npx prettierify in the root of your project.

Optionally create a file ~/.prettierrc in your home directory. At recogizer, for example, we use the following config:

{ 
  "semi": false, 
  "singleQuote": true,
  "trailingComma": "all"
} 

The command npx prettierify does several things:

  • Runs npm i -D husky lint-staged prettier
  • Creates a file .prettierrc. It is a copy of ~/.prettierrc from your home directory.
  • Adds lint-staged block to package.json.
"lint-staged": { 
    "*.{js,json,css}": ["prettier --write", "git add"], 
    "*.ts": [ 
      "tslint --fix -c ./tslint.json 'src/**/*{.ts,.tsx}'", 
      "prettier --write", 
      "git add" 
    ] 
},
  • In package.json, adds a line to scripts: "precommit": "lint-staged"
  • Finally, prettierify applies prettier to all files in your project.

Steps 1-4 add a pre-commit hook that guarantees all your files will be formatted before commits.

FAQs

Package last updated on 22 May 2019

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