Skip to content
This repository was archived by the owner on Nov 28, 2022. It is now read-only.

Commit 124e5ac

Browse files
dependabot-preview[bot]erunion
authored andcommitted
Bump prettier from 1.6.1 to 1.18.2 (#271)
* Bump prettier from 1.6.1 to 1.18.2 Bumps [prettier](https://github.com/prettier/prettier) from 1.6.1 to 1.18.2. - [Release notes](https://github.com/prettier/prettier/releases) - [Changelog](https://github.com/prettier/prettier/blob/master/CHANGELOG.md) - [Commits](prettier/prettier@1.6.1...1.18.2) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> * Resolving some issues with the Prettier upgrade.
1 parent fe32493 commit 124e5ac

File tree

20 files changed

+73
-96
lines changed

20 files changed

+73
-96
lines changed

packages/api-explorer/.prettierrc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{
22
"singleQuote": true,
33
"trailingComma": "all",
4-
"files": "./**/**.{js,jsx}",
54
"printWidth": 100,
65
}

packages/api-explorer/__tests__/block-types/Content.test.jsx

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,11 @@ test('should output one of each block type', () => {
77
const body = fs.readFileSync(`${__dirname}/blocks.txt`, 'utf8');
88
const content = mount(<Content body={body} isThreeColumn />);
99

10-
[
11-
'textarea',
12-
'html',
13-
'embed',
14-
'api-header',
15-
'code',
16-
'callout',
17-
'parameters',
18-
'image',
19-
].forEach(type => {
20-
expect(content.find(`.magic-block-${type}`).length).toBe(1);
21-
});
10+
['textarea', 'html', 'embed', 'api-header', 'code', 'callout', 'parameters', 'image'].forEach(
11+
type => {
12+
expect(content.find(`.magic-block-${type}`).length).toBe(1);
13+
},
14+
);
2215
});
2316

2417
const body = `

packages/api-explorer/__tests__/lib/get-auth.test.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ const getAuth = require('../../src/lib/get-auth');
55
const oas = new Oas(multipleSecurities);
66

77
it('should fetch all auths from the OAS files', () => {
8-
expect(
9-
getAuth({ oauthScheme: 'oauth', apiKeyScheme: 'apikey' }, { 'api-setting': oas }),
10-
).toEqual({
11-
oauthScheme: 'oauth',
12-
oauthDiff: '',
13-
apiKeyScheme: 'apikey',
14-
unknownAuthType: '',
15-
});
8+
expect(getAuth({ oauthScheme: 'oauth', apiKeyScheme: 'apikey' }, { 'api-setting': oas })).toEqual(
9+
{
10+
oauthScheme: 'oauth',
11+
oauthDiff: '',
12+
apiKeyScheme: 'apikey',
13+
unknownAuthType: '',
14+
},
15+
);
1616
});
1717

1818
it('should not error if oas.components is not set', () => {

packages/api-explorer/package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/api-explorer/src/Doc.jsx

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,7 @@ class Doc extends React.Component {
161161
</div>
162162

163163
<div className="hub-reference-right">
164-
{doc.type === 'endpoint' &&
165-
this.shouldShowCode() && (
164+
{doc.type === 'endpoint' && this.shouldShowCode() && (
166165
<div className="hub-reference-section-code">
167166
{this.renderCodeSample()}
168167
<div className="hub-reference-results tabber-parent">{this.renderResponse()}</div>
@@ -235,11 +234,9 @@ class Doc extends React.Component {
235234

236235
return (
237236
<EndpointErrorBoundary>
238-
{this.props.appearance.referenceLayout === 'column' ? (
239-
this.columnTheme(doc)
240-
) : (
241-
this.mainTheme(doc)
242-
)}
237+
{this.props.appearance.referenceLayout === 'column'
238+
? this.columnTheme(doc)
239+
: this.mainTheme(doc)}
243240
</EndpointErrorBoundary>
244241
);
245242
}

packages/api-explorer/src/EndpointErrorBoundary.jsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,7 @@ class EndpointErrorBoundary extends React.Component {
2424
<h3>
2525
There was an error rendering this endpoint. If you are the owner of this project
2626
please contact{' '}
27-
<a href="mailto:support@readme.io?subject=API Explorer Error">
28-
support@readme.io
29-
</a>{' '}
27+
<a href="mailto:support@readme.io?subject=API Explorer Error">support@readme.io</a>{' '}
3028
with the following error:
3129
</h3>
3230
<BoundaryStackTrace error={this.state.error} info={this.state.info} />

packages/api-explorer/src/Example.jsx

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,7 @@ function Example({
7979
const hasExamples = examples.find(e => e.code && e.code !== '{}');
8080
return (
8181
<div className="hub-reference-results-examples code-sample">
82-
{examples &&
83-
examples.length > 0 &&
84-
hasExamples && (
82+
{examples && examples.length > 0 && hasExamples && (
8583
<span>
8684
<ExampleTabs examples={examples} selected={selected} setExampleTab={setExampleTab} />
8785
<div className="code-sample-body">
@@ -123,11 +121,9 @@ function Example({
123121
)}
124122
{(examples.length === 0 || (!hasExamples && result === null)) && (
125123
<div className="hub-no-code">
126-
{oas[extensions.EXPLORER_ENABLED] ? (
127-
'Try the API to see Results'
128-
) : (
129-
'No response examples available'
130-
)}
124+
{oas[extensions.EXPLORER_ENABLED]
125+
? 'Try the API to see Results'
126+
: 'No response examples available'}
131127
</div>
132128
)}
133129
</div>

packages/api-explorer/src/PathUrl.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ function PathUrl({
6262
>
6363
{!loading && (
6464
<span className="try-it-now-btn">
65-
<span className="fa fa-compass" />&nbsp;
65+
<span className="fa fa-compass" />
66+
&nbsp;
6667
<span>Try It</span>
6768
</span>
6869
)}
@@ -74,8 +75,7 @@ function PathUrl({
7475

7576
<span className={`pg-type-big pg-type type-${operation.method}`}>{operation.method}</span>
7677

77-
{oas.servers &&
78-
oas.servers.length > 0 && (
78+
{oas.servers && oas.servers.length > 0 && (
7979
<span className="definition-url">
8080
<span className="url">{oas.url()}</span>
8181
{splitPath(operation.path).map(part => (

packages/api-explorer/src/ResponseBody.jsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ function Authorized({ result }) {
1111
return (
1212
<div>
1313
{result.isBinary && <div>A binary file was returned</div>}
14-
{!result.isBinary &&
15-
isJson && (
14+
{!result.isBinary && isJson && (
1615
<ReactJson
1716
src={result.responseBody}
1817
collapsed={1}
@@ -29,8 +28,7 @@ function Authorized({ result }) {
2928
}}
3029
/>
3130
)}
32-
{!result.isBinary &&
33-
!isJson && (
31+
{!result.isBinary && !isJson && (
3432
<pre className="tomorrow-night">
3533
<div className="cm-s-tomorrow-night codemirror-highlight">
3634
{syntaxHighlighter(result.responseBody, result.type)}

packages/api-explorer/src/ResponseSchemaBody.jsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,7 @@ function ResponseSchemaBody({ schema, oas }) {
118118

119119
return (
120120
<div>
121-
{schema &&
122-
schema.type && (
121+
{schema && schema.type && (
123122
<p style={{ fontStyle: 'italic', margin: '0 0 10px 15px' }}>
124123
{`Response schema type: `}
125124
<span style={{ fontWeight: 'bold' }}>{getSchemaType(schema)}</span>

0 commit comments

Comments
 (0)