JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 124
  • Score
    100M100P100Q88508F

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

Package Exports

  • @ewmarkets/prettier-node

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@ewmarkets/prettier-node) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Prettier EWM NodeJS

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

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

Prettier

# package.json
{
  ...
  "prettier": "@ewmarkets/prettier-node",
  # 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-node",
  "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