From 2f904614a6a0d6ed777bc9f7b10c933651595ded Mon Sep 17 00:00:00 2001 From: Jean-Philippe Sirois Date: Mon, 29 Jul 2019 03:23:42 -0400 Subject: [PATCH] style: auto-format with Prettier --- gatsby-node.js | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/gatsby-node.js b/gatsby-node.js index 723b1c5..0978f39 100644 --- a/gatsby-node.js +++ b/gatsby-node.js @@ -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 }); -} \ No newline at end of file + return createDocs({ createPage, graphql }) +}