Have ideas to improve npm?Join in the discussion! »

prettier-standard-cli

16.0.10 • Public • Published

JavaScript Formatting & Standard Style Wrapper
JavaScript Formatting & Standard Style

Just a simple wrapper around Prettier & Standard with auto-fix enabled.

Why

  • Simplify package.json use
  • Filter non-js file extensions from standard, thinks json is js

Getting Started

npm i -D prettier-standard-cli

Deployment

cli

  • prettier 'styles/*.{json,js}'
  • standard 'src/*.js'
  • prettier-standard 'src/**/*.{css,json,js}'

package.json

{
  "devDependencies": {
    "lint-staged":"*",
    "husky":"*",
    "prettier-standard-cli":"*"
  },
  "scripts": {
    "precommit":"lint-staged",
    "lint": "prettier-standard 'src/**/*.{css,json,js}'",
  },
  "lint-staged": {
    "src/**/*.{css,json,js}": [
      "prettier-standard",
      "git add"
    ]
  }
}

package.json standalone equivalent

{
  "devDependencies": {
    "lint-staged":"*",
    "husky":"*",
    "prettier":"*",
    "standard":"*"
  },
  "scripts": {
    "precommit":"lint-staged",
    "lint": "prettier --write --loglevel warn 'src/**/*.{css,json,js}' && standard --fix 'src/**/*.js'",
  },
  "lint-staged": {
    "src/**/*.{css,json}": [
      "prettier --write",
      "git add"
    ],
    "src/**/*.js": [
      "prettier --write",
      "standard --fix",
      "git add"
    ]
  }
}

Built With

Authors

License

This project is licensed under the MIT License - see the LICENSE file for details

Acknowledgments

Install

npm i prettier-standard-cli

DownloadsWeekly Downloads

82

Version

16.0.10

License

MIT

Unpacked Size

4.43 kB

Total Files

6

Last publish

Collaborators

  • avatar