Lucas Azzola
c00c1cb6e0
Change quoted date back to 2017
2018-01-01 12:40:10 +11:00
Li Siyao
c6304fb426
Happy new year 2018! ( #3620 )
2018-01-01 00:41:21 +01:00
Josh Unger
358984ef0c
add an example .prettierrc.js config ( #3570 )
...
* add an example .prettierrc.js config
* Update configuration.md
2017-12-26 18:26:09 +11:00
Lucas Azzola
4c9d4061da
Prettier Plugin API ( #3536 )
...
* Move files around in preparation for refactor
* Update paths in build script
* Extract generic printing logic from the JavaScript printer
* Conform printer API
* Fixup decorator handling
* Fix multiparser
* Create plugin entry for markdown
* Create plugin entry for javascript/typescript
* Create plugin entry for html
* Create plugin entry for graphql
* Create plugin entry for css/less/scss
* Move JSON to JS plugin entry
* Integrate plugins into getSupportInfo()
* Move astFormat to parser definition
* Move util to common
* Implement parser loading
* remark -> mdast
* Rename cli/cli -> cli/index
* Rename builder -> doc package, fix printer resolution
* Fix doc shape assumption in CSS-in-JS logic
* Fix third-party.js prod resolution
* Fixup build-docs script
* Distribute multiparser code
* Remove requirement to forward options
* Flatten closure
* Remove debug directory
* Expose doc
* Add external plugins
* Pass options to loadPlugins
* Export getParsers
* Pin resolve version
* Use getSupportInfo in Markdown embed
* Document plugin API
* Update build-docs
* Add CLI for plugins
* Lint docs
* Fixup build.js
* Add vue language
* Fixup multiparser for vue
* Upgrade rollup and rollup-plugin-commonjs
* Fixup third-party build
* Change AST format in docs
2017-12-26 12:23:50 +11:00
Josh Unger
62bfcac4c5
remove comment in prettier json example since comments are invalid in json ( #3567 )
...
remove comment in prettier json file example since comments are invalid in json
2017-12-26 01:15:18 +11:00
Jiawen Geng
ea4bc9093e
fix recursive in script ( #3565 )
...
See more here : https://github.com/prettier/prettier/issues/2078 .
2017-12-25 20:16:50 +11:00
Christopher Chedeau
c40b061b80
[vue] Introduce proper support for Vue Single File Components (SFC) ( #3563 )
...
There's a lot of demand for vue sfc (#2097 ). This introduces partial support for them: all the html is printed as is, except for the script and style tags which are printed using prettier. I believe that this should cover a lot of the use cases while being simple to support and if we want we can extend to more in the future.
I copy pasted the html parser used by vue (it's just a single 400 lines file) so that we don't run the chancesof conflicts. I'm also very conservative: I only print the style and script at the top level and for the lang attributes we support.
I expect this to be landable as is and provide value, review welcome :)
2017-12-25 01:15:33 +01:00
Jiawen Geng
0a28c7484f
Add js version pre-commit ( #3541 )
2017-12-20 18:08:42 -02:00
Lucas Azzola
ed80d6c5bd
Make all CLI logging go through a logger ( #3515 )
...
* Make all CLI logging go through a logger
* Add --loglevel docs
* Change default loglevel to log
* Update snapshots
* Switch to YAML eslint files
2017-12-18 23:22:07 +11:00
Lucas Azzola
5e81e75601
Add plugin:prettier/recommended ( #3508 )
...
* Add plugin:prettier/recommended
* Revert eslint-plugin-prettier docs changes
2017-12-18 08:39:31 +11:00
Daniel Tschinder
1ba144b617
chore(docs): Add webstorm setup with eslint integration ( #3489 )
2017-12-14 23:19:54 +11:00
Nick Arnold
d6db35c16b
docs: update babylon project url ( #3484 )
2017-12-14 14:23:53 +11:00
Christian Oliff
578156c218
Update VS Code extension name ( #3475 )
2017-12-13 11:35:20 -02:00
Thomas Broadley
44bad41b3e
Fix typo ( #3467 )
2017-12-13 01:44:49 -02:00
James Leftley
46ecf3ffbb
Update ESLint docs code formatting for consistency ( #3466 )
2017-12-13 00:57:21 -02:00
Roger Sheen
5065608f73
Docs: Add info on ignore file to "Ignoring Code" ( #3458 )
...
* docs(ignore): mention ignore file in Ignoring Code
While working on #3321 , I needed to ignore an entire file, but the "Ignoring Code" section of the docs only describes how to ignore blocks of code, so I wasn't aware of the default ignore file.
(The `.prettierignore` file is mentioned in the CLI section, but easily overlooked there.)
This commit extends the introduction sentence of the "Ignoring Code" section and adds a new subsection to explain how to ignore files.
https://github.com/prettier/prettier/issues/3321#issuecomment-350072566
* docs(cli): fix nesting error in heading hierarchy
The `--ignore-path` option currently appears as a third-level subsection of `--find-config-path` and `--config`, but this looks like an error.
This commit promotes the `--ignore-path` heading to the same (H2) level as the other CLI options.
2017-12-11 22:23:06 -02:00
Lucas Duailibe
c9079926c9
Improve visibility of lint-staged usage warning ( #3445 )
2017-12-10 00:09:07 -02:00
Alf Eaton
67ec3b2f05
Update instructions for File Watcher in WebStorm ( #3424 )
...
Re-use the instructions for setting the File Watcher program path in WebStorm when prettier is installed locally.
2017-12-06 13:35:56 -02:00
Maxime Thirouin
a9502f0ab7
Add "md" extension in "Pre-commit hook" documentation ( #3421 )
...
It's nice to have all extensions so we can easily copy paste :)
2017-12-06 20:34:58 +11:00
Lipis
20373d6fee
Prettify style in playground and code block languages ( #3419 )
2017-12-05 19:48:11 -07:00
Lucas Azzola
c7c1d2e7a4
Upgrade Prettier to Prettier 1.9 ( #3395 )
...
* Upgrade to prettier@1.9.0
* Run eslint --fix
* Run prettylint --fix
* Fix playground with editorconfig script
2017-12-05 08:14:03 -02:00
Joseph Frazier
cecf0657a5
Re-add EditorConfig support (undo #3213 ) ( #3255 )
...
* Revert "Revert "Respect EditorConfig settings" (#3213 )"
This reverts commit d2241fc0d5 .
* Comment out EditorConfig docs
See https://github.com/prettier/prettier/pull/3213#issuecomment-343009769
* editorconfig: Support `indent_size = 0`
See https://github.com/prettier/prettier/pull/2760#discussion_r137447715
and https://github.com/josephfrazier/editorconfig-to-prettier/commit/c38b84c42a2e022067c104c494298a8c9533e7a7
* Revert "Comment out EditorConfig docs"
This reverts commit ddfa529c55cac4853a1e76e00c8b5e3ef158c01f.
* Mark EditorConfig functionality as v1.9.0+
See https://github.com/prettier/prettier/pull/3255#discussion_r150432508
* editorconfig: Upgrade editorconfig-to-prettier to 0.0.4
* editorconfig: Only enable for CLI, by default
https://github.com/prettier/prettier/pull/3255#issuecomment-348420546
* editorconfig: Add tests confirming that editorconfig is ignored by default in the API
https://github.com/prettier/prettier/pull/3255#issuecomment-348420546
* editorconfig: Add/fix CLI option parsing
* editorconfig: Move docs from configuration.md to options.md
* editorconfig: Add `oppositeDescription` to show docs for `--no-editorconfig`
Addresses https://github.com/prettier/prettier/pull/3255#discussion_r154542792
* editorconfig: Update test snapshots
* editorconfig: Remove unnecessary options parsing code
Addresses https://github.com/prettier/prettier/pull/3255#discussion_r154544560
* editorconfig: Move docs from options.md to api.md and cli.md
Addresses https://github.com/prettier/prettier/pull/3255#discussion_r154545979
* resolveConfig: return null if both .prettierrc and .editorconfig are missing
Addresses https://github.com/prettier/prettier/pull/3255#discussion_r154574613
* Don't add now-failing tests
The way these tests work, both `tests_integration/cli/config/.prettierrc`
and `.prettierrc` apply to `tests_integration/cli/config/editorconfig/file.shouldnotexist`,
so the test wouldn't work even on master. Here's a way to confirm that:
```js
const path = require('path')
const assert = require('assert')
const prettier = require('./')
const file = './tests_integration/cli/config/editorconfig/file.shouldnotexist'
console.log(prettier.resolveConfig.sync(file))
assert(prettier.resolveConfig.sync(file) === null)
```
2017-12-05 09:28:27 +11:00
Marko Schulz
a05811f8eb
Fix link ( #3392 )
2017-12-05 08:55:32 +11:00
Ika
073c0b16d8
feat(markdown): add proseWrap: "preserve" option ( #3340 )
...
* test: add test case
* feat(markdown): add `proseWrap: "preserve"` option
* test: add tests
* docs(options): update `proseWrap`
* feat(markdown): change default to `proseWrap: "preserve"`
BREAKING CHANGE
* docs(options): update `proseWrap`
* test: specify option explicitly
* Fix lint after merge
* Fix error after merge
2017-12-02 09:48:40 +11:00
Ika
23c306c8a0
docs(index): fix links on GitHub ( #3367 )
2017-12-01 10:59:17 +08:00
Ryan Zimmerman
d6bb6edeae
Add note about proseWrap option under printWidth for clarity ( #3364 )
2017-11-30 17:54:54 -03:00
Sylvan Mably
562b4e19d1
Fix broken footnote links ( #3353 )
2017-11-29 18:29:32 -03:00
Ika
ac3f74e7a3
docs(options): add available version for arrow-parens ( #3339 )
2017-11-29 00:20:26 +08:00
Suchipi Izumi
6abdd2c6b7
PR feedback
2017-11-27 22:27:34 -07:00
Stephen Scott
9a1e408a3f
Add option and specs (no implementation yet)
...
These new snapshots are from https://github.com/prettier/prettier/pull/2676
2017-11-27 22:26:58 -07:00
Ika
76efb33e75
chore: setup markdown formatting ( #3224 )
...
* chore(deps): upgrade prettier to v1.8.2
* chore: setup lint-docs script
* docs: add `<!-- prettier-ignore -->`s
* docs: format docs
* Revert "docs: format docs"
This reverts commit 6dba903987dddc498cb589ca311905f25b6aee53.
* chore(prettierrc): set `--no-prose-wrap`
* docs: format docs
* Revert "docs: format docs"
This reverts commit 139bd744b6921916be8fac4fa3bab83bae5d12df.
* docs: tweak
* docs: format docs
* chore: rename .prettierrc
* chore: rename back to .prettierrc
* chore: split out third-party
* refactor: fix linting
* chore: do not split out third-party on website
2017-11-22 22:27:40 +11:00
Nathaniel Furniss
cbed0f487f
fix config doc typo ( #3298 )
2017-11-20 18:26:33 -02:00
Ika
b6b601815c
docs(webstorm): improve image urls ( #3261 )
2017-11-14 18:37:15 +11:00
Mark Yu
9f7b4df23f
Fix broken Webstorm image links. ( #3260 )
2017-11-14 10:47:04 +08:00
David Glasser
217992fb3a
docs: eslint config is orthogonal to plugin ( #3229 )
2017-11-10 03:16:11 -02:00
Ika
c37e7fae2a
docs(options): add note for available version ( #3217 )
2017-11-09 13:39:07 +08:00
Mitermayer Reis
813d9b93eb
Fix typos ( #3212 )
...
* Adding --stdin-filepath option in order to enable filetype inference from
stdin
* Fixing typo on the documentation
* Fixing typos - fixing some typos
* Restoring static lib files back since they are artifacts
2017-11-09 11:44:24 +11:00
Lucas Azzola
d2241fc0d5
Revert "Respect EditorConfig settings" ( #3213 )
...
* Revert "Respect EditorConfig settings (#2760 )"
This reverts commit 8f58ca0f48 .
2017-11-09 11:38:58 +11:00
Joseph Frazier
8f58ca0f48
Respect EditorConfig settings ( #2760 )
...
This fixes https://github.com/prettier/prettier/issues/42 .
It adds support for .editorconfig's `indent_style`, `indent_size`, `tab_width`,
and `max_line_length` properties.
It doesn't support the `end_of_line` property as described in
https://github.com/prettier/prettier/issues/42#issuecomment-327073326 ,
but that could be added later. The same goes for `quote_type`
(https://github.com/prettier/prettier-atom/issues/293#issue-267288335 ).
* Make test .prettierrc not set config for all file extensions
This makes it easier to keep tests isolated.
2017-11-08 14:30:28 -05:00
Ika
9652ad75f8
docs(website): fix link ( #3206 )
2017-11-09 00:49:39 +08:00
Jamel Toms
dc9d628874
Fix broken link to configuration page ( #3205 )
2017-11-09 00:43:30 +08:00
Lucas Azzola
98eb2c98b7
Add proseWrap docs ( #3201 )
2017-11-08 22:57:08 +11:00
Lucas Azzola
84adbff232
Upgrade docusaurus to beta.10 ( #3166 )
...
* Upgrade docusaurus to beta.10
* Fixes for highlightjs
* Load github buttons script
2017-11-07 20:47:21 +11:00
Lucas Azzola
71a5533c4e
Move all docs to website ( #3139 )
...
* Sync README -> docs/options.md
* Sync README -> docs/*.md
* Misc fixups
* Remove markdown-toc
* Remove insert-pragma from ToC
* Never again!
* Move all docs to ./docs
* Remove yarn toc
* Fix inter-doc links
* Fix links in footer
* Clean up README.md
* Add basic description to README.md
* Use flat badges
* Move editor guides to website
* Improve prettier-ignore docs
* Fixup bad find/replace
* Add JSON to README
* Fix custom parser API link
* Fixup GitHub centering, add downloads badge
* Add 1.8 docs
* docs(website): mention markdown on homepage (#1 )
* Add intro
* Add watching-files.md
* Fix markdown syntax highlighting
* Switch back to .md links
2017-11-07 14:39:07 +11:00
Robin Malfait
d4768e1336
Update editors.md ( #3144 )
2017-11-04 22:30:03 +01:00
Benny Neugebauer
fa62a438a5
docs: fix table for insertPragma ( #3010 )
...
* docs: fix table for `insertPragma`
* Update options.md
* Update options.md
2017-10-11 22:30:03 +11: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
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