Upgrade Prettier from 1.17 to 2.0.2.

Summary:
This gets us on the latest Prettier 2.x:
https://prettier.io/blog/2020/03/21/2.0.0.html

Notably, this adds support for TypeScript 3.8,
which introduces new syntax, such as `import type`.

Reviewed By: zertosh

Differential Revision: D20636268

fbshipit-source-id: fca5833d003804333a05ba16325bbbe0e06d6c8a
This commit is contained in:
Michael Bolin
2020-03-24 20:18:20 -07:00
committed by Facebook GitHub Bot
parent 4f1231f411
commit 5bf93e81ba
7 changed files with 24 additions and 28 deletions

View File

@@ -32,6 +32,6 @@
"develop": "gatsby develop" "develop": "gatsby develop"
}, },
"devDependencies": { "devDependencies": {
"prettier": "1.17.0" "prettier": "2.0.2"
} }
} }

View File

@@ -27,9 +27,11 @@ export const JSEnumLookup = {
}; };
function getEnum(yogaEnum: string, value: string | number): string { function getEnum(yogaEnum: string, value: string | number): string {
return `yoga.${Object.keys(yoga) return `yoga.${
Object.keys(yoga)
.filter(key => key.toLowerCase().startsWith(yogaEnum.toLowerCase())) .filter(key => key.toLowerCase().startsWith(yogaEnum.toLowerCase()))
.find(key => yoga[key] === value) || value}`; .find(key => yoga[key] === value) || value
}`;
} }
function setProperty( function setProperty(

View File

@@ -52,9 +52,7 @@ export default class URLShortener extends Component<{}, State> {
} }
fetch( fetch(
`https://cors-anywhere.herokuapp.com/tinyurl.com/api-create.php?url=${ `https://cors-anywhere.herokuapp.com/tinyurl.com/api-create.php?url=${window.location.href}`,
window.location.href
}`,
) )
.then(res => res.text()) .then(res => res.text())
.then(shortURL => this.setState({shortURL, loading: false})) .then(shortURL => this.setState({shortURL, loading: false}))

View File

@@ -57,10 +57,7 @@ export default class YogaEnumSelect extends Component<Props> {
getTitle = (property: string, key: string): string => { getTitle = (property: string, key: string): string => {
const replacer = new RegExp(`^${property}_`); const replacer = new RegExp(`^${property}_`);
return key return key.replace(replacer, '').replace('_', ' ').toLowerCase();
.replace(replacer, '')
.replace('_', ' ')
.toLowerCase();
}; };
render() { render() {

View File

@@ -49,8 +49,7 @@ export default ({data}) => (
({node}) => ({node}) =>
node.fileAbsolutePath.indexOf(`/${category}/`) > -1, node.fileAbsolutePath.indexOf(`/${category}/`) > -1,
) )
.map( .map(({node}) =>
({node}) =>
node.frontmatter.redirect ? ( node.frontmatter.redirect ? (
<a key={node.id} href={node.frontmatter.path}> <a key={node.id} href={node.frontmatter.path}>
{node.frontmatter.title} {node.frontmatter.title}

View File

@@ -6978,10 +6978,10 @@ preserve@^0.2.0:
version "0.2.0" version "0.2.0"
resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b" resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b"
prettier@1.17.0: prettier@2.0.2:
version "1.17.0" version "2.0.2"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.17.0.tgz#53b303676eed22cc14a9f0cec09b477b3026c008" resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.0.2.tgz#1ba8f3eb92231e769b7fcd7cb73ae1b6b74ade08"
integrity sha512-sXe5lSt2WQlCbydGETgfm1YBShgOX4HxQkFPvbxkcwgDvGDeqVau8h+12+lmSVlP3rHPz0oavfddSZg/q+Szjw== integrity sha512-5xJQIPT8BraI7ZnaDwSbu5zLrB6vvi8hVV58yHQ+QK64qrY40dULy0HSRlQ2/2IdzeBpjhDkqdcFBnFeDEMVdg==
pretty-bytes@^4.0.2: pretty-bytes@^4.0.2:
version "4.0.2" version "4.0.2"