Skip to content

Commit

Permalink
Fix TS errors and add type check to CI
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanGoncharov committed Apr 7, 2021
1 parent b551830 commit 4ec95d7
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ jobs:
- name: Install Dependencies
run: npm ci

- name: Check Types
run: npm run check

- name: Lint Prettier
run: npm run prettier:check

Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"node": ">= 8.x"
},
"scripts": {
"test": "npm run prettier:check",
"test": "npm run check && npm run prettier:check",
"check": "tsc --noEmit",
"start": "nodemon src/index.ts",
"debug": "ts-node --inspect --compilerOptions '{\"inlineSources\":true}' src/index.ts",
"start:editor": "webpack-dev-server --config webpack.config.js",
Expand Down
4 changes: 3 additions & 1 deletion src/fake.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,12 +184,14 @@ const fakeFunctions = {

// System section
// Skipped: faker.system.fileName
// TODO: Add ext and type
// TODO: Add ext
// @ts-expect-error Remove once fix is merged https://github.com/DefinitelyTyped/DefinitelyTyped/pull/52229
filename: () => faker.system.commonFileName(),
mimeType: () => faker.system.mimeType(),
// Skipped: faker.system.fileType
// Skipped: faker.system.commonFileType
// Skipped: faker.system.commonFileExt
// @ts-expect-error Remove once fix is merged https://github.com/DefinitelyTyped/DefinitelyTyped/pull/52229
fileExtension: () => faker.system.fileExt(),
semver: () => faker.system.semver(),
};
Expand Down
2 changes: 1 addition & 1 deletion src/fake_schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ export const fakeFieldResolver: GraphQLFieldResolver<unknown, unknown> = async (
return args && (() => getRandomItem(args.values));
}

function getListLength(object): ListLengthArgs {
function getListLength(object) {
const listLength = schema.getDirective('listLength');
const args = getDirectiveArgs(listLength, object) as ListLengthArgs;
return args ? getRandomInt(args.min, args.max) : getRandomInt(2, 4);
Expand Down

0 comments on commit 4ec95d7

Please sign in to comment.