Skip to content

Commit 109dc9c

Browse files
Prettified everything!
1 parent 6742075 commit 109dc9c

35 files changed

+335
-333
lines changed

.prettierignore

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
package.json
2+
package-lock.json
3+
**/node_modules/**
4+
**/.yoga/**
5+
**/dist/**

oss

Submodule oss updated 58 files

packages/gatsby-theme/images.d.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
declare module '*.png'
2-
declare module '*.jpg'
3-
declare module '*.jpeg'
4-
declare module '*.gif'
1+
declare module '*.png';
2+
declare module '*.jpg';
3+
declare module '*.jpeg';
4+
declare module '*.gif';

packages/gatsby-theme/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
// no-op
2-
export * from './src/components/shared/base';
2+
export * from './src/components/shared/base';

packages/gatsby-theme/src/assets/icons/GraphQLConf.tsx

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import * as React from 'react'
1+
import * as React from 'react';
22

3-
export default () =>
3+
export default () => (
44
<svg
55
width="18"
66
height="22"
@@ -29,3 +29,4 @@ export default () =>
2929
</linearGradient>
3030
</defs>
3131
</svg>
32+
);

packages/gatsby-theme/src/assets/icons/LinkArrow.tsx

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import * as React from 'react'
1+
import * as React from 'react';
22

3-
export default () =>
3+
export default () => (
44
<svg
55
width="10"
66
height="10"
@@ -14,3 +14,4 @@ export default () =>
1414
fill="#000"
1515
/>
1616
</svg>
17+
);

packages/gatsby-theme/src/components/Chapter.tsx

+2-5
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,9 @@ type Tutorial = {
1717
type FrontMatter = {
1818
pageTitle: string | null;
1919
description: string | null;
20-
}
20+
};
2121

22-
const Chapter: React.FunctionComponent<ChapterProps> = ({
23-
num, tutorial
24-
}) => {
22+
const Chapter: React.FunctionComponent<ChapterProps> = ({ num, tutorial }) => {
2523
return (
2624
<Card width={[1]} p={4} my={4} borderRadius={8} boxShadow="small">
2725
<Flex alignItems="center">
@@ -31,7 +29,6 @@ const Chapter: React.FunctionComponent<ChapterProps> = ({
3129
<Heading as="h2">{tutorial.frontmatter.pageTitle}</Heading>
3230
</Link>
3331
<Text>{tutorial.frontmatter.description}</Text>
34-
3532
</div>
3633
</Flex>
3734
</Card>

packages/gatsby-theme/src/components/Loader.tsx

+4-4
Original file line numberDiff line numberDiff line change
@@ -169,10 +169,10 @@ export const CenteredLoader: React.SFC<{ height?: string }> = ({ height }) => {
169169
return (
170170
<div
171171
style={{
172-
minHeight: `${height ? height : "100%"}`,
173-
display: "flex",
174-
alignItems: "center",
175-
justifyContent: "center"
172+
minHeight: `${height ? height : '100%'}`,
173+
display: 'flex',
174+
alignItems: 'center',
175+
justifyContent: 'center',
176176
}}
177177
>
178178
<Loader />
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
declare module 'gatsby-mdx';
2-
declare module 'prismjs/components/prism-core';
2+
declare module 'prismjs/components/prism-core';

packages/gatsby-theme/src/components/listing.tsx

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import { Link } from "gatsby";
2-
import * as React from "react";
3-
import { styled } from "../styles";
4-
import { useAllTutorialQuery } from "../hooks/useAllTutorialQuery";
5-
import { getTutorialSlug } from "../utils/getTutorialSlug";
1+
import { Link } from 'gatsby';
2+
import * as React from 'react';
3+
import { styled } from '../styles';
4+
import { useAllTutorialQuery } from '../hooks/useAllTutorialQuery';
5+
import { getTutorialSlug } from '../utils/getTutorialSlug';
66

77
const Post = styled.article`
88
box-shadow: 0 0.3rem 1rem rgba(25, 17, 34, 0.05);

packages/gatsby-theme/src/components/shared/base.d.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
99
// TypeScript Version: 2.9
1010

11-
import * as React from "react";
12-
import * as StyledComponents from "styled-components";
13-
import * as StyledSystem from "styled-system";
11+
import * as React from 'react';
12+
import * as StyledComponents from 'styled-components';
13+
import * as StyledSystem from 'styled-system';
1414

1515
export {};
1616

packages/gatsby-theme/src/components/shared/styledHelpers.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { styled } from "../../styles";
1+
import { styled } from '../../styles';
22

33
export const Content = styled.div`
44
max-width: ${p => p.theme.middleContainerWidth}px;

packages/gatsby-theme/src/components/templates/Tutorial.tsx

+7-4
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,13 @@ const TutorialLayout: React.FunctionComponent<TutorialLayoutProps> = ({
1919
return null;
2020
}
2121
const { pageTitle } = data!.mdx!.frontmatter!;
22-
const tutorialTitle = optionalChaining(() => data!.tutorialTitle!.frontmatter!.tutorialTitle!);
23-
const chapters = optionalChaining(() => data!.pageTitles!.edges!.map(
24-
a => a.node!.frontmatter!.pageTitle!,
25-
)) || [];
22+
const tutorialTitle = optionalChaining(
23+
() => data!.tutorialTitle!.frontmatter!.tutorialTitle!,
24+
);
25+
const chapters =
26+
optionalChaining(() =>
27+
data!.pageTitles!.edges!.map(a => a.node!.frontmatter!.pageTitle!),
28+
) || [];
2629
const { location } = props;
2730

2831
return (

packages/gatsby-theme/src/hooks/useLayoutQuery.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { graphql, useStaticQuery } from "gatsby";
1+
import { graphql, useStaticQuery } from 'gatsby';
22

3-
import { LayoutInformationQuery } from "src/graphqlTypes";
3+
import { LayoutInformationQuery } from 'src/graphqlTypes';
44

55
export const useLayoutQuery = () => {
66
const { site }: LayoutInformationQuery = useStaticQuery(graphql`

packages/gatsby-theme/src/index.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
declare module 'gatsby-mdx/mdx-renderer';
1+
declare module 'gatsby-mdx/mdx-renderer';

packages/gatsby-theme/src/pages/callback.tsx

+8-8
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,25 @@ import * as React from 'react';
22

33
function getParameterByName(name: string, url: string) {
44
if (!url) url = window.location.href;
5-
name = name.replace(/[\[\]]/g, "\\$&");
6-
var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"),
5+
name = name.replace(/[\[\]]/g, '\\$&');
6+
var regex = new RegExp('[?&]' + name + '(=([^&#]*)|&|#|$)'),
77
results = regex.exec(url);
88
if (!results) return null;
9-
if (!results[2]) return "";
10-
return decodeURIComponent(results[2].replace(/\+/g, " "));
9+
if (!results[2]) return '';
10+
return decodeURIComponent(results[2].replace(/\+/g, ' '));
1111
}
1212

1313
function Callback() {
14-
let githubCode = getParameterByName("code", window.location.href);
14+
let githubCode = getParameterByName('code', window.location.href);
1515
let targetWindow = window.opener;
16-
targetWindow.postMessage(githubCode, "*");
16+
targetWindow.postMessage(githubCode, '*');
1717
}
1818

1919
export default class AuthCallback extends React.Component {
2020
componentDidMount() {
21-
Callback()
21+
Callback();
2222
}
2323
render() {
24-
return null
24+
return null;
2525
}
2626
}

packages/gatsby-theme/src/styles/global.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { createGlobalStyle } from "./styled";
1+
import { createGlobalStyle } from './styled';
22

3-
import normalize from "./normalize";
3+
import normalize from './normalize';
44

55
export const GlobalStyles = createGlobalStyle`
66
${normalize}

packages/gatsby-theme/src/styles/mobile.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { css } from ".";
1+
import { css } from '.';
22

33
export const mobile = (inner: any) => css`
44
@media (max-width: ${p => p.theme.breakpoints[1]}) {

packages/gatsby-theme/src/styles/normalize.ts

+18-18
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { css } from "styled-components";
2-
import { theme } from "./theme";
1+
import { css } from 'styled-components';
2+
import { theme } from './theme';
33

44
export default css`
55
/*! modern-normalize | MIT License | https://github.com/sindresorhus/modern-normalize */
@@ -54,9 +54,9 @@ export default css`
5454
*/
5555
5656
body {
57-
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
58-
Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji",
59-
"Segoe UI Symbol";
57+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
58+
Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji',
59+
'Segoe UI Symbol';
6060
}
6161
6262
/**
@@ -177,9 +177,9 @@ export default css`
177177
*/
178178
179179
button,
180-
[type="button"],
181-
[type="reset"],
182-
[type="submit"] {
180+
[type='button'],
181+
[type='reset'],
182+
[type='submit'] {
183183
-webkit-appearance: button;
184184
}
185185
@@ -188,9 +188,9 @@ export default css`
188188
*/
189189
190190
button::-moz-focus-inner,
191-
[type="button"]::-moz-focus-inner,
192-
[type="reset"]::-moz-focus-inner,
193-
[type="submit"]::-moz-focus-inner {
191+
[type='button']::-moz-focus-inner,
192+
[type='reset']::-moz-focus-inner,
193+
[type='submit']::-moz-focus-inner {
194194
border-style: none;
195195
padding: 0;
196196
}
@@ -200,9 +200,9 @@ export default css`
200200
*/
201201
202202
button:-moz-focusring,
203-
[type="button"]:-moz-focusring,
204-
[type="reset"]:-moz-focusring,
205-
[type="submit"]:-moz-focusring {
203+
[type='button']:-moz-focusring,
204+
[type='reset']:-moz-focusring,
205+
[type='submit']:-moz-focusring {
206206
outline: 1px dotted ButtonText;
207207
}
208208
@@ -235,8 +235,8 @@ export default css`
235235
* Correct the cursor style of increment and decrement buttons in Chrome.
236236
*/
237237
238-
[type="number"]::-webkit-inner-spin-button,
239-
[type="number"]::-webkit-outer-spin-button {
238+
[type='number']::-webkit-inner-spin-button,
239+
[type='number']::-webkit-outer-spin-button {
240240
height: auto;
241241
}
242242
@@ -245,7 +245,7 @@ export default css`
245245
* 2. Correct the outline style in Safari.
246246
*/
247247
248-
[type="search"] {
248+
[type='search'] {
249249
-webkit-appearance: textfield; /* 1 */
250250
outline-offset: -2px; /* 2 */
251251
}
@@ -254,7 +254,7 @@ export default css`
254254
* Remove the inner padding in Chrome and Safari on macOS.
255255
*/
256256
257-
[type="search"]::-webkit-search-decoration {
257+
[type='search']::-webkit-search-decoration {
258258
-webkit-appearance: none;
259259
}
260260
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { Colors, Sizes, ZIndex, Shadows } from "./index";
1+
import { Colors, Sizes, ZIndex, Shadows } from './index';
22

33
export interface ThemeInterface extends Sizes, ZIndex {
4-
mode: "light" | "dark";
4+
mode: 'light' | 'dark';
55
colors: Colors;
66
shadows: Shadows;
77
}

0 commit comments

Comments
 (0)