docs: add globbing example

Although prettier lacks options to filter project files to format by itself, most shells allow to submit multiple files with a filename expansion. Add an example using bash.
This commit is contained in:
Damien Lebrun committed 2017-01-11 16:05:31 +00:00
1 parent fd852320ce
commit f1db144341
2 files changed
+10 -4

No files matched your search

+9 -3
View File
@@ -97,13 +97,19 @@ Run prettier through the CLI with this script. Run it without any
arguments to see the options.
To format a file in-place, use `--write`. While this is in beta you
should probably commit your code before doing that. In the future we
will have better support for formatting whole projects.
should probably commit your code before doing that.
```js
prettier <opts> <filename>
prettier [opts] [filename ...]
```
For example, you could format your source using bash filename expansion:
```bash
prettier --write src/**/*.js bin/*.js
```
In the future we will have better support for formatting whole projects.
### API
The API is a single function exported as `format`. The options