Skip to content

Commit 4907f8f

Browse files
committed
migrate to typescript
1 parent 07d342c commit 4907f8f

File tree

5 files changed

+4
-8
lines changed

5 files changed

+4
-8
lines changed

.eslintrc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
"root": true,
66
"env": {
77
"node": true,
8-
"es6": true,
9-
"typescript": true
8+
"es6": true
109
}
1110
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"test:only": "vitest run --config ./vitest.config.ts",
2727
"lint": "eslint src/** handler/**",
2828
"lint:fix": "eslint --fix src handler/**",
29-
"check": "flow check",
29+
"check": "tsc --noEmit",
3030
"build": "rimraf lib && tsc ",
3131
"download": "node scripts/download.js cache/data.json",
3232
"serve-public": "node scripts/serve-public",

src/api/local.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
*/
1010

1111
import { DataResult } from '../types.js';
12-
import { readFile } from 'fs/promises';
1312

1413

1514
/**
@@ -19,9 +18,9 @@ import { readFile } from 'fs/promises';
1918
export async function getFromLocalUrl(
2019
url: string,
2120
) {
21+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
2222
// @ts-ignore
2323
const swapiData = (await import('../../cache/data.json')).default
24-
// @ts-expect-error hey
2524
const text = swapiData[url] as DataResult;
2625
if (!text) {
2726
throw new Error(`No entry in local cache for ${url}`);

src/schema/connections.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ for example.`,
4545
},
4646
[prop]: {
4747
type: new GraphQLList(type),
48-
// @ts-expect-error messiness
4948
resolve: conn => conn.edges.map(edge => edge.node),
5049
description: `A list of all of the objects returned in the connection. This is a convenience
5150
field provided for quickly exploring the API; rather than querying for
@@ -59,7 +58,6 @@ full "{ edges { node } }" version should be used instead.`,
5958
return {
6059
type: connectionType,
6160
args: connectionArgs,
62-
// @ts-expect-error something
6361
resolve: async (obj, args) => {
6462
const array = await getObjectsFromUrls(obj[prop] || []);
6563
return {

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"target": "ESNext",
44
"moduleResolution": "NodeNext",
55
"module": "NodeNext",
6-
"strict": true,
6+
"strict": false,
77
"lib": ["ESNext"],
88
"outDir": "lib",
99
"resolveJsonModule": true,

0 commit comments

Comments
 (0)