Skip to content

Commit 4ec95d7

Browse files
committed
Fix TS errors and add type check to CI
1 parent b551830 commit 4ec95d7

File tree

4 files changed

+9
-3
lines changed

4 files changed

+9
-3
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ jobs:
2222
- name: Install Dependencies
2323
run: npm ci
2424

25+
- name: Check Types
26+
run: npm run check
27+
2528
- name: Lint Prettier
2629
run: npm run prettier:check
2730

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
"node": ">= 8.x"
99
},
1010
"scripts": {
11-
"test": "npm run prettier:check",
11+
"test": "npm run check && npm run prettier:check",
12+
"check": "tsc --noEmit",
1213
"start": "nodemon src/index.ts",
1314
"debug": "ts-node --inspect --compilerOptions '{\"inlineSources\":true}' src/index.ts",
1415
"start:editor": "webpack-dev-server --config webpack.config.js",

src/fake.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,12 +184,14 @@ const fakeFunctions = {
184184

185185
// System section
186186
// Skipped: faker.system.fileName
187-
// TODO: Add ext and type
187+
// TODO: Add ext
188+
// @ts-expect-error Remove once fix is merged https://github.com/DefinitelyTyped/DefinitelyTyped/pull/52229
188189
filename: () => faker.system.commonFileName(),
189190
mimeType: () => faker.system.mimeType(),
190191
// Skipped: faker.system.fileType
191192
// Skipped: faker.system.commonFileType
192193
// Skipped: faker.system.commonFileExt
194+
// @ts-expect-error Remove once fix is merged https://github.com/DefinitelyTyped/DefinitelyTyped/pull/52229
193195
fileExtension: () => faker.system.fileExt(),
194196
semver: () => faker.system.semver(),
195197
};

src/fake_schema.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ export const fakeFieldResolver: GraphQLFieldResolver<unknown, unknown> = async (
143143
return args && (() => getRandomItem(args.values));
144144
}
145145

146-
function getListLength(object): ListLengthArgs {
146+
function getListLength(object) {
147147
const listLength = schema.getDirective('listLength');
148148
const args = getDirectiveArgs(listLength, object) as ListLengthArgs;
149149
return args ? getRandomInt(args.min, args.max) : getRandomInt(2, 4);

0 commit comments

Comments
 (0)