Skip to content

Commit

Permalink
add type checking to ci, fix types
Browse files Browse the repository at this point in the history
- add a tsc --noEmit step to github actions as part of linting ci check
- fix (silence) few type errors
  • Loading branch information
cloverich committed Jan 20, 2024
1 parent 232ebb0 commit 944b968
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
push:
branches: [master]
jobs:
format:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -16,4 +16,5 @@ jobs:
with:
node-version: 20.x
- run: yarn install
- run: yarn run lint:check
- run: yarn run lint:check:prettier
- run: yarn run lint:check:types
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"main": "main.bundle.js",
"license": "UNLICENSED",
"scripts": {
"lint:check": "prettier . --check",
"lint:check:prettier": "prettier . --check",
"lint:check:types": "tsc --noEmit --skipLibCheck",
"start": "node ./scripts/dev.js",
"test": "mocha -r esm -r ts-node/register src/**/*.test.ts",
"test:one": "mocha -r ts-node/register -r esm"
Expand Down
3 changes: 2 additions & 1 deletion src/views/documents/search/TagSearchStore.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ function makeMock(): [TokensStore, TagSearchStore] {
tokens: observable([]) as IObservableArray<SearchToken>,
});

return [mockStore, new TagSearchStore(mockStore)];
// todo: as any quick hack to satisfy tsc
return [mockStore, new TagSearchStore(mockStore as any)];
}

// todo: technically... since TagSearchStore.searchTokens computes from
Expand Down
4 changes: 3 additions & 1 deletion src/views/preferences/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ import useClient from "../../hooks/useClient";
import { RouteProps } from "react-router-dom";

interface Props extends RouteProps {
setView?: React.Dispatch<React.SetStateAction<ViewState>>;
// TODO: any added to satisfy ts check step; previously
// this was ViewState which does not exist. Review and fix.
setView?: React.Dispatch<React.SetStateAction<any>>;
}

export default function Preferences(props: Props) {
Expand Down

0 comments on commit 944b968

Please sign in to comment.