Skip to content

Commit 783dcfe

Browse files
matystlIvanGoncharov
authored andcommitted
Update of prettier and running it over sources (#143)
1 parent 3c1c382 commit 783dcfe

7 files changed

Lines changed: 29 additions & 26 deletions

File tree

demo/index.tsx

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,16 @@ export default class Demo extends React.Component {
2424

2525
const { url, withCredentials } = getQueryParams();
2626
if (url) {
27-
this.state.introspection = introspectionQuery => fetch(url, {
28-
method: 'post',
29-
headers: {
30-
'Accept': 'application/json',
31-
'Content-Type': 'application/json',
32-
},
33-
body: JSON.stringify({ query: introspectionQuery }),
34-
...(
35-
withCredentials === 'true'
36-
? { credentials: 'include', mode: 'cors' }
37-
: {}
38-
),
39-
}).then(response => response.json());
27+
this.state.introspection = introspectionQuery =>
28+
fetch(url, {
29+
method: 'post',
30+
headers: {
31+
Accept: 'application/json',
32+
'Content-Type': 'application/json',
33+
},
34+
body: JSON.stringify({ query: introspectionQuery }),
35+
...(withCredentials === 'true' ? { credentials: 'include', mode: 'cors' } : {}),
36+
}).then(response => response.json());
4037
}
4138
}
4239

@@ -54,7 +51,7 @@ export default class Demo extends React.Component {
5451
<Logo />
5552
<Button
5653
color="primary"
57-
style={{color: 'white'}}
54+
style={{ color: 'white' }}
5855
variant="contained"
5956
className="choosebutton"
6057
onClick={openChangeSchema}
@@ -67,7 +64,7 @@ export default class Demo extends React.Component {
6764
<IntrospectionModal
6865
open={changeSchemaModalOpen}
6966
onClose={closeChangeSchema}
70-
onChange={(introspection) => this.setState({ introspection })}
67+
onChange={introspection => this.setState({ introspection })}
7168
/>
7269
</MuiThemeProvider>
7370
);

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
"postcss-import": "12.0.1",
4949
"postcss-loader": "3.0.0",
5050
"postcss-variables-loader": "5.0.1",
51-
"prettier": "1.17.0",
51+
"prettier": "1.19.1",
5252
"raw-loader": "1.0.0",
5353
"react": "16.8.6",
5454
"react-clipboard.js": "2.0.7",

src/components/doc-explorer/TypeList.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export default class TypeList extends React.Component<TypeListProps> {
4343

4444
return (
4545
<div key={type.id} className={classNames('typelist-item', className)}>
46-
<TypeLink type={type} onClick={onTypeLink} filter={filter}/>
46+
<TypeLink type={type} onClick={onTypeLink} filter={filter} />
4747
<FocusTypeButton onClick={() => onFocusType(type)} />
4848
<Description className="-doc-type" text={type.description} />
4949
</div>

src/graph/viewport.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export class Viewport {
2222
this.container.innerHTML = '';
2323
this.$svg = stringToSvg(svgString);
2424
this.container.appendChild(this.$svg);
25-
25+
2626
// Allow the SVG dimensions to be computed
2727
// Quick fix for SVG manipulation issues.
2828
setTimeout(() => this.enableZoom(), 0);

src/polyfills.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,11 @@ if (!Element.prototype.scrollIntoViewIfNeeded) {
4646
hasScrolled = true;
4747
}
4848

49-
if (!hasScrolled && parent.parentNode instanceof HTMLElement && parent.clientHeight === parent.scrollHeight) {
49+
if (
50+
!hasScrolled &&
51+
parent.parentNode instanceof HTMLElement &&
52+
parent.clientHeight === parent.scrollHeight
53+
) {
5054
this.scrollIntoViewIfNeeded.call(this, centerIfNeeded, parent.parentNode);
5155
}
5256
};

src/utils/highlight.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,11 @@ export function highlightTerm(content: string, term: string) {
1111

1212
// Apply highlight to all odd elements
1313
for (var i = 1, length = result.length; i < length; i += 2) {
14-
result[i] = <span key={i} style={{ backgroundColor: '#ffff03' }}>
15-
{result[i]}
16-
</span>;
14+
result[i] = (
15+
<span key={i} style={{ backgroundColor: '#ffff03' }}>
16+
{result[i]}
17+
</span>
18+
);
1719
}
1820

1921
return result;

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4849,10 +4849,10 @@ postcss@^7.0.0, postcss@^7.0.1, postcss@^7.0.14, postcss@^7.0.2, postcss@^7.0.5,
48494849
source-map "^0.6.1"
48504850
supports-color "^6.1.0"
48514851

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

48574857
pretty-error@^2.0.2:
48584858
version "2.1.1"

0 commit comments

Comments
 (0)