Skip to content
This repository has been archived by the owner on Jan 5, 2024. It is now read-only.

Commit

Permalink
add explicit coercion where TypeScript 5 became more strict (#252)
Browse files Browse the repository at this point in the history
* add explicit coercion where TypeScript 5 became more strict

fixes #227

The fix is taken from
https://devblogs.microsoft.com/typescript/announcing-typescript-5-0-beta/#forbidden-implicit-coercions-in-relational-operators

* hlint-run: switch to typescript 5
  • Loading branch information
ulysses4ever authored May 15, 2023
1 parent 9c0664b commit 1a462ad
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion hlint-run/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@
"devDependencies": {
"@types/node": "^18.16.3",
"@vercel/ncc": "^0.36.1",
"typescript": "^4.9.5"
"typescript": "^5.0.4"
}
}
4 changes: 2 additions & 2 deletions hlint-run/src/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ async function runHLint(cmd: string, args: string[]): Promise<HLintResult> {
function getOverallCheckResult(failOn: CheckMode, {ideas, statusCode}: HLintResult): CheckResult {
const hintsBySev = HLINT_SEV_LEVELS.map(sev => ([sev, ideas.filter(hint => hint.severity === sev).length]));
const hintSummary = hintsBySev
.filter(([_sevName, numHints]) => numHints > 0)
.filter(([_sevName, numHints]) => +numHints > 0)
.map(([sev, num]) => `${sev} (${num})`).join(', ');

let ok: boolean;
Expand All @@ -59,7 +59,7 @@ function getOverallCheckResult(failOn: CheckMode, {ideas, statusCode}: HLintResu
// Note that the summary still shows all counts.
const failedBySev = hintsBySev
.slice(0, HLINT_SEV_LEVELS.indexOf(failOn) + 1)
.filter(([_sevName, numHints]) => numHints > 0);
.filter(([_sevName, numHints]) => +numHints > 0);
ok = failedBySev.length === 0;
}

Expand Down
26 changes: 13 additions & 13 deletions hlint-run/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@
"@actions/io" "^1.0.1"

"@actions/http-client@^2.0.1":
version "2.0.1"
resolved "https://registry.yarnpkg.com/@actions/http-client/-/http-client-2.0.1.tgz#873f4ca98fe32f6839462a6f046332677322f99c"
integrity sha512-PIXiMVtz6VvyaRsGY268qvj57hXQEpsYogYOu2nrQhlf+XCGmZstmuZBbAybUl1nQGnvS1k1eEsQ69ZoD7xlSw==
version "2.1.0"
resolved "https://registry.yarnpkg.com/@actions/http-client/-/http-client-2.1.0.tgz#b6d8c3934727d6a50d10d19f00a711a964599a9f"
integrity sha512-BonhODnXr3amchh4qkmjPMUO8mFi/zLaaCeCAJZqch8iQqyDnVIkySjB38VHAC8IJ+bnlgfOqlhpyCUZHlQsqw==
dependencies:
tunnel "^0.0.6"

"@actions/io@^1.0.1", "@actions/io@^1.1.1":
version "1.1.2"
resolved "https://registry.yarnpkg.com/@actions/io/-/io-1.1.2.tgz#766ac09674a289ce0f1550ffe0a6eac9261a8ea9"
integrity sha512-d+RwPlMp+2qmBfeLYPLXuSRykDIFEwdTA0MMxzS9kh4kvP1ftrc/9fzy6pX6qAjthdXruHQ6/6kjT/DNo5ALuw==
version "1.1.3"
resolved "https://registry.yarnpkg.com/@actions/io/-/io-1.1.3.tgz#4cdb6254da7962b07473ff5c335f3da485d94d71"
integrity sha512-wi9JjgKLYS7U/z8PPbco+PvTb/nRWjeoFlJ1Qer83k/3C5PHQi28hiVdeE2kHXmIL99mQFawx8qt/JPjZilJ8Q==

"@actions/tool-cache@^2.0.1":
version "2.0.1"
Expand All @@ -42,9 +42,9 @@
uuid "^3.3.2"

"@types/node@^18.16.3":
version "18.16.3"
resolved "https://registry.yarnpkg.com/@types/node/-/node-18.16.3.tgz#6bda7819aae6ea0b386ebc5b24bdf602f1b42b01"
integrity sha512-OPs5WnnT1xkCBiuQrZA4+YAV4HEJejmHneyraIaxsbev5yCEr6KMwINNFP9wQeFIw8FWcoTqF3vQsa5CDaI+8Q==
version "18.16.9"
resolved "https://registry.yarnpkg.com/@types/node/-/node-18.16.9.tgz#e79416d778a8714597342bb87efb5a6e914f7a73"
integrity sha512-IeB32oIV4oGArLrd7znD2rkHQ6EDCM+2Sr76dJnrHwv9OHBTTM6nuDLK9bmikXzPa0ZlWMWtRGo/Uw4mrzQedA==

"@vercel/ncc@^0.36.1":
version "0.36.1"
Expand All @@ -61,10 +61,10 @@ tunnel@^0.0.6:
resolved "https://registry.yarnpkg.com/tunnel/-/tunnel-0.0.6.tgz#72f1314b34a5b192db012324df2cc587ca47f92c"
integrity sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==

typescript@^4.9.5:
version "4.9.5"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.5.tgz#095979f9bcc0d09da324d58d03ce8f8374cbe65a"
integrity sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==
typescript@^5.0.4:
version "5.0.4"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.0.4.tgz#b217fd20119bd61a94d4011274e0ab369058da3b"
integrity sha512-cW9T5W9xY37cc+jfEnaUvX91foxtHkza3Nw3wkoF4sSlKn0MONdkdEndig/qPBWXNkmplh3NzayQzCiHM4/hqw==

uuid@^3.3.2:
version "3.4.0"
Expand Down

0 comments on commit 1a462ad

Please sign in to comment.