Skip to content

Commit f11badf

Browse files
committed
Updated Prettier tasks to cover gatsby-* JS files in root
1 parent ea98705 commit f11badf

File tree

2 files changed

+27
-26
lines changed

2 files changed

+27
-26
lines changed

gatsby-node.js

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -36,19 +36,19 @@ exports.createPages = async ({graphql, boundActionCreators}) => {
3636

3737
const allMarkdown = await graphql(
3838
`
39-
{
40-
allMarkdownRemark(limit: 1000) {
41-
edges {
42-
node {
43-
fields {
44-
redirect
45-
slug
39+
{
40+
allMarkdownRemark(limit: 1000) {
41+
edges {
42+
node {
43+
fields {
44+
redirect
45+
slug
46+
}
4647
}
4748
}
4849
}
4950
}
50-
}
51-
`,
51+
`,
5252
);
5353

5454
if (allMarkdown.errors) {
@@ -116,9 +116,10 @@ exports.createPages = async ({graphql, boundActionCreators}) => {
116116

117117
redirect.forEach(fromPath => {
118118
if (redirectToSlugMap[fromPath] != null) {
119-
console.error(`Duplicate redirect detected from "${fromPath}" to:\n` +
120-
`* ${redirectToSlugMap[fromPath]}\n` +
121-
`* ${slug}\n`
119+
console.error(
120+
`Duplicate redirect detected from "${fromPath}" to:\n` +
121+
`* ${redirectToSlugMap[fromPath]}\n` +
122+
`* ${slug}\n`,
122123
);
123124
process.exit(1);
124125
}
@@ -136,22 +137,22 @@ exports.createPages = async ({graphql, boundActionCreators}) => {
136137

137138
const newestBlogEntry = await graphql(
138139
`
139-
{
140-
allMarkdownRemark(
141-
limit: 1,
142-
filter: { id: { regex: "/blog/" } }
143-
sort: { fields: [fields___date], order: DESC }
144-
) {
145-
edges {
146-
node {
147-
fields {
148-
slug
140+
{
141+
allMarkdownRemark(
142+
limit: 1
143+
filter: {id: {regex: "/blog/"}}
144+
sort: {fields: [fields___date], order: DESC}
145+
) {
146+
edges {
147+
node {
148+
fields {
149+
slug
150+
}
149151
}
150152
}
151153
}
152154
}
153-
}
154-
`,
155+
`,
155156
);
156157
const newestBlogNode = newestBlogEntry.data.allMarkdownRemark.edges[0].node;
157158

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@
7777
"dev": "gatsby develop -H 0.0.0.0",
7878
"lint": "eslint .",
7979
"netlify": "yarn install && yarn build",
80-
"prettier": "prettier --config .prettierrc --write \"{flow-typed,plugins,src}/**/*.js\"",
81-
"prettier:diff": "prettier --config .prettierrc --list-different \"{flow-typed,plugins,src}/**/*.js\"",
80+
"prettier": "prettier --config .prettierrc --write \"{gatsby-*.js,{flow-typed,plugins,src}/**/*.js}\"",
81+
"prettier:diff": "prettier --config .prettierrc --list-different \"{gatsby-*.js,{flow-typed,plugins,src}/**/*.js}\"",
8282
"reset": "rimraf ./.cache"
8383
},
8484
"devDependencies": {

0 commit comments

Comments
 (0)