From 83c29d942b03483b143c34b17c1dce4ed8e8416b Mon Sep 17 00:00:00 2001 From: Jack Franklin Date: Tue, 9 Jun 2020 12:10:19 +0100 Subject: [PATCH] chore: clean `lib` when running tsc (#5982) I've had misleading type errors due to left over builds or tests behaving oddly. We should just strip the entire folder out before building again so there's no left over artefacts that could cause issues. The `|| true` in the command is so if `rm` errors because the folder doesn't exist, it doesn't exit with an error code. --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 5fbe2793c41..439c4d6fc86 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,8 @@ "eslint-fix": "eslint --ext js --ext ts --fix .", "lint": "npm run eslint && npm run tsc && npm run doc", "doc": "node utils/doclint/cli.js", - "tsc": "tsc --version && tsc -p . && cp src/protocol.d.ts lib/", + "clean-lib": "rm -rf lib", + "tsc": "npm run clean-lib && tsc --version && tsc -p . && cp src/protocol.d.ts lib/", "apply-next-version": "node utils/apply_next_version.js", "update-protocol-d-ts": "node utils/protocol-types-generator update", "compare-protocol-d-ts": "node utils/protocol-types-generator compare",