intial eslint pre-commit setup

This commit is contained in:
Rahul Jain
2021-10-31 12:51:09 +05:30
parent fb6389f569
commit 004401a8d1
63 changed files with 4355 additions and 3550 deletions
+9 -12
View File
@@ -1,14 +1,11 @@
exports.createPages = async ({ actions, graphql, reporter }) => {
const { createPage } = actions
const { createPage } = actions;
const blogPostTemplate = require.resolve(`./src/templates/blogTemplate.js`)
const blogPostTemplate = require.resolve(`./src/templates/blogTemplate.js`);
const result = await graphql(`
{
allMarkdownRemark(
sort: { order: DESC, fields: [frontmatter___date] }
limit: 1000
) {
allMarkdownRemark(sort: { order: DESC, fields: [frontmatter___date] }, limit: 1000) {
edges {
node {
frontmatter {
@@ -18,12 +15,12 @@ exports.createPages = async ({ actions, graphql, reporter }) => {
}
}
}
`)
`);
// Handle errors
if (result.errors) {
reporter.panicOnBuild(`Error while running GraphQL query.`)
return
reporter.panicOnBuild(`Error while running GraphQL query.`);
return;
}
result.data.allMarkdownRemark.edges.forEach(({ node }) => {
@@ -34,6 +31,6 @@ exports.createPages = async ({ actions, graphql, reporter }) => {
// additional data can be passed via context
slug: node.frontmatter.slug,
},
})
})
}
});
});
};