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

@ewmarkets/prettier-reactjs

Package Overview
Dependencies
Maintainers
2
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ewmarkets/prettier-reactjs

A Prettier shareable config for projects using 'Prettier' and ESLint for ReactJS projects

latest
Source
npmnpm
Version
2.0.0
Version published
Weekly downloads
396
280.77%
Maintainers
2
Weekly downloads
 
Created
Source

Prettier ReactJS

Adds the Prettier and ESLINT format that we use for ReactJS.
If husky is added, then it will run on every new commit for the staged files

npm i --save-dev @ewmarkets/prettier-reactjs

Prettier

# package.json
{
  ...
  "prettier": "@ewmarkets/prettier-reactjs",
  # to run it manually
  "scripts": {
    ...
    "prettier": "prettier --write \"./**/*.{js,jsx}\""
  }
}

Husky Configuration

To run on every commit, you can modify the current package.json

# package.json
{
  ...
  "prettier": "@ewmarkets/prettier-reactjs",
  "scripts": {
    ...
    "prepare": "husky install",
    "prettier": "pretty-quick --staged", # remember to modify this!
  },
}

Create a new file for running the husky hooks

$ echo "npm run prettier" > .husky/pre-commit && chmod +x .husky/pre-commit
$ npm install # this command is only to ensure the `prepare` script inside the package.json is run 

Keywords

eslint

FAQs

Package last updated on 04 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