Commit Graph
1598 Commits
Author SHA1 Message Date
Georgii Dolzhykov 37a7e9cd42 Merge branch 'master' into next 2020-01-22 14:55:22 +02:00
Georgii Dolzhykov 8efa29ca0c fix object literal checks in isSimpleCallArgument (#7403) 2020-01-21 17:55:43 +02:00
fisker Cheung e8009fa102 GraphQL: improve detection of separator between interfaces (#7305) 2020-01-21 13:18:53 +02:00
Cyrille David 97a878632c Support printing inline handlebars in html (through embed function) (#7306)
* Move old handlebars to html file

This kind of handlebars code is supposed to be in html files.

* Remove useless file

* Uglify our old handlebars file

* Move venerable hbs tests to their folder

Because of their config

* html: Use glimmer for script tags of type handlebars

* Record snapshots

* Add CHANGELOG entry

* Add the CHANGELOG test

* Make the PR changes more obvious
2020-01-21 08:55:29 +02:00
fisker Cheung 96d419b91a Fix srcset parse error (#7295)
* Fix srcset parse

* Don't swallow error

* fix srcset parse

* Add changelog

* Update case

* Fix quote style

* Make input ugly
2020-01-20 20:58:38 +02:00
fisker Cheung 9900174d50 HTML: don't treat colons as namespace prefix delimiters in tag names (#7273) 2020-01-20 16:39:19 +02:00
b47f7bae43 RFC: Always add a space after the function keyword (#3903)
* Always add a space after the `function` keyword

* WIP update snapshots

* WIP put generator function asterisk before space

https://github.com/prettier/prettier/issues/3847#issuecomment-363449250

* WIP update snapshots

* Add changelog

* Add tests for anonymouse generator function

* print space between `function` and generator star

* update changelog

* print space between yield and *

Co-authored-by: Joseph Frazier <1212jtraceur@gmail.com>
Co-authored-by: Sosuke Suzuki <aosukeke@gmail.com>
Co-authored-by: Georgii Dolzhykov <thorn.mailbox@gmail.com>
2020-01-20 16:26:47 +02:00
fisker Cheung 5330d9d4a6 Fix error throws on unclosed tag in pre (#7392) 2020-01-20 13:49:36 +03:00
Chad Carbert aa248378e6 handlebars: Add prettier-ignore (#7275) 2020-01-20 12:19:09 +02:00
fisker Cheung 00d46ee26e Fix prefer-object-spread in /tests* (#7337) 2020-01-19 01:23:16 +02:00
fisker Cheung 1710299b15 Add missing snapshot (#7378) 2020-01-19 00:52:20 +02:00
Sosuke Suzuki ac72cd3e94 Merge branch 'master' into next 2020-01-18 06:49:52 +09:00
Jed Fox 524cd96fee Add test for typed constructor (#7377)
Closes https://github.com/prettier/prettier/issues/4111
2020-01-17 10:26:11 -05:00
fisker Cheung 748ebbf0bf Add tests for #2091 (#7368) 2020-01-16 18:25:36 +02:00
Georgii Dolzhykov 3fd0d56a95 angular: fix i18n attr with @@ (#7371)
* angular: fix i18n attr with @@

* changelog
2020-01-16 15:57:33 +02:00
Kohei Ueno 9c9ff092f5 Fix: remove unnecessary parens when yielding jsx (#7367)
* support YieldExpression inside jsx

* add test cases

* add changelog for pr-7367

* fix changelog file name
2020-01-16 15:54:23 +02:00
Georgii Dolzhykov 7e3c0c73b3 Merge branch 'master' into next 2020-01-14 20:36:21 +02:00
fisker Cheung 02c161cf33 Fix: don't throw on broken html (#7293) 2020-01-13 17:31:03 +03:00
Misha KaletskyandGeorgii Dolzhykov 911fe7776e method chain breaking heuristic (#6685)
* examples from various issues about method chaining

this commit includes no prettier functionality changes, so that diffs will be easily visible.

specifically:

* https://github.com/prettier/prettier/issues/4125
* https://github.com/prettier/prettier/pull/4765
* https://github.com/prettier/prettier/issues/1565
* https://github.com/prettier/prettier/issues/3107

* add heuristic for breaking method chains

* fix: remove unnecessary escape characters

* initial non-regex isSimple implementation

* handle babel literal types properly

found here: https://github.com/babel/babel/blob/fe258dec047f473fb5a35172b2ff8cb172051dec/packages/babel-parser/ast/spec.md

* template literal + test

* use !every instead of some(!)

* fix: some test cases

* fix: object expressions and some more simple node types

* some test cases showing need for depth check

* depth check

* update test to test thing it's supposed to test

* optional expressions

* test case for missing isSimple depth

* fix isSimple depth bug

* fix: comment check

* test for ts non-null operator

* make object properties behave similarly to arrays

* isSimple -> isSimpleCallArgument; move to utils; add unaries

* add Import to the list of simple things

* only short regexps to be considered simple (<= 5 chars)

* add changelog entry in the new format

* update snapshots

Co-authored-by: Georgii Dolzhykov <thorn.mailbox@gmail.com>
2020-01-10 18:00:23 +02:00
Georgii Dolzhykov 7d88fb81c6 fix snapshots after merge 2020-01-10 02:38:28 +02:00
Lipis 3a96c6d542 Merge branch 'master' into next 2020-01-10 00:41:30 +02:00
Daiki Ihara 209cee6cea Scss: fix scss variable string concatenation removing spaces (#7211) 2020-01-09 23:38:16 +02:00
Georgii Dolzhykov 773ebd85e8 fix snapshots 2020-01-09 17:01:05 +02:00
Georgii Dolzhykov 42e7f7f1a5 Merge remote-tracking branch 'remotes/upstream/master' into next 2020-01-09 16:55:41 +02:00
Georgii Dolzhykov 9b7f097368 fix snapshots 2020-01-09 16:38:22 +02:00
Sosuke Suzuki 332a55179e Vue: format sfc jsx (#7180)
* Modify to enable to format vue jsx sfc

* add changelog

* Modify to avoid cspell checking, "sfcs" -> "SFC"
2020-01-09 05:14:19 +09:00
1e65456960 markdown: fix redundant leading spaces in markdown list (#7178)
* fix rebundant leading spaces in markdown list

* add test for rebundant leading spaces in markdown_list

* add changelog_unreleased file of pr-7178

* Update changelog_unreleased/markdown/pr-7178.md

Co-Authored-By: Sosuke Suzuki <aosukeke@gmail.com>

* Update changelog_unreleased/markdown/pr-7178.md

Co-Authored-By: Sosuke Suzuki <aosukeke@gmail.com>

* fix minor issues

Co-authored-by: Sosuke Suzuki <aosukeke@gmail.com>
Co-authored-by: Georgii Dolzhykov <thorn.mailbox@gmail.com>
2020-01-08 16:27:28 +02:00
Kohei Ueno 5d165eb850 Fix printing both index signatures without type annotations and… (#7228) 2020-01-08 16:19:34 +02:00
Panayiotis Lipiridis 35fe9ccada Merge with master 2020-01-08 14:43:19 +02:00
Cyrille David 0bb75fd1b9 handlebars: Fix superfluous line breaks in ConcatStatement (#7051) 2020-01-08 14:24:45 +02:00
Daiki Ihara 87d532b1b6 Markdown: fix PR 7181 broke HTML blocks inside list items (#7220)
* fix PR 7181 broke HTML blocks inside list items

* add test for indented html after list item

* add changelog_unreleased for pr-7220

* update changelog of pr-7181

* fix pointed out
2020-01-07 23:17:52 +02:00
Kohei UenoandGeorgii Dolzhykov e11b6e8992 Fix adding unnecessary colons on Mapped Types (#7221)
* fix #7174 by checking typeAnnotation existance

* add changelog for pr-7174

* fix typo

* revert mappedType test in conformance/

* add new directory and tests

* fix missing a line

* Update changelog_unreleased/typescript/pr-7174.md

Co-Authored-By: Georgii Dolzhykov <thorn.mailbox@gmail.com>

Co-authored-by: Georgii Dolzhykov <thorn.mailbox@gmail.com>
2020-01-06 22:25:22 +02:00
Selvazhagan 024f51e5f8 Fixes : #5915 HTML comments in pre tags causes bad formatting o… (#5959) 2020-01-06 21:00:09 +02:00
Tim Kendall 1a18cf7fce GraphQL: Support repeatable directive definition printing (clos… (#7227) 2020-01-06 20:20:25 +02:00
ArmanoandGeorgii Dolzhykov bda0632890 fix: comments for typescript function like nodes (#7144)
* test: add test cases for method_types comments

* fix: improve handling comments withing typescript function like nodes

* fix: correct position of trailing comments in TSMethodSignature

* fix: allow to use comments on TSAbstractMethodDefinition and fix TSDeclareFunction

* refactor: move real function node type check to function

* refactor: invert if in handleTSFunctionTrailingComments

* refactor: move isRealFunctionLikeNode into end of file

* chore: add changelog

* chore: update changelog

* chore: update changelog

* make changelog more concise

Co-authored-by: Georgii Dolzhykov <thorn.mailbox@gmail.com>
2020-01-06 11:18:10 +02:00
Cyrille David c1b6e1c401 handlebars: Improve MustacheStatement printing (#7157)
* Address https://github.com/prettier/prettier/pull/7051#discussion_r351877770

* Add isParentOfType helper fun

* Add CHANGELOG

* Fix a typo

* CHANGELOG: Remove --print-width option

* Add tests
2020-01-05 18:36:34 +02:00
Daiki Ihara 47ece13d78 Markdown: fix HTML formatting broken if the beginning tag start… (#7181)
* fix markdown formatting broken if the beginning html tag starts after a list item

* add test for beginning-tag-after-a-list-item in markdown_html

* add changelog_unreleased of pr-7181

* fix test of ast breaking for beginning-tag-after-a-list-item

* update changelog_unreleased pr-7181

* fix changelog_unreleased

* fix beginning tag starts after a list item in markdown

* add test case for beginning-tag-after-a-list-item

* update changelog_unreleased
2020-01-02 14:02:17 +02:00
Daiki Ihara 9c28478548 add test for ugly array key format (#7205) 2019-12-30 12:02:32 +01:00
Sosuke Suzuki d1771e8652 JavaScript: Fix moving semi for return to end of line-comment (#7140)
* Modify to fix semi for return with comment

* Add complex test case

* Add null check

* Add changelog
2019-12-16 20:11:39 +03:00
Brian Kim 64d4b2f49f revert function composition logic for decorators (#7138)
fixes #6953
2019-12-14 19:41:15 +02:00
Georgii Dolzhykov f421c7f613 fix(typescript): align printing of comments in function types w… (#7104)
* fix(typescript): align printing of comments in function types with Flow and Babel

* add changelog

* add tests for --no-semi
2019-12-06 19:03:26 +01:00
Sosuke Suzuki fa723deee2 TypeScript: remove extra indentation for arrow function on variable declaration with comment (#7094)
* Remove extra indent

* add changelog

* Fix postprocess for range of TypeScript

* Remove locend from postprocess

* Add test for no-smei

* Remove hasLeadingComment
2019-12-06 12:18:38 +03:00
Georgii Dolzhykov 3c13329f4f fix indentation in ternaries nested in conditions of other ternaries (#7087)
* fix indentation in ternaries nested in conditions of other ternaries

* fix giant indent when tabWidth=4

* refactoring: remove breakNested as it was always true

* break between parens

* add changelog

* microfix

* fix TS conditional types

* Update pr-7087.md
2019-12-04 12:39:29 +03:00
Georgii Dolzhykov 26a0bc3305 Don't print trailing commas after rest elements in tuples (#7075) 2019-12-02 13:34:04 +03:00
Sosuke Suzuki 2eca6193d7 JavaScript: Format ThrowStatement like ReturnStatement (#7070) 2019-12-01 12:59:15 +01:00
Cyrille David 021eec8d73 Fix a falling mustache issue (#7052)
* Add a test highlighting the falling mustache issue

* Use concat helper instead of manual concat

* Fix the falling mustache issue

* Add a CHANGELOG
2019-11-28 17:12:57 +01:00
Evilebot Tnawi cad32c0e22 fix formatting of logical and binary expressions in template literals (#7010) 2019-11-22 15:36:34 +03:00
Georgii Dolzhykov bf2989718b fix unstable formatting of logical expressions (#7026) 2019-11-22 00:14:34 +02:00
Georgii Dolzhykov 13d37dac20 TypeScript: print JSDoc-only types (#7020)
* TypeScript: print JSDoc-only types

* add changelog
2019-11-21 12:27:23 +02:00
Evilebot Tnawi 90eed411d4 preserve parentheses for JSDoc type casting with extra spaces a… (#7011) 2019-11-20 18:59:25 +01:00