Browse Source

Updated Prettier tasks to cover gatsby-* JS files in root

main
Brian Vaughn 7 years ago
parent
commit
f11badf8a6
  1. 7
      gatsby-node.js
  2. 4
      package.json

7
gatsby-node.js

@ -116,9 +116,10 @@ exports.createPages = async ({graphql, boundActionCreators}) => {
redirect.forEach(fromPath => { redirect.forEach(fromPath => {
if (redirectToSlugMap[fromPath] != null) { if (redirectToSlugMap[fromPath] != null) {
console.error(`Duplicate redirect detected from "${fromPath}" to:\n` + console.error(
`Duplicate redirect detected from "${fromPath}" to:\n` +
`* ${redirectToSlugMap[fromPath]}\n` + `* ${redirectToSlugMap[fromPath]}\n` +
`* ${slug}\n` `* ${slug}\n`,
); );
process.exit(1); process.exit(1);
} }
@ -138,7 +139,7 @@ exports.createPages = async ({graphql, boundActionCreators}) => {
` `
{ {
allMarkdownRemark( allMarkdownRemark(
limit: 1, limit: 1
filter: {id: {regex: "/blog/"}} filter: {id: {regex: "/blog/"}}
sort: {fields: [fields___date], order: DESC} sort: {fields: [fields___date], order: DESC}
) { ) {

4
package.json

@ -77,8 +77,8 @@
"dev": "gatsby develop -H 0.0.0.0", "dev": "gatsby develop -H 0.0.0.0",
"lint": "eslint .", "lint": "eslint .",
"netlify": "yarn install && yarn build", "netlify": "yarn install && yarn build",
"prettier": "prettier --config .prettierrc --write \"{flow-typed,plugins,src}/**/*.js\"", "prettier": "prettier --config .prettierrc --write \"{gatsby-*.js,{flow-typed,plugins,src}/**/*.js}\"",
"prettier:diff": "prettier --config .prettierrc --list-different \"{flow-typed,plugins,src}/**/*.js\"", "prettier:diff": "prettier --config .prettierrc --list-different \"{gatsby-*.js,{flow-typed,plugins,src}/**/*.js}\"",
"reset": "rimraf ./.cache" "reset": "rimraf ./.cache"
}, },
"devDependencies": { "devDependencies": {

Loading…
Cancel
Save