prettier-eslint_d
Format your JavaScript files with prettier and eslint, fast
Last updated 2 years ago by rstacruz .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install prettier-eslint_d 
SYNC missed versions from official npm registry.

prettier-eslint_d

Format your JavaScript files with prettier and eslint, fast

Status

prettier-eslint_d allows you to use Prettier and Eslint together, and use them fast. It spawns them as daemons, so any subsequent calls will be as fast as possible. Great for integrating into editors like Emacs and Vim!

Installation

First, add an Eslint config to your project. prettier-eslint_d assumes you have an .eslintrc or .eslintrc.json in your project.

Install it via yarn or npm:

yarn add --dev prettier-eslint_d

You can then use prettier-eslint_d in the same way you may be using prettier:

# Fix one file
yarn run prettier-eslint_d --write path/to/file.js

# Fix many files
yarn run prettier-eslint_d --write 'scripts/**/*.js'

# Fix via stdin/stdout (great for editors)
cat path/to/script.js | ./node_modules/.bni/prettier-eslint_d --stdin

For more options, see node_modules/.bin/prettier-eslint_d --help.

Adding scripts

Your setup may vary, but I recommend having check and fix commands in a project. You can add these to your package.json:

/* package.json */
{
  "scripts": {
    "prettier:check": "prettier-eslint --list-different 'src/**/*.js'",
    "prettier:fix": "prettier-eslint --write 'src/**/*.js'"
  }
}

Add yarn run prettier:check in your CI script to ensure that files checked in are formatted properly. You can run yarn run prettier:fix to fix up all files.

Spacemacs installation

See: https://gist.github.com/rstacruz/a2361d000a88e49472c4419116edaccf

Also see

This project integrates the following other projects:

Thanks

prettier-eslint_d © 2018+, Rico Sta. Cruz. Released under the MIT License.
Authored and maintained by Rico Sta. Cruz with help from contributors (list).

ricostacruz.com  ·  GitHub @rstacruz  ·  Twitter @rstacruz

 

Current Tags

  • 0.0.3                                ...           latest (2 years ago)

3 Versions

  • 0.0.3                                ...           2 years ago
  • 0.0.2                                ...           2 years ago
  • 0.0.1                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 1
Last Day 0
Last Week 0
Last Month 0
Dependencies (6)
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |