Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Prettier Pre-Commit Hooks #29

Merged
merged 2 commits into from
Jun 11, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package.json
package-lock.json
**/node_modules/**
**/.yoga/**
**/dist/**
2 changes: 1 addition & 1 deletion oss
Submodule oss updated 58 files
+2 −2 .gitignore
+0 −94 content/community/graphql-community-elixir/0-elixir-introduction.mdx
+0 −154 content/community/graphql-community-elixir/2-resolving-queries.mdx
+0 −10 content/community/graphql-community-elixir/overview.mdx
+3 −3 content/community/graphql-elixir/0-elixir-introduction.mdx
+2 −2 content/community/graphql-elixir/1-elixir-get-started.mdx
+5 −5 content/community/graphql-elixir/2-resolving-queries.mdx
+2 −3 content/community/graphql-elixir/overview.mdx
+0 −529 content/community/graphql-nexus/1-getting started.mdx
+0 −268 content/community/graphql-nexus/2-queries-loading-links.mdx
+0 −204 content/community/graphql-nexus/3-mutations-creating-links.mdx
+0 −529 content/community/twitter-graphql/1-getting started.mdx
+0 −268 content/community/twitter-graphql/2-queries-loading-links.mdx
+0 −204 content/community/twitter-graphql/3-mutations-creating-links.mdx
+0 −8 content/community/twitter-graphql/overview.mdx
+0 −87 content/courses/backend/graphql-elixir/1-elixir-get-started.mdx
+0 −10 content/courses/backend/graphql-elixir/overview.mdx
+0 −31 content/courses/backend/graphql-java/1-pagination.mdx
+0 −48 content/courses/backend/graphql-java/2-summary.mdx
+0 −10 content/courses/backend/graphql-java/overview.mdx
+0 −112 content/courses/backend/graphql-node/0-react-apollo-introduction.mdx
+0 −529 content/courses/backend/graphql-node/1-getting started.mdx
+0 −268 content/courses/backend/graphql-node/2-adding-a-database.mdx
+0 −204 content/courses/backend/graphql-node/3-connecting-server.mdx
+0 −27 content/courses/backend/graphql-node/6-more-mutations-and-updating-the-store.mdx
+0 −22 content/courses/backend/graphql-node/7-filtering-searching-the-list-of-links.mdx
+0 −36 content/courses/backend/graphql-node/8-subscriptions.mdx
+0 −10 content/courses/backend/graphql-node/overview.mdx
+0 −204 content/courses/backend/graphql-python/3-mutations-creating-links.mdx
+0 −155 content/courses/backend/graphql-python/4-routing.mdx
+0 −27 content/courses/backend/graphql-python/5-authentication.mdx
+0 −10 content/courses/backend/graphql-python/overview.mdx
+0 −112 content/courses/backend/graphql-ruby/0-react-apollo-introduction.mdx
+0 −529 content/courses/backend/graphql-ruby/1-getting started.mdx
+0 −268 content/courses/backend/graphql-ruby/2-queries-loading-links.mdx
+0 −10 content/courses/backend/graphql-ruby/overview.mdx
+0 −112 content/courses/frontend/expo-apollo/0-expo-apollo-introduction.mdx
+0 −268 content/courses/frontend/expo-apollo/2-expo-queries.mdx
+0 −204 content/courses/frontend/expo-apollo/3-expo-mutations.mdx
+0 −10 content/courses/frontend/expo-apollo/overview.mdx
+0 −529 content/courses/frontend/react-apollo/1-getting started.mdx
+5 −4 content/fundamentals/0-introduction.mdx
+4 −3 content/fundamentals/1-graphql-is-the-better-rest.mdx
+1 −0 content/fundamentals/2-core-concepts.mdx
+3 −2 content/fundamentals/3-big-picture.mdx
+0 −1 content/fundamentals/overview.mdx
+1 −1 content/guides/react-apollo/0-react-apollo-introduction.mdx
+3 −3 content/guides/react-apollo/1-getting started.mdx
+0 −0 content/guides/react-apollo/10-summary.mdx
+1 −1 content/guides/react-apollo/2-queries-loading-links.mdx
+1 −1 content/guides/react-apollo/3-mutations-creating-links.mdx
+0 −0 content/guides/react-apollo/4-routing.mdx
+0 −0 content/guides/react-apollo/5-authentication.mdx
+0 −0 content/guides/react-apollo/6-more-mutations-and-updating-the-store.mdx
+0 −0 content/guides/react-apollo/7-filtering-searching-the-list-of-links.mdx
+0 −0 content/guides/react-apollo/8-subscriptions.mdx
+0 −0 content/guides/react-apollo/9-pagination.mdx
+0 −1 content/guides/react-apollo/overview.mdx
11 changes: 9 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,14 @@
},
"devDependencies": {
"apollo": "^2.10.0",
"husky": "^2.4.1",
"now": "^15.3.0",
"npm-run-all": "^4.1.5"
"npm-run-all": "^4.1.5",
"pretty-quick": "^1.11.0"
},
"husky": {
"hooks": {
"pre-commit": "pretty-quick --staged"
}
}
}
}
8 changes: 4 additions & 4 deletions packages/gatsby-theme/images.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
declare module '*.png'
declare module '*.jpg'
declare module '*.jpeg'
declare module '*.gif'
declare module '*.png';
declare module '*.jpg';
declare module '*.jpeg';
declare module '*.gif';
2 changes: 1 addition & 1 deletion packages/gatsby-theme/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
// no-op
export * from './src/components/shared/base';
export * from './src/components/shared/base';
5 changes: 3 additions & 2 deletions packages/gatsby-theme/src/assets/icons/GraphQLConf.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react'
import * as React from 'react';

export default () =>
export default () => (
<svg
width="18"
height="22"
Expand Down Expand Up @@ -29,3 +29,4 @@ export default () =>
</linearGradient>
</defs>
</svg>
);
5 changes: 3 additions & 2 deletions packages/gatsby-theme/src/assets/icons/LinkArrow.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react'
import * as React from 'react';

export default () =>
export default () => (
<svg
width="10"
height="10"
Expand All @@ -14,3 +14,4 @@ export default () =>
fill="#000"
/>
</svg>
);
7 changes: 2 additions & 5 deletions packages/gatsby-theme/src/components/Chapter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,9 @@ type Tutorial = {
type FrontMatter = {
pageTitle: string | null;
description: string | null;
}
};

const Chapter: React.FunctionComponent<ChapterProps> = ({
num, tutorial
}) => {
const Chapter: React.FunctionComponent<ChapterProps> = ({ num, tutorial }) => {
return (
<Card width={[1]} p={4} my={4} borderRadius={8} boxShadow="small">
<Flex alignItems="center">
Expand All @@ -31,7 +29,6 @@ const Chapter: React.FunctionComponent<ChapterProps> = ({
<Heading as="h2">{tutorial.frontmatter.pageTitle}</Heading>
</Link>
<Text>{tutorial.frontmatter.description}</Text>

</div>
</Flex>
</Card>
Expand Down
8 changes: 4 additions & 4 deletions packages/gatsby-theme/src/components/Loader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,10 @@ export const CenteredLoader: React.SFC<{ height?: string }> = ({ height }) => {
return (
<div
style={{
minHeight: `${height ? height : "100%"}`,
display: "flex",
alignItems: "center",
justifyContent: "center"
minHeight: `${height ? height : '100%'}`,
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
}}
>
<Loader />
Expand Down
2 changes: 1 addition & 1 deletion packages/gatsby-theme/src/components/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
declare module 'gatsby-mdx';
declare module 'prismjs/components/prism-core';
declare module 'prismjs/components/prism-core';
10 changes: 5 additions & 5 deletions packages/gatsby-theme/src/components/listing.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Link } from "gatsby";
import * as React from "react";
import { styled } from "../styles";
import { useAllTutorialQuery } from "../hooks/useAllTutorialQuery";
import { getTutorialSlug } from "../utils/getTutorialSlug";
import { Link } from 'gatsby';
import * as React from 'react';
import { styled } from '../styles';
import { useAllTutorialQuery } from '../hooks/useAllTutorialQuery';
import { getTutorialSlug } from '../utils/getTutorialSlug';

const Post = styled.article`
box-shadow: 0 0.3rem 1rem rgba(25, 17, 34, 0.05);
Expand Down
6 changes: 3 additions & 3 deletions packages/gatsby-theme/src/components/shared/base.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.9

import * as React from "react";
import * as StyledComponents from "styled-components";
import * as StyledSystem from "styled-system";
import * as React from 'react';
import * as StyledComponents from 'styled-components';
import * as StyledSystem from 'styled-system';

export {};

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { styled } from "../../styles";
import { styled } from '../../styles';

export const Content = styled.div`
max-width: ${p => p.theme.middleContainerWidth}px;
Expand Down
11 changes: 7 additions & 4 deletions packages/gatsby-theme/src/components/templates/Tutorial.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,13 @@ const TutorialLayout: React.FunctionComponent<TutorialLayoutProps> = ({
return null;
}
const { pageTitle } = data!.mdx!.frontmatter!;
const tutorialTitle = optionalChaining(() => data!.tutorialTitle!.frontmatter!.tutorialTitle!);
const chapters = optionalChaining(() => data!.pageTitles!.edges!.map(
a => a.node!.frontmatter!.pageTitle!,
)) || [];
const tutorialTitle = optionalChaining(
() => data!.tutorialTitle!.frontmatter!.tutorialTitle!,
);
const chapters =
optionalChaining(() =>
data!.pageTitles!.edges!.map(a => a.node!.frontmatter!.pageTitle!),
) || [];
const { location } = props;

return (
Expand Down
4 changes: 2 additions & 2 deletions packages/gatsby-theme/src/hooks/useLayoutQuery.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { graphql, useStaticQuery } from "gatsby";
import { graphql, useStaticQuery } from 'gatsby';

import { LayoutInformationQuery } from "src/graphqlTypes";
import { LayoutInformationQuery } from 'src/graphqlTypes';

export const useLayoutQuery = () => {
const { site }: LayoutInformationQuery = useStaticQuery(graphql`
Expand Down
2 changes: 1 addition & 1 deletion packages/gatsby-theme/src/index.d.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
declare module 'gatsby-mdx/mdx-renderer';
declare module 'gatsby-mdx/mdx-renderer';
16 changes: 8 additions & 8 deletions packages/gatsby-theme/src/pages/callback.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,25 @@ import * as React from 'react';

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

function Callback() {
let githubCode = getParameterByName("code", window.location.href);
let githubCode = getParameterByName('code', window.location.href);
let targetWindow = window.opener;
targetWindow.postMessage(githubCode, "*");
targetWindow.postMessage(githubCode, '*');
}

export default class AuthCallback extends React.Component {
componentDidMount() {
Callback()
Callback();
}
render() {
return null
return null;
}
}
4 changes: 2 additions & 2 deletions packages/gatsby-theme/src/styles/global.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { createGlobalStyle } from "./styled";
import { createGlobalStyle } from './styled';

import normalize from "./normalize";
import normalize from './normalize';

export const GlobalStyles = createGlobalStyle`
${normalize}
Expand Down
2 changes: 1 addition & 1 deletion packages/gatsby-theme/src/styles/mobile.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { css } from ".";
import { css } from '.';

export const mobile = (inner: any) => css`
@media (max-width: ${p => p.theme.breakpoints[1]}) {
Expand Down
36 changes: 18 additions & 18 deletions packages/gatsby-theme/src/styles/normalize.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { css } from "styled-components";
import { theme } from "./theme";
import { css } from 'styled-components';
import { theme } from './theme';

export default css`
/*! modern-normalize | MIT License | https://github.com/sindresorhus/modern-normalize */
Expand Down Expand Up @@ -54,9 +54,9 @@ export default css`
*/

body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji",
"Segoe UI Symbol";
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji',
'Segoe UI Symbol';
}

/**
Expand Down Expand Up @@ -177,9 +177,9 @@ export default css`
*/

