Build(deps-dev): bump prettier from 1.18.2 to 1.19.1 (#4328)

* Build(deps-dev): bump prettier from 1.18.2 to 1.19.1

Bumps [prettier](https://github.com/prettier/prettier) from 1.18.2 to 1.19.1.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/master/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/1.18.2...1.19.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* Build(deps-dev): bump prettier from 1.18.2 to 1.19.1

Bumps [prettier](https://github.com/prettier/prettier) from 1.18.2 to 1.19.1.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/master/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/1.18.2...1.19.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* chore: apply new prettier formatting

* chore: try prettier, again
This commit is contained in:
dependabot-preview[bot]
2019-11-15 19:33:40 -06:00
committed by Caleb Cartwright
parent 3028608f4c
commit 0f332413df
13 changed files with 71 additions and 57 deletions

View File

@@ -49,7 +49,9 @@ describe('BaseJsonService', function() {
expect(sendAndCacheRequest).to.have.been.calledOnceWith(
'http://example.com/foo.json',
{ headers: { Accept: 'application/json' } }
{
headers: { Accept: 'application/json' },
}
)
})

View File

@@ -68,7 +68,9 @@ describe('BaseSvgScrapingService', function() {
expect(sendAndCacheRequest).to.have.been.calledOnceWith(
'http://example.com/foo.svg',
{ headers: { Accept: 'image/svg+xml' } }
{
headers: { Accept: 'image/svg+xml' },
}
)
})

View File

@@ -49,7 +49,9 @@ describe('BaseXmlService', function() {
expect(sendAndCacheRequest).to.have.been.calledOnceWith(
'http://example.com/foo.xml',
{ headers: { Accept: 'application/xml, text/xml' } }
{
headers: { Accept: 'application/xml, text/xml' },
}
)
})

View File

@@ -15,9 +15,9 @@ describe('coalesceBadge', function() {
// This behavior isn't great and we might want to remove it.
it('uses the category as a default label', function() {
expect(coalesceBadge({}, {}, {}, { category: 'cat' }).text).to.deep.equal(
['cat', 'n/a']
)
expect(
coalesceBadge({}, {}, {}, { category: 'cat' }).text
).to.deep.equal(['cat', 'n/a'])
})
it('preserves an empty label', function() {

View File

@@ -82,9 +82,12 @@ function assertNamesUnique(names, { message }) {
function checkNames() {
const services = loadServiceClasses()
assertNamesUnique(services.map(({ name }) => name), {
message: 'Duplicate service names found',
})
assertNamesUnique(
services.map(({ name }) => name),
{
message: 'Duplicate service names found',
}
)
}
function collectDefinitions() {

View File

@@ -187,7 +187,11 @@ class Server {
camp.route(/\.(gif|jpg)$/, (query, match, end, request) => {
const [, format] = match
makeSend('svg', request.res, end)(
makeSend(
'svg',
request.res,
end
)(
makeBadge({
text: ['410', `${format} no longer available`],
color: 'lightgray',
@@ -198,7 +202,11 @@ class Server {
if (!rasterUrl) {
camp.route(/\.png$/, (query, match, end, request) => {
makeSend('svg', request.res, end)(
makeSend(
'svg',
request.res,
end
)(
makeBadge({
text: ['404', 'raster badges not available'],
color: 'lightgray',
@@ -212,7 +220,11 @@ class Server {
const [, extension] = match
const format = (extension || '.svg').replace(/^\./, '')
makeSend(format, request.res, end)(
makeSend(
format,
request.res,
end
)(
makeBadge({
text: ['404', 'badge not found'],
color: 'red',

View File

@@ -121,7 +121,9 @@ describe('The server', function() {
it('should return the 404 badge page for rando links', async function() {
const { statusCode, body } = await got(
`${baseUrl}this/is/most/definitely/not/a/badge.js`,
{ throwHttpErrors: false }
{
throwHttpErrors: false,
}
)
expect(statusCode).to.equal(404)
expect(body)

View File

@@ -130,13 +130,10 @@ export default function PathBuilder({
tokens
.filter(t => typeof t !== 'string')
.map(t => t as Key)
.reduce(
(accum, { name }) => {
accum[name] = ''
return accum
},
{} as { [k: string]: string }
)
.reduce((accum, { name }) => {
accum[name] = ''
return accum
}, {} as { [k: string]: string })
)
useEffect(() => {

View File

@@ -241,33 +241,27 @@ export default function QueryStringBuilder({
const [queryParams, setQueryParams] = useState(() =>
// For each of the custom query params defined in `exampleParams`,
// create empty values in `queryParams`.
Object.entries(exampleParams).reduce(
(accum, [name, value]) => {
// Custom query params are either string or boolean. Inspect the example
// value to infer which one, and set empty values accordingly.
// Throughout the component, these two types are supported in the same
// manner: by inspecting this value type.
const isStringParam = typeof value === 'string'
accum[name] = isStringParam ? '' : true
return accum
},
{} as { [k: string]: string | boolean }
)
Object.entries(exampleParams).reduce((accum, [name, value]) => {
// Custom query params are either string or boolean. Inspect the example
// value to infer which one, and set empty values accordingly.
// Throughout the component, these two types are supported in the same
// manner: by inspecting this value type.
const isStringParam = typeof value === 'string'
accum[name] = isStringParam ? '' : true
return accum
}, {} as { [k: string]: string | boolean })
)
// For each of the standard badge options, create empty values in
// `badgeOptions`. When `initialStyle` has been provided, use it.
const [badgeOptions, setBadgeOptions] = useState(() =>
supportedBadgeOptions.reduce(
(accum, { name }) => {
if (name === 'style') {
accum[name] = initialStyle
} else {
accum[name] = ''
}
return accum
},
{} as Record<BadgeOptionName, string>
)
supportedBadgeOptions.reduce((accum, { name }) => {
if (name === 'style') {
accum[name] = initialStyle
} else {
accum[name] = ''
}
return accum
}, {} as Record<BadgeOptionName, string>)
)
function handleServiceQueryParamChange({

View File

@@ -99,13 +99,10 @@ export default function Main({ pageContext }: { pageContext: PageContext }) {
category: Category
definitions: ServiceDefinition[]
}) {
const flattened = definitions.reduce(
(accum, current) => {
const { examples } = current
return accum.concat(examples)
},
[] as Example[]
)
const flattened = definitions.reduce((accum, current) => {
const { examples } = current
return accum.concat(examples)
}, [] as Example[])
return (
<div>

6
package-lock.json generated
View File

@@ -23051,9 +23051,9 @@
"dev": true
},
"prettier": {
"version": "1.18.2",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-1.18.2.tgz",
"integrity": "sha512-OeHeMc0JhFE9idD4ZdtNibzY0+TPHSpSSb9h8FqtP+YnoZZ1sl8Vc9b1sasjfymH3SonAF4QcA2+mzHPhMvIiw==",
"version": "1.19.1",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-1.19.1.tgz",
"integrity": "sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew==",
"dev": true
},
"pretty-bytes": {

View File

@@ -232,7 +232,7 @@
"nyc": "^14.1.1",
"opn-cli": "^5.0.0",
"portfinder": "^1.0.25",
"prettier": "1.18.2",
"prettier": "1.19.1",
"react": "^16.11.0",
"react-dom": "^16.11.0",
"react-error-overlay": "^6.0.3",

View File

@@ -110,9 +110,12 @@ class GithubRelease extends GithubAuthV3Service {
static getLatestRelease({ releases, sort, includePrereleases }) {
if (sort === 'semver') {
const latestRelease = latest(releases.map(release => release.tag_name), {
pre: includePrereleases,
})
const latestRelease = latest(
releases.map(release => release.tag_name),
{
pre: includePrereleases,
}
)
const kvpairs = Object.assign(
...releases.map(release => ({ [release.tag_name]: release.prerelease }))
)