fix(lint): manually lint
This commit is contained in:
parent
e05e22cc59
commit
8f5a8272a7
|
@ -1,2 +1,5 @@
|
||||||
|
# Gatsby
|
||||||
public/
|
public/
|
||||||
|
.cache
|
||||||
|
|
||||||
.vercel
|
.vercel
|
||||||
|
|
|
@ -19,7 +19,13 @@
|
||||||
"react"
|
"react"
|
||||||
],
|
],
|
||||||
"rules": {
|
"rules": {
|
||||||
"semi": [ "error", "never" ],
|
"semi": [
|
||||||
"quotes": [ "error", "double" ]
|
"error",
|
||||||
|
"never"
|
||||||
|
],
|
||||||
|
"quotes": [
|
||||||
|
"error",
|
||||||
|
"double"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import connectToDatabase from "./lib/dbConnect"
|
|
||||||
import fetch from "node-fetch"
|
import fetch from "node-fetch"
|
||||||
|
|
||||||
|
import connectToDatabase from "./lib/dbConnect"
|
||||||
|
|
||||||
export default async (req, res) => {
|
export default async (req, res) => {
|
||||||
const { method } = req
|
const { method } = req
|
||||||
const db = await connectToDatabase()
|
const db = await connectToDatabase()
|
||||||
|
|
|
@ -2,18 +2,6 @@ import { MongoClient } from "mongodb"
|
||||||
|
|
||||||
const { MONGODB_URI, MONGODB_DB, MONGODB_COLLECTION } = process.env
|
const { MONGODB_URI, MONGODB_DB, MONGODB_COLLECTION } = process.env
|
||||||
|
|
||||||
if (!MONGODB_URI) {
|
|
||||||
throw new Error(
|
|
||||||
"Please define the MONGODB_URI environment variable inside .env.local"
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!MONGODB_DB) {
|
|
||||||
throw new Error(
|
|
||||||
"Please define the MONGODB_DB environment variable inside .env.local"
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
let cached = global.mongo
|
let cached = global.mongo
|
||||||
|
|
||||||
if (!cached) {
|
if (!cached) {
|
||||||
|
@ -39,5 +27,6 @@ export default async function connectToDatabase() {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
cached.conn = await cached.promise
|
cached.conn = await cached.promise
|
||||||
|
|
||||||
return cached.conn
|
return cached.conn
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,6 +6,8 @@ module.exports = {
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
"gatsby-plugin-react-helmet",
|
"gatsby-plugin-react-helmet",
|
||||||
|
"gatsby-plugin-transition-link",
|
||||||
|
"gatsby-plugin-sass",
|
||||||
{
|
{
|
||||||
resolve: "gatsby-plugin-manifest",
|
resolve: "gatsby-plugin-manifest",
|
||||||
options: {
|
options: {
|
||||||
|
@ -17,8 +19,6 @@ module.exports = {
|
||||||
display: "minimal-ui",
|
display: "minimal-ui",
|
||||||
icon: "src/images/icon.png", // This path is relative to the root of the site.
|
icon: "src/images/icon.png", // This path is relative to the root of the site.
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
"gatsby-plugin-transition-link",
|
|
||||||
"gatsby-plugin-sass"
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,12 @@
|
||||||
"prCreation": "immediate",
|
"prCreation": "immediate",
|
||||||
"packageRules": [
|
"packageRules": [
|
||||||
{
|
{
|
||||||
"matchUpdateTypes": ["minor", "patch", "pin", "digest"],
|
"matchUpdateTypes": [
|
||||||
|
"minor",
|
||||||
|
"patch",
|
||||||
|
"pin",
|
||||||
|
"digest"
|
||||||
|
],
|
||||||
"automerge": true
|
"automerge": true
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
Loading…
Reference in New Issue