button,
[type="button"],
[type="reset"],
[type="submit"] {
[type='button'],
[type='reset'],
[type='submit'] {
-webkit-appearance: button;
}

Expand All @@ -188,9 +188,9 @@ export default css`
*/

button::-moz-focus-inner,
[type="button"]::-moz-focus-inner,
[type="reset"]::-moz-focus-inner,
[type="submit"]::-moz-focus-inner {
[type='button']::-moz-focus-inner,
[type='reset']::-moz-focus-inner,
[type='submit']::-moz-focus-inner {
border-style: none;
padding: 0;
}
Expand All @@ -200,9 +200,9 @@ export default css`
*/

button:-moz-focusring,
[type="button"]:-moz-focusring,
[type="reset"]:-moz-focusring,
[type="submit"]:-moz-focusring {
[type='button']:-moz-focusring,
[type='reset']:-moz-focusring,
[type='submit']:-moz-focusring {
outline: 1px dotted ButtonText;
}

Expand Down Expand Up @@ -235,8 +235,8 @@ export default css`
* Correct the cursor style of increment and decrement buttons in Chrome.
*/

[type="number"]::-webkit-inner-spin-button,
[type="number"]::-webkit-outer-spin-button {
[type='number']::-webkit-inner-spin-button,
[type='number']::-webkit-outer-spin-button {
height: auto;
}

Expand All @@ -245,7 +245,7 @@ export default css`
* 2. Correct the outline style in Safari.
*/

[type="search"] {
[type='search'] {
-webkit-appearance: textfield; /* 1 */
outline-offset: -2px; /* 2 */
}
Expand All @@ -254,7 +254,7 @@ export default css`
* Remove the inner padding in Chrome and Safari on macOS.
*/

[type="search"]::-webkit-search-decoration {
[type='search']::-webkit-search-decoration {
-webkit-appearance: none;
}

Expand Down
4 changes: 2 additions & 2 deletions packages/gatsby-theme/src/styles/theme/ThemeInterface.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Colors, Sizes, ZIndex, Shadows } from "./index";
import { Colors, Sizes, ZIndex, Shadows } from './index';

export interface ThemeInterface extends Sizes, ZIndex {
mode: "light" | "dark";
mode: 'light' | 'dark';
colors: Colors;
shadows: Shadows;
}
Loading