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

Commit

Permalink
Bump prettier from 1.6.1 to 1.18.2 (#271)
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
dependabot-preview[bot] authored and erunion committed Aug 12, 2019
1 parent fe32493 commit 124e5ac
Show file tree
Hide file tree
Showing 20 changed files with 73 additions and 96 deletions.
1 change: 0 additions & 1 deletion packages/api-explorer/.prettierrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"singleQuote": true,
"trailingComma": "all",
"files": "./**/**.{js,jsx}",
"printWidth": 100,
}
17 changes: 5 additions & 12 deletions packages/api-explorer/__tests__/block-types/Content.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,11 @@ test('should output one of each block type', () => {
const body = fs.readFileSync(`${__dirname}/blocks.txt`, 'utf8');
const content = mount(<Content body={body} isThreeColumn />);

[
'textarea',
'html',
'embed',
'api-header',
'code',
'callout',
'parameters',
'image',
].forEach(type => {
expect(content.find(`.magic-block-${type}`).length).toBe(1);
});
['textarea', 'html', 'embed', 'api-header', 'code', 'callout', 'parameters', 'image'].forEach(
type => {
expect(content.find(`.magic-block-${type}`).length).toBe(1);
},
);
});

const body = `
Expand Down
16 changes: 8 additions & 8 deletions packages/api-explorer/__tests__/lib/get-auth.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ const getAuth = require('../../src/lib/get-auth');
const oas = new Oas(multipleSecurities);

it('should fetch all auths from the OAS files', () => {
expect(
getAuth({ oauthScheme: 'oauth', apiKeyScheme: 'apikey' }, { 'api-setting': oas }),
).toEqual({
oauthScheme: 'oauth',
oauthDiff: '',
apiKeyScheme: 'apikey',
unknownAuthType: '',
});
expect(getAuth({ oauthScheme: 'oauth', apiKeyScheme: 'apikey' }, { 'api-setting': oas })).toEqual(
{
oauthScheme: 'oauth',
oauthDiff: '',
apiKeyScheme: 'apikey',
unknownAuthType: '',
},
);
});

it('should not error if oas.components is not set', () => {
Expand Down
8 changes: 4 additions & 4 deletions packages/api-explorer/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 4 additions & 7 deletions packages/api-explorer/src/Doc.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,7 @@ class Doc extends React.Component {
</div>

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

return (
<EndpointErrorBoundary>
{this.props.appearance.referenceLayout === 'column' ? (
this.columnTheme(doc)
) : (
this.mainTheme(doc)
)}
{this.props.appearance.referenceLayout === 'column'
? this.columnTheme(doc)
: this.mainTheme(doc)}
</EndpointErrorBoundary>
);
}
Expand Down
4 changes: 1 addition & 3 deletions packages/api-explorer/src/EndpointErrorBoundary.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@ class EndpointErrorBoundary extends React.Component {
<h3>
There was an error rendering this endpoint. If you are the owner of this project
please contact{' '}
<a href="mailto:support@readme.io?subject=API Explorer Error">
support@readme.io
</a>{' '}
<a href="mailto:support@readme.io?subject=API Explorer Error">support@readme.io</a>{' '}
with the following error:
</h3>
<BoundaryStackTrace error={this.state.error} info={this.state.info} />
Expand Down
12 changes: 4 additions & 8 deletions packages/api-explorer/src/Example.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,7 @@ function Example({
const hasExamples = examples.find(e => e.code && e.code !== '{}');
return (
<div className="hub-reference-results-examples code-sample">
{examples &&
examples.length > 0 &&
hasExamples && (
{examples && examples.length > 0 && hasExamples && (
<span>
<ExampleTabs examples={examples} selected={selected} setExampleTab={setExampleTab} />
<div className="code-sample-body">
Expand Down Expand Up @@ -123,11 +121,9 @@ function Example({
)}
{(examples.length === 0 || (!hasExamples && result === null)) && (
<div className="hub-no-code">
{oas[extensions.EXPLORER_ENABLED] ? (
'Try the API to see Results'
) : (
'No response examples available'
)}
{oas[extensions.EXPLORER_ENABLED]
? 'Try the API to see Results'
: 'No response examples available'}
</div>
)}
</div>
Expand Down
6 changes: 3 additions & 3 deletions packages/api-explorer/src/PathUrl.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ function PathUrl({
>
{!loading && (
<span className="try-it-now-btn">
<span className="fa fa-compass" />&nbsp;
<span className="fa fa-compass" />
&nbsp;
<span>Try It</span>
</span>
)}
Expand All @@ -74,8 +75,7 @@ function PathUrl({

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

{oas.servers &&
oas.servers.length > 0 && (
{oas.servers && oas.servers.length > 0 && (
<span className="definition-url">
<span className="url">{oas.url()}</span>
{splitPath(operation.path).map(part => (
Expand Down
6 changes: 2 additions & 4 deletions packages/api-explorer/src/ResponseBody.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ function Authorized({ result }) {
return (
<div>
{result.isBinary && <div>A binary file was returned</div>}
{!result.isBinary &&
isJson && (
{!result.isBinary && isJson && (
<ReactJson
src={result.responseBody}
collapsed={1}
Expand All @@ -29,8 +28,7 @@ function Authorized({ result }) {
}}
/>
)}
{!result.isBinary &&
!isJson && (
{!result.isBinary && !isJson && (
<pre className="tomorrow-night">
<div className="cm-s-tomorrow-night codemirror-highlight">
{syntaxHighlighter(result.responseBody, result.type)}
Expand Down
3 changes: 1 addition & 2 deletions packages/api-explorer/src/ResponseSchemaBody.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,7 @@ function ResponseSchemaBody({ schema, oas }) {

return (
<div>
{schema &&
schema.type && (
{schema && schema.type && (
<p style={{ fontStyle: 'italic', margin: '0 0 10px 15px' }}>
{`Response schema type: `}
<span style={{ fontWeight: 'bold' }}>{getSchemaType(schema)}</span>
Expand Down
3 changes: 1 addition & 2 deletions packages/api-explorer/src/block-types/ApiHeader.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ const ApiHeader = ({ block }) => {
<h1 className="header-scroll is-api-header">
<span id={slug(block.data.title)} />
<div className="anchor waypoint" id={`section-${slug(block.data.title)}`} />
{block.data.type &&
block.data.type !== 'basic' && (
{block.data.type && block.data.type !== 'basic' && (
<span className={`pg-type-big pg-type type-${slug(block.data.type)}`} />
)}
{block.data.title}
Expand Down
11 changes: 6 additions & 5 deletions packages/api-explorer/src/block-types/CallOut.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ function Icon({ type }) {
const CallOut = ({ block, flags }) => {
return (
<div
className={`magic-block-callout type-${block.data.type} ${block.data.title
? ''
: 'no-title'} `}
className={`magic-block-callout type-${block.data.type} ${
block.data.title ? '' : 'no-title'
} `}
>
{block.data.title && (
<h3>
Expand All @@ -36,8 +36,9 @@ const CallOut = ({ block, flags }) => {
<Icon type={block.data.type} />
</span>
)}
{block.data &&
block.data.body && <div className="callout-body">{markdown(block.data.body, flags)}</div>}
{block.data && block.data.body && (
<div className="callout-body">{markdown(block.data.body, flags)}</div>
)}
</div>
);
};
Expand Down
4 changes: 1 addition & 3 deletions packages/api-explorer/src/block-types/Image.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@ const ImageBlock = ({ block, flags }) => {
return (
// eslint-disable-next-line react/no-array-index-key
<div className="magic-block-image" key={i}>
{image &&
image.image &&
image.image.length && (
{image && image.image && image.image.length && (
<div>
<figure>
<a
Expand Down
3 changes: 1 addition & 2 deletions packages/api-explorer/src/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,7 @@ class ApiExplorer extends React.Component {
<div className={`is-lang-${this.state.language}`}>
<div
id="hub-reference"
className={`content-body hub-reference-sticky hub-reference-theme-${this.props.appearance
.referenceLayout}`}
className={`content-body hub-reference-sticky hub-reference-theme-${this.props.appearance.referenceLayout}`}
>
{this.props.docs.map((doc, index) => (
<VariablesContext.Provider value={this.props.variables}>
Expand Down
11 changes: 6 additions & 5 deletions packages/api-explorer/src/lib/oas-to-har.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,12 @@ function formatter(values, param, type, onlyIfExists) {
return format.key(param.name);
}

const defaultValues = Object.keys(
require('./parameters-to-json-schema').types,
).reduce((prev, curr) => {
return Object.assign(prev, { [curr]: {} });
}, {});
const defaultValues = Object.keys(require('./parameters-to-json-schema').types).reduce(
(prev, curr) => {
return Object.assign(prev, { [curr]: {} });
},
{},
);

// If you pass in types, it either uses a default, or favors
// anything JSON.
Expand Down
6 changes: 3 additions & 3 deletions packages/api-logs/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 12 additions & 12 deletions packages/markdown/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion packages/syntax-highlighter/.prettierrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"singleQuote": true,
"trailingComma": "all",
"files": "./**/**.{js,jsx}",
"printWidth": 100,
}
14 changes: 7 additions & 7 deletions packages/syntax-highlighter/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions packages/variable/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 124e5ac

Please sign in to comment.