Commit Graph

183 Commits (eb684c59c2914f9136c2ae16f450e19f27592bab)

Author SHA1 Message Date
Joseph Frazier 5c86730ec9 Add missing "Require pragma" to Table of Contents (#2993)
This was done with `yarn toc`. Maybe we should add a CI step that runs
`yarn toc` and fails if the README changes?
2017-10-08 20:23:22 -04:00
Jake 50f3e646c7 Add option to insert @format to first docblock if absent (#2865)
* Add option to insert @format pragma if absent

prependPragma --> insertPragma

add tst dir, move stripBom, add to README, update snapshots

remove noise from test + update snapshots

use jest@test new functions, update docs, rerun snapshots

fix accidental upgrade to jest@test

update jest-docblock again to latest with strip()

updated snapshot

* updated snapshots

* revert jest dep change

* apply a trim to parsed comments

* remove empty object

* Revert "apply a trim to parsed comments"

This reverts commit 467f71ce5f4b4f8a1b5c4474ee0484bc96c92141.

* rerun snapshots with proper jest version

* pin jest-docblock to latest @test release

* comment out docs for new feature from readme

* remove leading newlines

* ensure blank line between docblock and rest of file

* remove backtick string
2017-10-06 19:37:14 +11:00
Simon Lydell 808dc4e7e3 Add missing quote in README.md
Fixes #2935.
2017-09-30 10:00:47 +02:00
Lucas Azzola ae21d60386 Recommend pinning prettier version (#2920)
* Recommend pinning prettier version

* Change from -E to --exact/--save-exact
2017-09-28 14:34:32 +10:00
Stephen Scott c2bc33b3ad 1.7.1 2017-09-27 11:00:29 -06:00
Simon Lydell 68d1b56696 Comment out config file extensions docs until next release
See #2861.
2017-09-19 21:37:20 +02:00
Hugo Dias f6356ae94c chore: add prettier-stylelint to the related projects (#2859) 2017-09-19 20:23:06 +02:00
Nick Ribal 592f99fde6 Enable cosmiconfig rcExtensions (#2749)
* Enable cosmiconfig rcExtensions; add two tests

* Remove default value; make integration input files self descripting; update all integration snapshots

* Add engines field to package.json
2017-09-17 02:47:53 +10:00
ikatyang 7d7fb36499 docs: `requirePragma: <bool>` 2017-09-13 21:43:57 -06:00
Ika 71f5d185a7 docs(readme): port requirePragma docs to README.md (#2812)
* fix default value
2017-09-14 11:26:43 +08:00
Will Binns-Smith d5e5d66407 Add option to require @prettier or @format pragma (#2772)
* Add option to require @prettier or @format pragma

Fixes #2397.

Inspired by `eslint-plugin-prettier` and the discussion in #2397, this
implements requiring a special comment pragma to be present in a file's
first comment in order to be formatted.

This will help large codebases gradually transition to prettier over
time without tons of churn or large code reviews.

I implemented this as a standard prettier "option", not just a typical
`argv` flag, as it is relevant in both the cli and the api. This way it
can be provided programmatically, on the command line, or standardized
in a prettierrc file so like the style options, every user can use this
setting consistently and only apply prettier to relevant files, no
mattier their editor integration.

This requires the pragma begin with `@` (in fact it's inserted if the
user doesn't provide it). Currently the usage implies it must be
"prettier" or "format", but it can technically be any value other than
"none", which is similar to the `trailingCommas` option.

cc @vjeux

* Don't quote anything in runPrettier; this is usually handled by a shell

* Make --require-pragma a boolean option

* Use jest-docblock to find pragmas without parsing the ast

* Clarify docs

* includes -> indexOf

* Move test out of integration
2017-09-13 09:03:18 -07:00
Mitermayer Reis c59a82cbae Add CLI option '--config-precedence' (#2733)
Add CLI option '--config-precedence'
2017-09-05 08:56:23 +10:00
Maxime Thirouin 7eaf5c7cb7 Improve lint-staged setup example by adding more filetypes (#2746) 2017-09-04 17:42:26 +10:00
Ika 088aa71b07 feat(resolve-config): add `.sync()` method (#2722)
* feat(resolve-config): add `sync` option

* docs(readme): add `sync` option

* fix(clearCache):  always clear both

* chore(deps): switch to 3.0 branch

* feat: replace `sync` option with `.sync()`

* docs(readme): update `.sync()`
2017-09-01 20:17:07 +10:00
Levi Thomason 828a7b8f0d docs(readme): add and sort cli options (#2700)
* chore(build): auto generate toc

* docs(readme): add and sort cli options

* refactor(build): move toc to seperate task
2017-08-29 13:39:49 -07:00
Ika a44ef1fe8b Update README.md (#2690)
* docs(readme): fix option typo

* docs(readme): fix parameter representation
2017-08-29 16:05:59 +10:00
Lucas Azzola db4d7ac1db Un-comment config file documentation (#2669) 2017-08-28 18:27:04 +02:00
Ika 56ce8cf935 docs(readme): add tslint related projects (#2677) 2017-08-28 23:50:14 +10:00
Larry Rubin ab812e2db9 Clarifying JSX Brackets option (#2659)
Thought the setting wasn't working properly when it didn't apply to self closing elements, and was about to open an issue until I found out it's working as intended.
2017-08-24 19:29:23 -07:00
Simon Lydell cd9ad2c57c Clarify --trailing-comma a bit
Refs. #2655
2017-08-23 17:44:07 +02:00
Patrick Camacho daf8a44ccf Update README.md (#2638)
Add a link to a project I worked on to format code examples in Markdown files with Prettier
2017-08-18 19:50:16 -07:00
Luca dbe0ca6c26 Added rollup-plugin-prettier to Related Projects in README.md (#2616)
Added a link and description to rollup-plugin-prettier (https://github.com/mjeanroy/rollup-plugin-prettier) to the 'Related Projects' section
2017-08-12 21:27:16 +10:00
Marko Schulz 7544006949 Purge usage of `.eslintrc` (#2592)
* .eslintrc -> .eslintrc.json

Because `.eslintrc` is deprecated.

* Purge second usage of .eslintrc
2017-08-07 19:03:27 +10:00
Esben Petersen fea408ff5c fix link to VS Code extension (#2576) 2017-08-02 08:03:13 -06:00
Lucas Azzola 8159666cad Clarify that `tests/flow` is the flow test suite 2017-08-02 09:41:42 +10:00
Einar Löve 2560a51f7d Update README.md to add a notice about using lint-staged (#2565)
* Update README.md to add a notice about a limitation using lint-staged

The lint-staged example under pre-commit hooks has a limitation where if you use the [Github Desktop](https://desktop.github.com/) app to commit specific lines, this approach will stage the whole file after regardless. See this [issue](https://github.com/okonet/lint-staged/issues/62) for more info.

* Add back removed empty line

* Remove Github Desktop app reference
2017-07-31 23:23:12 +10:00
Joseph Frazier a78d1389f6 Use babylon.parseExpression for JSON (#2476)
* Add comments showing parser arguments

Since this is how they are invoked, the comments make it easier to maintain.

* Use babylon.parseExpression for JSON

See https://github.com/prettier/prettier/issues/2378#issuecomment-314600778

Note that this doesn't yet print comments:

    echo '{/*comment*/"K":"V"}' | ./bin/prettier.js --parser json

* Remove parser-json.js

This reduces duplicate code in the built package.
See https://github.com/prettier/prettier/pull/2476#pullrequestreview-50181398

* Add test with block comment in JSON

* Fix test with block comment in JSON

* Add test with line comment in JSON

* Don't build now-redundant parser-json.js
2017-07-24 11:43:49 +10:00
Mitermayer Reis 38fdb6f851 Update vim-prettier location (#2518) 2017-07-20 11:06:54 +10:00
Lucas Azzola e8425a4899 Comment out configuration file docs 2017-07-19 08:53:44 +10:00
Lucas Azzola b3a4785cec Add Codecov badge to README 2017-07-17 00:03:51 +10:00
Lucas Azzola 41318937d2 Add link to JSON schema in README 2017-07-12 21:29:57 +10:00
Lucas Azzola 1c806f81b2 Rename --resolve-config to --find-config-path (#2453) 2017-07-11 23:57:26 +10:00
Lucas Azzola 34b0709bf0 Add documentation for configuration (#2452)
* Add documentation for configuration files

* Add CLI docs for configuration

* Support --no-config
2017-07-11 14:21:29 +02:00
Zac Colley b201c953f2 Make "print width" documentation clearer (#2383) [skip ci]
* Update print width documentation

* Update README.md

* Update README.md

Tried to improve first two sentences.
Moved explanation above table.

* Improve print width based on feedback

* Update README.md

* Update print width explanation
2017-07-11 00:07:32 +10:00
Daniel Lo Nigro 3728749d92 Clean up "not needed anymore" sentence in README (#2435)
* "not needed anymore" → "redundant"

* Update based on feedback
2017-07-08 17:13:31 -04:00
Joseph Frazier 1e5ae50eba Update prettier_d description to mention configuration files 2017-07-08 15:10:22 -04:00
Lucas Azzola 073a02bf1f Add missing $ in bash script 2017-07-08 17:48:21 +10:00
Anthony Sottile 19cd7d3227 Add pre-commit metadata directly to prettier (#2414) 2017-07-06 20:13:52 +02:00
Kushagra Gour 0b41ecb55b docs(README): update bash script to mimic lint-stage behavior (#2384) 2017-07-03 14:38:43 -07:00
Lucas Azzola 65bbbaec58 Add content to website (#2377)
* Add content to website

* Fix linting error

* Cleanup, extract content to JSON files
2017-07-03 12:48:05 +02:00
Haroen Viaene 863b1be4b5 docs(README): hype train clarification (#2354)
* docs(README): hype train clarification

* Update README.md
2017-06-29 07:48:42 -07:00
Jack Franklin 9ee3e581d4 (docs): Document using Prettier + Vim using ALE (#2333) 2017-06-28 09:20:34 -07:00
Lucas Azzola 5e51caca1b Add GraphQL to README (#2265)
* Add GraphQL to README

* Add JSON to main list of languages
2017-06-27 10:18:22 -07:00
Simon Lydell 174bbda7ef Minor readme cleanups 2017-06-26 17:42:28 +02:00
Lucas Azzola caa77fbfe8 Join range start and range end documentation 2017-06-25 12:44:18 +10:00
Lucas Azzola 438f5887e2 Add links to prettier's parsers
Since the parser API exposes the AST, it makes sense to point people towards the parsers we use so they can hack on them.
2017-06-25 12:27:49 +10:00
Lucas Azzola b93191d4de Explode the options table (#2244)
* Explode the options table

The options table in README was getting a bit unwieldy. This commit moves the options to a top-level section, and makes each setting hyperlink-able.

The `cursorOffset` setting has been moved from the list to the documentation for `formatWithCursor`.

* Fix typos/punctuation

* Fix --trailing-comma formatting
2017-06-24 07:52:34 -07:00
Lucas Azzola d8be8be57a Clean up API documentation 2017-06-24 18:13:02 +10:00
Lucas Azzola b2d5366897 Remove apostrophe from JetBrains 2017-06-23 23:01:12 +10:00
Chaim Lando f519c5f030 Add table of contents (#2230)
* add toc

* Wrap table of contents in <details> tag
2017-06-23 20:52:46 +10:00