Update dependency prettier to ^2.0.4
Created by: renovate[bot]
This PR contains the following updates:
Package | Type | Update | New value | References | Sourcegraph |
---|---|---|---|---|---|
prettier (source) | devDependencies | patch | ^2.0.4 | homepage, source |
Release Notes
prettier/prettier
v2.0.4
#7869, "[TypeScript] format TSAsExpression with same logic as BinaryExpression" (#7958)
Revert
v2.0.3
JavaScript
prettier-ignore
inside JSX (#7877 by @fisker)
Fix // Input
<div>
{
/* prettier-ignore */
x ? <Y/> : <Z/>
}
</div>;
// Prettier 2.0.2 (first output)
<div>
{/* prettier-ignore */
x ? <Y/> : <Z/>}
</div>;
// Prettier 2.0.2 (second output)
<div>{/* prettier-ignore */ x ? <Y/> : <Z/>}</div>;
// Prettier 2.0.3
<div>
{
/* prettier-ignore */
x ? <Y/> : <Z/>
}
</div>;
#7883 by @thorn0)
Fix regressions in styled-components template literals (// Input
const Icon = styled.div`
background: var(--${background});
${Link}:not(:first-child) {
fill: rebeccapurple;
}
`;
// Prettier 2.0.2
const Icon = styled.div`
background: var(-- ${background});
${Link}:not (:first-child) {
fill: rebeccapurple;
}
`;
// Prettier 2.0.3
const Icon = styled.div`
background: var(--${background});
${Link}:not(:first-child) {
fill: rebeccapurple;
}
`;
#7891 by @sidharthv96)
Fix: line endings were not always converted properly in multiline strings and comments (// Input
export const IAmIncredibleLongFunctionName = IAmAnotherFunctionName(<CRLF>
(_0: IAmIncredibleLongParameterType) => {<CRLF>
setTimeout(() => {<CRLF>
/*<CRLF>
Multiline comment<CRLF>
Multiline comment<CRLF>
Multiline comment<CRLF>
*/<CRLF>
console.log(<CRLF>
"Multiline string\<CRLF>
Multiline string\<CRLF>
Multiline string"<CRLF>
);<CRLF>
});<CRLF>
}<CRLF>
);<CRLF>
// Prettier 2.0.2
export const IAmIncredibleLongFunctionName = IAmAnotherFunctionName(<CRLF>
(_0: IAmIncredibleLongParameterType) => {<CRLF>
setTimeout(() => {<CRLF>
/*<LF>
Multiline comment<LF>
Multiline comment<LF>
Multiline comment<LF>
*/<CRLF>
console.log(<CRLF>
"Multiline string\<LF>
Multiline string\<LF>
Multiline string"<CRLF>
);<CRLF>
});<CRLF>
}<CRLF>
);<CRLF>
// Prettier 2.0.3: same as input
#7911 by @bakkot)
Fix bug with holes in array literals (// Input
new Test()
.test()
.test([, 0])
.test();
// Prettier 2.0.2
[error] in.js: TypeError: Cannot read property 'type' of null
// Prettier 2.0.3
new Test().test().test([, 0]).test();
TypeScript
#7869 by @sosukesuzuki)
Wrap TSAsExpression (// Input
const value = thisIsAnIdentifier as ThisIsAReallyReallyReallyReallyReallyReallyReallyReallyReallyReallyReallyLongInterface;
// Prettier 2.0.2
const value = thisIsAnIdentifier as ThisIsAReallyReallyReallyReallyReallyReallyReallyReallyReallyReallyReallyLongInterface;
// Prettier 2.0.3
const value =
thisIsAnIdentifier as
ThisIsAReallyReallyReallyReallyReallyReallyReallyReallyReallyReallyReallyLongInterface;
Flow
#7892 by @sosukesuzuki)
Print dangling comments for inexact object type (// Input
type Foo = {
// comment
...,
};
// Prettier 2.0.2
Error: Comment "comment" was not printed. Please report this error!
// Prettier 2.0.3
type Foo = {
// comment
...,
};
#7923 by @DmitryGonchar)
Do not add comma for explicit inexact object with indexer property or no properties (// Input
type T = {
[string]: number,
...,
}
type T = {
// comment
...,
}
// Prettier 2.0.2
type T = {
[string]: number,
...,
}
type T = {
// comment
...,
}
// Prettier 2.0.3
type T = {
[string]: number,
...
}
type T = {
// comment
...
}
HTML
#7867 by @fisker)
Fix printing of ignored empty inline elements (<!-- Input-->
<!--prettier-ignore--><span></span>
<!--prettier-ignore--><span>_</span>
<!-- Prettier 2.0.2 (first output) -->
<!--prettier-ignore--><span
></span>
<!--prettier-ignore--><span>_</span>
<!-- Prettier 2.0.2 (second output) -->
<!--prettier-ignore--><span
></span>
<!--prettier-ignore--><span>_</span>
<!-- Prettier 2.0.3 -->
<!--prettier-ignore--><span></span>
<!--prettier-ignore--><span>_</span>
script
and style
inside tags with a colon in the name (#7916 by @fisker)
Format <!-- Input -->
<with:colon>
<script>function foo(){ return 1}</script>
<style>a {color: #f00}</style>
</with:colon>
<!-- Prettier 2.0.2 -->
<with:colon>
<script>
function foo(){ return 1}
</script>
<style>
a {color: #f00}
</style>
</with:colon>
<!-- Prettier 2.0.3 -->
<with:colon>
<script>
function foo() {
return 1;
}
</script>
<style>
a {
color: #f00;
}
</style>
</with:colon>
Other changes
Renovate configuration
-
If you want to rebase/retry this PR, check this box
This PR has been generated by WhiteSource Renovate. View repository job log here.