* 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
* Fix MDX html parsing errors
For MDX wrap JSX parsing in a fragment before sending it of to babel for
parsing and formatting. In MDX adjacent JSX tags are permitted in the
root.
An option sent to the babel parser omits printing the root fragment and
instead just prints its children.
Solves #6943
* an attempt to address JounQin's comments
* use <$>...</$> instead of <>...</>
* refactoring
Closes#6891.
This downgrades the get-stream package from 5.x to 4.x, which does not
use `async` functions which works around the problem of
`regeneratorRuntime` not being defined (it shouldn’t be needed).
This is an alternative solution to #6893 because I don’t know yet if we
want to enable `corejs` given that we will most likely drop support for
Node.js 8 and older in the next version.
Just like #6893 this PR comes without tests, but I verified locally that
`--stdin` works after this change.