* 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>
* 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
* 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
* 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>
* 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>
* 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>
* 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
* 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>
* 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>
* 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
* Remove extra indent
* add changelog
* Fix postprocess for range of TypeScript
* Remove locend from postprocess
* Add test for no-smei
* Remove hasLeadingComment
* 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