From b78bff5de834d93e81d8af248cc35afbfe69208a Mon Sep 17 00:00:00 2001 From: Daryl Chan Date: Sun, 15 Mar 2020 18:46:13 +0800 Subject: [PATCH] chore(gatsby): Migrate eslint-config to TypeScript --- package.json | 1 + .../{eslint-config.js => eslint-config.ts} | 5 +++-- yarn.lock | 18 ++++++++++++++++++ 3 files changed, 22 insertions(+), 2 deletions(-) rename packages/gatsby/src/utils/{eslint-config.js => eslint-config.ts} (94%) diff --git a/package.json b/package.json index 4244639e2567d..2f43d4fa5e7bf 100644 --- a/package.json +++ b/package.json @@ -8,6 +8,7 @@ "@types/babel__code-frame": "^7.0.1", "@types/bluebird": "^3.5.29", "@types/cache-manager": "^2.10.2", + "@types/eslint": "^6.1.8", "@types/express": "^4.17.2", "@types/fs-extra": "^8.0.1", "@types/got": "^9.6.9", diff --git a/packages/gatsby/src/utils/eslint-config.js b/packages/gatsby/src/utils/eslint-config.ts similarity index 94% rename from packages/gatsby/src/utils/eslint-config.js rename to packages/gatsby/src/utils/eslint-config.ts index bd2bcb2f524f8..28d4058a24c10 100644 --- a/packages/gatsby/src/utils/eslint-config.js +++ b/packages/gatsby/src/utils/eslint-config.ts @@ -1,6 +1,7 @@ -import { printSchema } from "graphql" +import { printSchema, GraphQLSchema } from "graphql" +import { CLIEngine } from "eslint" -module.exports = schema => { +module.exports = (schema: GraphQLSchema): CLIEngine.Options => { return { useEslintrc: false, resolvePluginsRelativeTo: __dirname, diff --git a/yarn.lock b/yarn.lock index a80788153f571..10d9ff16ba792 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3865,6 +3865,19 @@ resolved "https://registry.yarnpkg.com/@types/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz#1ee30d79544ca84d68d4b3cdb0af4f205663dd2d" integrity sha512-OCutwjDZ4aFS6PB1UZ988C4YgwlBHJd6wCeQqaLdmadZ/7e+w79+hbMUFC1QXDNCmdyoRfAFdm0RypzwR+Qpag== +"@types/eslint@^6.1.8": + version "6.1.8" + resolved "https://registry.yarnpkg.com/@types/eslint/-/eslint-6.1.8.tgz#7e868f89bc1e520323d405940e49cb912ede5bba" + integrity sha512-CJBhm9pYdUS8cFVbXACWlLxZWFBTQMiM0eI6RYxng3u9oQ9gHdQ5PN89DHPrK4RISRzX62nRsteUlbBgEIdSug== + dependencies: + "@types/estree" "*" + "@types/json-schema" "*" + +"@types/estree@*": + version "0.0.42" + resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.42.tgz#8d0c1f480339efedb3e46070e22dd63e0430dd11" + integrity sha512-K1DPVvnBCPxzD+G51/cxVIoc2X8uUVl1zpJeE6iKcgHMj4+tbat5Xu4TjV7v2QSDbIeAfLi2hIk+u2+s0MlpUQ== + "@types/estree@0.0.39": version "0.0.39" resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.39.tgz#e177e699ee1b8c22d23174caaa7422644389509f" @@ -3962,6 +3975,11 @@ resolved "https://registry.yarnpkg.com/@types/joi/-/joi-14.3.4.tgz#eed1e14cbb07716079c814138831a520a725a1e0" integrity sha512-1TQNDJvIKlgYXGNIABfgFp9y0FziDpuGrd799Q5RcnsDu+krD+eeW/0Fs5PHARvWWFelOhIG2OPCo6KbadBM4A== +"@types/json-schema@*": + version "7.0.4" + resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.4.tgz#38fd73ddfd9b55abb1e1b2ed578cb55bd7b7d339" + integrity sha512-8+KAKzEvSUdeo+kmqnKrqgeE+LcA0tjYWFY7RPProVYwnqDjukzO+3b6dLD56rYX5TdWejnEOLJYOIeh4CXKuA== + "@types/json-schema@^7.0.3": version "7.0.3" resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.3.tgz#bdfd69d61e464dcc81b25159c270d75a73c1a636"