* JSDoc type added in `src/common/util.js`
* skip can return false
* Add TBD for false - 1 not allowed
* Define typedef SkipOptions
* Use method generic for node param
* Define node param for setLocStart and setLocEnd
* Copy idx param to local variable
* Add @returns false
* Update Utility functions docs
* hasNewline param index: allow only number
* Add condition
* Add function keyword to docs
* Add prettier-ignore
* Improve condition
* Remove TBD comment
* Use single quotes
* Add type to oldIndex
* Use singleline JSDocs
Co-Authored-By: Christopher J. Brody <chris@brody.consulting>
Co-Authored-By: Christopher Quadflieg <christopher.quadflieg@adsoul.com>
Co-Authored-By: Georgii Dolzhykov <thorn.mailbox@gmail.com>
* WIP: Support TypeScript 3.7
* Add support for `asserts` keyword; Update snapshots
* Update typescript-estree to v2.5.0 to remove the dependency on chokidar
* Update TypeScript
* Update CHANGELOG.unreleased.md
* Add examples for TypeScript 3.7
* Update TypeScript 3.7 to latest dev version
* Correct wording
* Support `declare` keyword on class members (TypeScript 3.7 feature)
* Update Changelog and downgrade TypeScript from 3.8.0-dev to 3.7.1-rc
* Add a note regarding to dropping Node 6 support for direct installation
* tweak build config to repair build
* update CHANGELOG.unreleased.md
* TSTypePredicate microrefactoring
* fix formatting
* clean up tests
* fix parens for optional chaining inside computed properties
* update CHANGELOG.unreleased.md
* unify output across parsers for template literals
* enable more tests with optional chaining
* fix unneeded parens inside computed key of OptionalMemberExpression
* fix paren issues for OptionalCallExpression
* more fixes for OptionalCallExpression
* @typescript-eslint/typescript-estree 2.5.1-alpha.4
* fix lint
* revert build hacks
* fix one more parens issue
* @typescript-eslint/typescript-estree 2.5.1-alpha.5, remove loggerFn override
* drop node 6 for direct installing from github
* fix another parens issue, disable some tests for flow
* workaround for flow bug
* fix issues with comments
Co-authored-by: Georgii Dolzhykov <thorn.mailbox@gmail.com>
* Add formatting for i18n attributes.
Previously, Prettier would largely ignore i18n attributes, not even
wrapping their content, which wasn't ideal since i18n descriptive text
can sometimes get long.
After this, Prettier will auto-wrap the contents of i18n attributes once
they exceed the line length.
Fixes#5875.
with unused `oppositeDescription` parameter removed
and reordering of some other members
to resolve checkJs issues in `src/main/core-options.js`,
as verified by the following command:
npx tsc --allowJs --checkJs --noEmit --target es5 src/main/core-options.js
* Modify to define isJestEachFunctionCall
* Modify to break ArrayExpression when parent is jest each function
* Add tests
* Update CHANGELOG.unreleased.md
* Fix comment
* Add pr number
* Update CHANGELOG.unreleased.md
* Remove hasNewLineInRange
* Modify to change logic for breaking jest each call function
* Modify to add logic for breaking ArrayExpression
* Modify to avoid mixed nested array
* Modify to remove changes for jest
* Update CHANGELOG.unreleased.md
* Update CHANGELOG.unreleased.md
* Modify to fix arguments with object contains newline in arrow function(nested)
* Update CHANGELOG.unreleased.md
* Update tests
* Modify to refactor
* Modify to refactor
* Add pr number and link
* Update CHANGELOG.unreleased.md
* Modify to remove unnecessary null checking
* Fix for ArrayPattern
* Fix for RestElement
* Fix for AssignmentPattern
* Update tests
* Fix for nested array and object
* Update tests
* Fix for nested array pattern
* Update tests
* Modify to discard unnecessary node type check
* Fix for rest element
* Fix for array in rest
* Fix for array in assignment pattern
* Update tests
* Fix for CallExpression with Assignment
* Fix for ArrowFunction with AssignmentPattern
* Update tests
* Modify to support generally pattern
* Update tests
* Modify to use path.each instead of path.map
* Fix for multi arguments
* Fix typo, Argments => Arguments
* Improve curly and whitespace handling
* Refactoring and clean up
* Collapse elements with non-whitespace children
* Clean selfClosing check in AST compare
selfClosing tags can't be considered when using AST_COMPARE=1.
The new AST may have a Glimmer component that has been collapsed,
ie: <HelloWorld></HelloWorld> -> <HelloWorld />
These result in different ASTs and thereofre we need to clean the
check that compares self-closing in the before and after ASTs
Co-authored-by: Jamie White <jamie@jgwhite.co.uk>
* Add istanbul ignore for ternaries in utilities
* Improve handling around whitespace near elements and block statements
* Update tests after rebasing
* Fix CHANGELOG.unreleased.md after rebase
* Tweak regex around leading and trialing line beraks and update test
Co-authored-by: FabHof <35104465+FabHof@users.noreply.github.com>
* Extract attribute value from concat node
* Modify to wrap jsx element used with member-expression in tsx
* Add tests
* Update CHANGELOG.unreleased.md
* Modify to support no-inline jsx element
* Add pr number
* Fix from lint-docs
* Modify to rename isTsx => isTSXFile
* Modify to no considering file ext
* Support JSXFragment and add tests
* Update CHANGELOG.unreleased.md
* unify code for printing methods, remove isNodeStartingWithDeclare hacks
* body is BlockStatement, not an array
* getters and setters can't be async
* unify printPropertyKey calls
* get rid of TSParenthesizedType nodes before proceeding with formatting
* fix parens for TSIndexedAccessType, TSFunctionType, TSConditionalType
fixes#6603
* workaround edge cases with one-item unions and intersections
* fix parens for TSInferType
* fix parens for rest elements in tuple types
* refactoring
* fix function types in conditional types
* move tests for rest and optional tuple elements
* fix comment issues
* tests for unions and intersections
* add parens around multiline unions in tuple
* move the parens check for TS nodes closer to the one for Flow nodes
* update CHANGELOG.unreleased.md
* remove dead code
* fix parens for TSConstructorType
* better wording in CHANGELOG.unreleased.md
This plugin was recently added on Babel side and allows to parse custom syntax for V8 intrinsics.
They don't clash with any real-world JavaScript syntax, so adding this option should be as safe as any other plugin, and would allow to format JavaScript that uses such intrinsics (e.g. code inside Node.js or V8 itself).
The spec was updated ( https://tc39.es/proposal-nullish-coalescing/ ) with the following two changes:
- ?? has lower precedence than ||. (previously equal)
- ?? cannot immediately contain, or be contained within, an && or || operation. (parens are now required)
The safe way to upgrade is to run prettier with just this change so that parenthesis are properly added. Then to upgrade the parser (only flow supports the new precendence in the next release, babel hasn't been updated yet) in prettier so that the new precedence is being used. Failure to do so will result in parse errors because of missing parenthesis so we will not have silent errors.
There was only 44 callsites mixing || and ?? in a confusing way in the Facebook codebase so it shouldn't be a huge deal in practice.