Commit Graph
1625 Commits
Author SHA1 Message Date
Georgii Dolzhykov 473bf9f50d Merge remote-tracking branch 'remotes/upstream/master' into next 2020-02-18 17:29:57 +02:00
Robert Webb 0b1b50106c Added a test to verify that #4659 is closed (#7591) 2020-02-18 17:01:55 +02:00
Kevin GibbonsandGeorgii Dolzhykov ada3d08df5 Put space after generator star, not before (#7516)
* Put space after generator star, not before

* remove pr-7516.md, edit pr-3903.md instead

Because the release blog post will be generated from these files.

* edit pr-3903.md

Co-authored-by: Georgii Dolzhykov <thorn.mailbox@gmail.com>
2020-02-18 16:27:52 +02:00
Georgii Dolzhykov 16c0a7a10f Rudimentary support for the most used directives of AngularJS 1.x (#6869)
* Rudimentary support for the most used directives of AngularJS 1.x

* add ng-class and ng-style

* add changelog entry in the new format

* Update pr-6869.md

* update snapshots
2020-02-18 00:38:23 +02:00
fisker Cheung d2de524571 Don't add parens to undefined in ConditionalExpression with jsx (#7504)
* Add failed test

* Don't add parens to Literal and Identifier

* Update snap shot

* Move test to `jsx`

* Only undefined

* Add changelog
2020-02-17 16:34:50 +02:00
fisker CheungandGeorgii Dolzhykov 40a1418246 Format value of HTML class attribute (#7555)
* Format HTML attribute `class` value

* Add more example

* Typo

* Don't break

* exclude mustache and multiparser

Co-authored-by: Georgii Dolzhykov <thorn.mailbox@gmail.com>
2020-02-16 10:59:15 +02:00
Georgii Dolzhykov 5dab172700 Merge remote-tracking branch 'remotes/upstream/master' into next 2020-02-14 14:08:20 +02:00
Cory Forsyth 5bd45d79af fix(glimmer): Do not strip AttrNode value when it is not blank (#7552)
* failing test

* fix(glimmer): Do not strip attr node values when not blank

* Add user-facing changes
2020-02-14 13:39:59 +02:00
fisker Cheung 017d079ca8 Format value of HTML style attribute (#7556) 2020-02-14 14:21:11 +03:00
fisker Cheung 4bac066146 Refactor shouldPrintComma logic for angular (#7507) 2020-02-14 13:21:46 +03:00
Daiki Ihara 3a485c68dd Markdown: fix incorrect prettification of multi-line markdown footnote (#7203)
* fix incorrect prettification of multi-line markdown footnote

* update test of footnoteDefinition

* add changelog_unreleased pr-7203

* fix changelog_unreleased

* fix pointed out

* update snapshot test of markdown for footnote
2020-02-14 11:50:49 +02:00
fisker Cheung 61398f0dc7 Vue: don't print long single expression of TemplateLiteral and StringLiteral on new line (#7479)
* Add failed test

* Fix logic

* Update example

* More tests

* Add changelog_unreleased/vue/pr-7479.md

* Fix logic
2020-02-14 01:47:36 +02:00
fisker CheungandGeorgii Dolzhykov b35074007b HTML: Fix inconsistent formatting of self-closing tags (#7395)
* Fix inconsistent self-closing tag in vue

* Update snap

* Add changelog

* More test

* reword changelog

Co-authored-by: Georgii Dolzhykov <thorn.mailbox@gmail.com>
2020-02-10 13:36:25 +03:00
dependabot-preview[bot]andGeorgii Dolzhykov e94291f4b8 Bump @typescript-eslint/typescript-estree from 2.17.0 to 2.19.0 (#7540)
* Bump @typescript-eslint/typescript-estree from 2.17.0 to 2.19.0

Bumps [@typescript-eslint/typescript-estree](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/typescript-estree) from 2.17.0 to 2.19.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/typescript-estree/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v2.19.0/packages/typescript-estree)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* remove tests for obscure jsdoc function types

Co-authored-by: Georgii Dolzhykov <thorn.mailbox@gmail.com>
2020-02-04 15:25:37 +03:00
Kagami Sascha RosylightandGeorgii Dolzhykov 1cd90c9fb8 Do not add hard linebreak for html template (#7208)
* Do not add hard linebreak for html template

* Collapse whitespaces to single space char

* restore line breaking

* use `line` and rename vars

* add test

* support htmlWhitespaceSensitivity

* indent if breakable

* add htmlWhitespaceSensitivity test

* indent only when multiple top levels

* add a changelog entry

* update snapshot

* replace match with test

* split tests into multiple files for better readability of snapshots

* fix an edge case with html-in-js-in-html

Co-authored-by: Georgii Dolzhykov <thorn.mailbox@gmail.com>
2020-02-03 17:09:38 +02:00
fisker Cheung e2e534df30 Remove normalize-path package (#7465)
* Remove `normalize-path` module

* Try run all tests on `standalone`

* Restore test

* Add `no-parser-tests`

* Fix issue with shim

* DRY

* Rename tests

* Use `endsWith`
2020-02-03 01:33:19 +02:00
fisker Cheung 6e397b2bb2 Fix a failed test on flow parser (#7501)
* Add failed tests

* fix ast diff

* Delete dead code
2020-02-01 18:27:31 +02:00
Georgii Dolzhykov 850e705d10 Fix edge cases with parentheses around optional chaining (#7500)
* fix disappearing parens in (foo?.bar)()

* fix `new (foo?.bar)();`
2020-01-31 12:50:08 +02:00
fisker Cheung 340951f045 Keep parentheses of SequenceExpression for ExportDefaultDeclaration (#7491)
* Fix export default `SequenceExpression`

* Add more parser

* Add change log

* Fix  logic

* Rename that function

* Add a branch
2020-01-31 13:28:08 +03:00
fisker Cheung a1ce84a13b Cleanup dead code from pr7461 (#7468)
* Add test for #5810

* Remove maybe dead code

* Add changelog

* Remove old tests

* More dead code
2020-01-31 13:23:10 +03:00
fisker Cheung 947a174954 Flow: Add support for decorators (#7482)
* Update flow parse options

* Add `decorators` test

* Restore enums

* Add changelog

* Add babel-verify
2020-01-31 08:55:30 +09:00
fisker Cheung eb1e587d2f Flow: Add support for ClassPrivateProperty (#7484)
* Support `ClassPrivateProperty`

* Add changelog

* Code style

* Fix babel

* Move logic up

* Add tests

* Make test a little bit uglier
2020-01-31 01:51:27 +09:00
fisker Cheung 90128a3a00 Flow: add typing support for the symbol type (#7472)
* Flow: add typing support for the `symbol` type

* Add changelog
2020-01-30 13:08:01 +03:00
JounQinandGeorgii Dolzhykov c1937cb1b8 feat: add new parser babel-ts to parse TypeScript syntaxes via Babel (#6400)
* feat: add new parser `babel-ts` to parse TypeScript syntaxes via Babel

* docs: document parser babel-ts

* chore: enable babel-ts in markdown and worker.js

* verify all TS tests against babel-ts except disabled by disableBabelTS

* support for TSDeclareMethod; fix abstract properties and methods

* fix embedded angular templates and styles

* fix TSImportType

* simplify babel options combinations

* fix method decorators

* fix ranges

* work around loc inconsistencies for SequenceExpression

* don't print trailing comma in type parameters (unsupported in TS < 3.3)

* preserve quotes for class properties

* align printing of single-parameter functions

* fix comments in degenerate single-element unions and intersections

* fix comments for methods

* fix comments for mapped types

* edit docs, change 'since' to 2.0.0

* add changelog

* fix code sample on playground

* update snapshots after rebase

Co-authored-by: Georgii Dolzhykov <thorn.mailbox@gmail.com>
2020-01-29 14:11:16 +02:00
Alexander Kachkaev e00ce8c2c8 Change arrowParens to always by default for 2.0 (#7430) 2020-01-29 13:31:25 +02:00
dependabot-preview[bot]andGeorgii Dolzhykov f40fcba710 Bump angular-html-parser from 1.3.0 to 1.4.0 (#7461)
* Bump angular-html-parser from 1.3.0 to 1.4.0

Bumps [angular-html-parser](https://github.com/ikatyang/angular-html-parser) from 1.3.0 to 1.4.0.
- [Release notes](https://github.com/ikatyang/angular-html-parser/releases)
- [Changelog](https://github.com/ikatyang/angular-html-parser/blob/master/CHANGELOG.md)
- [Commits](https://github.com/ikatyang/angular-html-parser/compare/v1.3.0...v1.4.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* add test for #5810

closes #5810

Co-authored-by: Georgii Dolzhykov <thorn.mailbox@gmail.com>
2020-01-29 12:47:59 +03:00
Alexander Kachkaev 1b3a5d3572 Change endOfLine to lf by default for 2.0 (#7435)
* Towards changing default value for endOfLine

* Update tests and snapshots

* Add placeholder for changelog_unreleased

* Add CHANGELOG

* Undo adding snapshot tests for auto as it does not play well on Windows in CI

* Tweak changelog

* Update jest snapshot
2020-01-28 23:35:47 +02:00
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