Package Exports
- prettier-eslint-cli
- prettier-eslint-cli/dist/format-files
- prettier-eslint-cli/dist/index.js
- prettier-eslint-cli/dist/parser
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 (prettier-eslint-cli) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
prettier-eslint-cli
CLI for prettier-eslint
The problem
You have a bunch of files that you want to format using prettier-eslint
.
But prettier-eslint
can only operate on strings.
This solution
This is a CLI that allows you to use
prettier-eslint
on one or multiple files.
Installation
This module is distributed via npm which is bundled with node and should
be installed (with yarn
) as one of your project's devDependencies
:
yarn add --dev prettier-eslint-cli
If you're still using the
npm
client:npm install --save-dev prettier-eslint-cli
Usage
Typically you'll use this in your npm scripts (or package scripts):
{
"scripts": {
"format": "prettier-eslint src/**/*.js"
}
}
This will format all .js
files in the src
directory. The argument you pass to the CLI
is a glob and you can pass as many as you wish.
You can also pass options:
CLI Options
Everything other than the flags listed below will be considered a file glob and used to find
files to format. By default, glob
will ignore **/node_modules/**
unless the glob you provide
includes the string node_modules
.
NOTE: It is recommended that you keep your files under source control and committed before running
prettier-eslint
as it will overwrite your files!
--log
If prettier-eslint
encounters an error formatting a file, it logs an error to the console.
prettier-eslint-cli
disables this behavior by default. You can turn it on with --log
.
--eslint-path
Forwarded as the eslintPath
option to prettier-eslint
--prettier-path
Forwarded as the prettierPath
option to prettier-eslint
Contributors
Thanks goes to these people (emoji key):
Kent C. Dodds 💻 📖 🚇 ⚠️ |
Adam Harris 👀 |
Eric McCormick 👀 |
---|
This project follows the all-contributors specification. Contributions of any kind welcome!
LICENSE
MIT