Skip to content

Commit

Permalink
run prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
blivesta committed Jun 24, 2019
1 parent 7e8ded0 commit 727b418
Show file tree
Hide file tree
Showing 10 changed files with 68 additions and 64 deletions.
12 changes: 8 additions & 4 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
{
"endOfLine": "lf",
"semi": false,
"singleQuote": false,
"printWidth": 120,
"tabWidth": 2,
"trailingComma": "es5"
"useTabs": false,
"semi": true,
"singleQuote": true,
"trailingComma": "all",
"bracketSpacing": true,
"arrowParens": "avoid",
"parser": "typescript"
}
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@
"scripts": {
"build": "gatsby build",
"develop": "gatsby develop",
"format": "prettier --write src/**/*.{js,jsx}",
"format": "prettier --write src/**/*.{ts,tsx,js,jsx}",
"start": "npm run develop",
"serve": "gatsby serve",
"test": "echo \"Write tests! -> https://gatsby.dev/unit-testing\"",
"lint": "eslint -c ./.eslintrc.js 'src/**/*.{ts,tsx}'"
"lint": "eslint -c ./.eslintrc.js 'src/**/*.{js,ts,tsx}'"
},
"repository": {
"type": "git",
Expand Down
6 changes: 3 additions & 3 deletions src/components/global-styles.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createGlobalStyle } from "styled-components"
import { createGlobalStyle } from 'styled-components';

const GlobalStyles = createGlobalStyle`
html {
Expand Down Expand Up @@ -623,6 +623,6 @@ const GlobalStyles = createGlobalStyle`
font-size: 100%;
}
}
`
`;

export default GlobalStyles
export default GlobalStyles;
16 changes: 8 additions & 8 deletions src/components/header.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { Link } from "gatsby"
import React from "react"
import styled from "styled-components"
import { Link } from 'gatsby';
import React from 'react';
import styled from 'styled-components';

const StyledHeader = styled.header`
background: #000;
margin-bottom: 1.45rem;
`
`;
interface HeaderProps {
siteTitle: string
siteTitle: string;
}

const Header = ({ siteTitle }: HeaderProps) => (
Expand All @@ -32,10 +32,10 @@ const Header = ({ siteTitle }: HeaderProps) => (
</h1>
</div>
</StyledHeader>
)
);

Header.defaultProps = {
siteTitle: ``,
}
};

export default Header
export default Header;
14 changes: 7 additions & 7 deletions src/components/image.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from "react"
import { useStaticQuery, graphql } from "gatsby"
import Img from "gatsby-image"
import React from 'react';
import { useStaticQuery, graphql } from 'gatsby';
import Img from 'gatsby-image';

/*
* This component is built using `gatsby-image` to automatically serve optimized
Expand All @@ -24,9 +24,9 @@ const Image = () => {
}
}
}
`)
`);

return <Img fluid={data.placeholderImage.childImageSharp.fluid} />
}
return <Img fluid={data.placeholderImage.childImageSharp.fluid} />;
};

export default Image
export default Image;
18 changes: 9 additions & 9 deletions src/components/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
* See: https://www.gatsbyjs.org/docs/use-static-query/
*/

import React from "react"
import { useStaticQuery, graphql } from "gatsby"
import GlobalStyles from "./global-styles"
import React from 'react';
import { useStaticQuery, graphql } from 'gatsby';
import GlobalStyles from './global-styles';

import Header from "./header"
import Header from './header';

interface LayoutProps {
children: any
children: any;
}

const Layout = ({ children }: LayoutProps) => {
Expand All @@ -24,7 +24,7 @@ const Layout = ({ children }: LayoutProps) => {
}
}
}
`)
`);

return (
<>
Expand All @@ -46,7 +46,7 @@ const Layout = ({ children }: LayoutProps) => {
</footer>
</div>
</>
)
}
);
};

export default Layout
export default Layout;
26 changes: 13 additions & 13 deletions src/components/seo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
* See: https://www.gatsbyjs.org/docs/use-static-query/
*/

import React from "react"
import Helmet from "react-helmet"
import { useStaticQuery, graphql } from "gatsby"
import React from 'react';
import Helmet from 'react-helmet';
import { useStaticQuery, graphql } from 'gatsby';

interface SEOProps {
description: string
title: string
lang: string
meta: any[]
description: string;
title: string;
lang: string;
meta: any[];
}

function SEO({ description, lang, meta, title }: SEOProps) {
Expand All @@ -28,10 +28,10 @@ function SEO({ description, lang, meta, title }: SEOProps) {
}
}
}
`
)
`,
);

const metaDescription = description || site.siteMetadata.description
const metaDescription = description || site.siteMetadata.description;

return (
<Helmet
Expand Down Expand Up @@ -75,13 +75,13 @@ function SEO({ description, lang, meta, title }: SEOProps) {
},
].concat(meta)}
/>
)
);
}

SEO.defaultProps = {
lang: `en`,
meta: [],
description: ``,
}
};

export default SEO
export default SEO;
10 changes: 5 additions & 5 deletions src/pages/404.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import React from "react"
import React from 'react';

import Layout from "../components/layout"
import SEO from "../components/seo"
import Layout from '../components/layout';
import SEO from '../components/seo';

const NotFoundPage = () => (
<Layout>
<SEO title="404: Not found" />
<h1>NOT FOUND</h1>
<p>You just hit a route that doesn&#39;t exist... the sadness.</p>
</Layout>
)
);

export default NotFoundPage
export default NotFoundPage;
14 changes: 7 additions & 7 deletions src/pages/index.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React from "react"
import { Link } from "gatsby"
import React from 'react';
import { Link } from 'gatsby';

import Layout from "../components/layout"
import Image from "../components/image"
import SEO from "../components/seo"
import Layout from '../components/layout';
import Image from '../components/image';
import SEO from '../components/seo';

const IndexPage = () => (
<Layout>
Expand All @@ -16,6 +16,6 @@ const IndexPage = () => (
</div>
<Link to="/page-2/">Go to page 2</Link>
</Layout>
)
);

export default IndexPage
export default IndexPage;
12 changes: 6 additions & 6 deletions src/pages/page-2.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React from "react"
import { Link } from "gatsby"
import React from 'react';
import { Link } from 'gatsby';

import Layout from "../components/layout"
import SEO from "../components/seo"
import Layout from '../components/layout';
import SEO from '../components/seo';

const SecondPage = () => (
<Layout>
Expand All @@ -11,6 +11,6 @@ const SecondPage = () => (
<p>Welcome to page 2</p>
<Link to="/">Go back to the homepage</Link>
</Layout>
)
);

export default SecondPage
export default SecondPage;

0 comments on commit 727b418

Please sign in to comment.