Skip to content
This repository has been archived by the owner on Jan 31, 2022. It is now read-only.

willfarrell/prettier-standard

Repository files navigation

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

About

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

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published