Run tsc on build to check for typescript errors (#69)

* Run tsc on build to check for typescript errors

* Fix typescript errors.  Rename failing stories.

* Make prettier happy

* Use only tsconfig for tsc.
This commit is contained in:
Stan Silvert 2020-09-08 01:56:44 -04:00 committed by GitHub
parent 0eea5b8057
commit ca7c014e55
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 7 additions and 2 deletions

View file

@ -28,6 +28,7 @@ jobs:
- run: npm install -g yarn
- run: yarn install
- run: yarn format:check
- run: yarn check-types
- run: yarn build
- run: yarn lint
- run: yarn test

View file

@ -8,6 +8,7 @@
"start": "snowpack dev",
"build": "snowpack build",
"test": "jest",
"check-types": "tsc -p ./",
"format": "prettier --write \"src/**/*.{js,jsx,ts,tsx}\"",
"format:check": "prettier --check \"src/**/*.{js,jsx,ts,tsx}\"",
"lint": "eslint ./src/**/*.ts*",

View file

@ -4,6 +4,9 @@ import { mount } from "enzyme";
import EnzymeToJson from "enzyme-to-json";
import { act } from "react-dom/test-utils";
import { AlertPanel } from "../alert/AlertPanel";
import { useAlerts } from "../alert/Alerts";
import { RealmSelector } from "./RealmSelector";
const WithButton = () => {

View file

@ -28,7 +28,7 @@ export const RealmSelector = () => {
useEffect(() => {
getRealms().then((result) => {
setRealms(result) !== undefined ? result : [];
setRealms(result || []);
});
}, []);

View file

@ -23,7 +23,7 @@
/* Strict Type-Checking Options */
"strict": true, /* Enable all strict type-checking options. */
"noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */
// "strictNullChecks": true, /* Enable strict null checks. */
"strictNullChecks": true, /* Enable strict null checks. */
// "strictFunctionTypes": true, /* Enable strict checking of function types. */
// "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */
// "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */