From 97e3209564b3da717907b0de3aec17a219da2e81 Mon Sep 17 00:00:00 2001 From: Collin Miller Date: Wed, 29 Apr 2020 12:51:04 -0500 Subject: [PATCH] no implicit any --- index.ts | 6 +++--- package-lock.json | 6 ++++++ package.json | 3 ++- tsconfig.json | 2 ++ 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/index.ts b/index.ts index 44bed24..b8d256a 100644 --- a/index.ts +++ b/index.ts @@ -1,17 +1,17 @@ import { parser } from "./parser"; import moment from "moment"; -type Time = { +interface Time { hour: number, minute: number } -type TimeRange = { +interface TimeRange { start: Time, end: Time } -type MomentRange = { +interface MomentRange { start: moment.Moment, end: moment.Moment } diff --git a/package-lock.json b/package-lock.json index 685c48f..a59c775 100644 --- a/package-lock.json +++ b/package-lock.json @@ -31,6 +31,12 @@ "integrity": "sha512-x26ur3dSXgv5AwKS0lNfbjpCakGIduWU1DU91Zz58ONRWrIKGunmZBNv4P7N+e27sJkiGDsw/3fT4AtsqQBrBA==", "dev": true }, + "@types/pegjs": { + "version": "0.10.1", + "resolved": "https://registry.npmjs.org/@types/pegjs/-/pegjs-0.10.1.tgz", + "integrity": "sha512-ra8IchO9odGQmYKbm+94K58UyKCEKdZh9y0vxhG4pIpOJOBlC1C+ZtBVr6jLs+/oJ4pl+1p/4t3JtBA8J10Vvw==", + "dev": true + }, "abbrev": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", diff --git a/package.json b/package.json index bd33e76..a026af1 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "main": "./index.ts", "scripts": { "test": "npm run build && node test.js", - "test:watch": "nodemon --watch index.ts --watch parser.ts --watch time-ranges.pegjs --exec \"npm run test\"", + "test:watch": "nodemon --watch tsconfig.json --watch index.ts --watch parser.ts --watch time-ranges.pegjs --exec \"npm run test\"", "check": "tsc --project tsconfig.json --watch", "build": "tsc --project tsconfig.json" }, @@ -14,6 +14,7 @@ "license": "ISC", "devDependencies": { "@types/node": "^13.13.4", + "@types/pegjs": "^0.10.1", "nodemon": "^2.0.3", "typescript": "^3.8.3" }, diff --git a/tsconfig.json b/tsconfig.json index 19b7e71..270c968 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,6 +2,8 @@ "compilerOptions": { "allowSyntheticDefaultImports": true, "esModuleInterop": true, + "noImplicitAny": true, + "noImplicitReturns": true }, "paths": [ "./index.ts"