From f0fcdb09495d02a5ce7a2a7b7d4bc2e5d70d6032 Mon Sep 17 00:00:00 2001 From: Rene Saarsoo Date: Mon, 21 Sep 2020 15:46:22 +0300 Subject: [PATCH] Integrate auto-fixing of ESLint errors to before-commit hook --- package.json | 3 ++- src/stats/tss.ts | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index cd7e774..7850c94 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,8 @@ }, "lint-staged": { "src/**/*.ts": [ - "prettier --write --" + "prettier --write --", + "eslint --fix" ] }, "husky": { diff --git a/src/stats/tss.ts b/src/stats/tss.ts index 028fc98..97659bb 100644 --- a/src/stats/tss.ts +++ b/src/stats/tss.ts @@ -16,7 +16,7 @@ const rangeTss = (duration: number, from: number, to: number): number => { let score = 0; const step = 1; for (let i = 0; i < duration; i += step) { - let intensity = from + (to - from) * (i / duration); + const intensity = from + (to - from) * (i / duration); score += steadyTss(step, intensity); } return score;