Git Product home page Git Product logo

prettier-standard's Introduction

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

prettier-standard's People

Contributors

willfarrell avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

prettier-standard's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.