Commit Graph

81 Commits (71a39d25126e6b5dc469a8e286cd76d9a8dc7de5)

Author SHA1 Message Date
Christopher Chedeau d8d5c7bc55 Introduce --parser/parser option and deprecate --flow-parser/useFlowParser (#342)
The previous API was inconsistent. The new one is

```js
--parser flow
--parser babylon

{parser: 'flow'}
{parser: 'babylon'}
```

if we ever want to add new parsers in the future it'll allow that more easily.

I put a console.log in parser.js in both functions and tested that the test suite worked both with and without the change in run_spec. I also tested that both the previous and new command line options are working.

At some point in the future we'll likely want to get rid of the old api but might as well keep supporting it so we don't break anyone for now.
2017-01-19 14:35:12 -08:00
Christopher Chedeau 0f54791582 Run prettier through the codebase (#316)
It's a good idea to run it right after we do a release when the number of outstanding pull requests is low :)
2017-01-18 15:31:46 -08:00
Jeffrey Horn 40973641a3 add version flag (#294)
* add version flag

* set version on the api
2017-01-18 15:45:44 -05:00
Benjamin Tan bc9b1fde19 Add newline after shebang if necessary. (#215) 2017-01-17 17:16:40 -05:00
James Long 3af7da5748 Reprint all the files! 2017-01-13 15:03:53 -05:00
Christopher Chedeau df99ae56b0 Add test for shebang and move to index.js (#170)
When looking into adding a test, I realized that the logic was inside of bin/prettier.js and therefore only applying to the cli. Moving it to index.js and adding a test so that it's more robust :)
2017-01-13 13:39:07 -05:00
Jamie Webb ecb26b3432 treat shebang outside of parsing (#137)
* treat shebang outside of parsing

* use less costly indexOf and reuse format function

* avoid reprinting new line and potential double space at start

* move options back to format function
2017-01-13 12:57:27 -05:00
James Long ac6cb883c8 Merge pull request #113 from fortes/master
Enable reading from stdin
2017-01-11 11:29:50 -05:00
James Long 722e5b4477 Merge pull request #114 from dinoboff/docs-update-usage
docs: add globbing example
2017-01-11 11:28:06 -05:00
Damien Lebrun f1db144341 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.
2017-01-11 16:05:31 +00:00
Filipe Fortes 9ffbd32723 Enable reading from stdin 2017-01-11 07:57:16 -08:00
James Long 83c378e8e8 Merge pull request #84 from vjeux/print_filename
Log the filename when --write is being used
2017-01-11 10:49:47 -05:00
Christopher Chedeau b8e6fc5cb0 Do not fatal when formatting throws
When you are formatting an entire codebase and a single file throw, it shouldn't stop the entire process.
2017-01-10 22:10:00 -08:00
Christopher Chedeau 0fdf14dbe6 Log the filename when --write is being used
This helps giving a sense of progress when printing a lot of files
2017-01-10 22:09:18 -08:00
Andrey Okonetchnikov 85dc8eb118 style: Run prettier on the source code 2017-01-10 21:47:52 +01:00
Andrey Okonetchnikov 1a77d072cc feature: Add support for passing multiple files
Fixes #58
2017-01-10 21:47:24 +01:00
Andrey Okonetchnikov 3b1762b3a9 chore: Added .js extension to ./bin/prettier 2017-01-10 21:45:51 +01:00
James Long 4abb8ce544 Support back to node v4 2017-01-10 12:18:22 -05:00
James Long a0edc2a520 Document more CLI flags in usage text 2017-01-09 23:22:58 -05:00
James Long 2e4eb91edc Improve CLI command 2017-01-09 23:03:35 -05:00
James Long 79e222bb53 Rename to `prettier` 2017-01-09 22:45:22 -05:00
James Long 27af6be07a Apply bracketSpacing option to array literals 2017-01-09 20:58:51 -05:00
James Long fc186c8df8 Add option for trailing commas in objects 2017-01-05 11:36:41 -05:00
James Long 9596695a12 Rename quotes config option to 2017-01-05 10:01:43 -05:00
James Long 599b4311bb Allow single quotes with --single-quotes option 2017-01-04 17:32:05 -05:00
James Long 8326963f2d Add option to include spaces inside object/array literals, default to false 2017-01-04 17:23:07 -05:00
James Long c9e24eb477 Add spaces around certain statements, add --write option, and more 2016-12-30 23:01:07 -05:00
James Long 0465bb5790 Add flow parser as an option, default to babylon 2016-12-30 21:23:50 -05:00
James Long 35d8546d27 Add Atom support 2016-11-30 10:05:38 -05:00
James Long d8313b03ce Add ability to call as API 2016-11-29 15:23:00 -05:00
James Long 29627ee520 initial 2016-11-29 12:14:10 -05:00