Skip to content

Commit

Permalink
Update of prettier and running it over sources (#143)
Browse files Browse the repository at this point in the history
  • Loading branch information
matystl authored and IvanGoncharov committed Dec 5, 2019
1 parent 3c1c382 commit 783dcfe
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 26 deletions.
27 changes: 12 additions & 15 deletions demo/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,16 @@ export default class Demo extends React.Component {

const { url, withCredentials } = getQueryParams();
if (url) {
this.state.introspection = introspectionQuery => fetch(url, {
method: 'post',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
},
body: JSON.stringify({ query: introspectionQuery }),
...(
withCredentials === 'true'
? { credentials: 'include', mode: 'cors' }
: {}
),
}).then(response => response.json());
this.state.introspection = introspectionQuery =>
fetch(url, {
method: 'post',
headers: {
Accept: 'application/json',
'Content-Type': 'application/json',
},
body: JSON.stringify({ query: introspectionQuery }),
...(withCredentials === 'true' ? { credentials: 'include', mode: 'cors' } : {}),
}).then(response => response.json());
}
}

Expand All @@ -54,7 +51,7 @@ export default class Demo extends React.Component {
<Logo />
<Button
color="primary"
style={{color: 'white'}}
style={{ color: 'white' }}
variant="contained"
className="choosebutton"
onClick={openChangeSchema}
Expand All @@ -67,7 +64,7 @@ export default class Demo extends React.Component {
<IntrospectionModal
open={changeSchemaModalOpen}
onClose={closeChangeSchema}
onChange={(introspection) => this.setState({ introspection })}
onChange={introspection => this.setState({ introspection })}
/>
</MuiThemeProvider>
);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"postcss-import": "12.0.1",
"postcss-loader": "3.0.0",
"postcss-variables-loader": "5.0.1",
"prettier": "1.17.0",
"prettier": "1.19.1",
"raw-loader": "1.0.0",
"react": "16.8.6",
"react-clipboard.js": "2.0.7",
Expand Down
2 changes: 1 addition & 1 deletion src/components/doc-explorer/TypeList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export default class TypeList extends React.Component<TypeListProps> {

return (
<div key={type.id} className={classNames('typelist-item', className)}>
<TypeLink type={type} onClick={onTypeLink} filter={filter}/>
<TypeLink type={type} onClick={onTypeLink} filter={filter} />
<FocusTypeButton onClick={() => onFocusType(type)} />
<Description className="-doc-type" text={type.description} />
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/graph/viewport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export class Viewport {
this.container.innerHTML = '';
this.$svg = stringToSvg(svgString);
this.container.appendChild(this.$svg);

// Allow the SVG dimensions to be computed
// Quick fix for SVG manipulation issues.
setTimeout(() => this.enableZoom(), 0);
Expand Down
6 changes: 5 additions & 1 deletion src/polyfills.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,11 @@ if (!Element.prototype.scrollIntoViewIfNeeded) {
hasScrolled = true;
}

if (!hasScrolled && parent.parentNode instanceof HTMLElement && parent.clientHeight === parent.scrollHeight) {
if (
!hasScrolled &&
parent.parentNode instanceof HTMLElement &&
parent.clientHeight === parent.scrollHeight
) {
this.scrollIntoViewIfNeeded.call(this, centerIfNeeded, parent.parentNode);
}
};
Expand Down
8 changes: 5 additions & 3 deletions src/utils/highlight.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@ export function highlightTerm(content: string, term: string) {

// Apply highlight to all odd elements
for (var i = 1, length = result.length; i < length; i += 2) {
result[i] = <span key={i} style={{ backgroundColor: '#ffff03' }}>
{result[i]}
</span>;
result[i] = (
<span key={i} style={{ backgroundColor: '#ffff03' }}>
{result[i]}
</span>
);
}

return result;
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4849,10 +4849,10 @@ postcss@^7.0.0, postcss@^7.0.1, postcss@^7.0.14, postcss@^7.0.2, postcss@^7.0.5,
source-map "^0.6.1"
supports-color "^6.1.0"

prettier@1.17.0:
version "1.17.0"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.17.0.tgz#53b303676eed22cc14a9f0cec09b477b3026c008"
integrity sha512-sXe5lSt2WQlCbydGETgfm1YBShgOX4HxQkFPvbxkcwgDvGDeqVau8h+12+lmSVlP3rHPz0oavfddSZg/q+Szjw==
prettier@1.19.1:
version "1.19.1"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.19.1.tgz#f7d7f5ff8a9cd872a7be4ca142095956a60797cb"
integrity sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew==

pretty-error@^2.0.2:
version "2.1.1"
Expand Down

0 comments on commit 783dcfe

Please sign in to comment.