style: auto-format with Prettier

This commit is contained in:
Jean-Philippe Sirois
2019-07-29 03:23:42 -04:00
parent 7880032a7d
commit 2f904614a6
+12 -12
View File
@@ -1,8 +1,8 @@
const { graphql } = require('gatsby');
const { createFilePath } = require("gatsby-source-filesystem");
const { graphql } = require("gatsby")
const { createFilePath } = require("gatsby-source-filesystem")
const path = require(`path`)
const usersEndpoint = (id) => `https://discordapp.com/api/guilds/${id}/members`;
const usersEndpoint = id => `https://discordapp.com/api/guilds/${id}/members`
const fetchUsers = () => {
// Fetch user data from discord using bot token here
@@ -13,7 +13,7 @@ const createDocs = async ({ createPage, graphql }) => {
const result = await graphql(`
{
allFile(filter: {sourceInstanceName: {eq: "docs"}}) {
allFile(filter: { sourceInstanceName: { eq: "docs" } }) {
edges {
node {
relativePath
@@ -27,7 +27,7 @@ const createDocs = async ({ createPage, graphql }) => {
}
}
}
`);
`)
if (result.errors) {
return Promise.reject(result.errors)
@@ -35,28 +35,28 @@ const createDocs = async ({ createPage, graphql }) => {
return result.data.allFile.edges.forEach(({ node }) => {
createPage({
path: path.join('docs', node.relativePath),
path: path.join("docs", node.relativePath),
component: languageDocs,
context: {
file: node.relativePath
file: node.relativePath,
},
})
})
}
exports.onCreateNode = async ({ node, getNode, actions }) => {
const { createPage, createNodeField } = actions;
const { createPage, createNodeField } = actions
if (node.internal.type === "MarkdownRemark") {
const slug = createFilePath({ node, getNode, basePath: "src/content/docs" })
createNodeField({
node,
name: "slug",
value: slug
});
value: slug,
})
}
}
exports.createPages = ({ actions, graphql }) => {
const { createPage } = actions
return createDocs({ createPage, graphql });
}
return createDocs({ createPage, graphql })
}