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

Commit 1a462ad

Browse files
authored
add explicit coercion where TypeScript 5 became more strict (#252)
* 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
1 parent 9c0664b commit 1a462ad

File tree

3 files changed

+16
-16
lines changed

3 files changed

+16
-16
lines changed

hlint-run/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,6 @@
3333
"devDependencies": {
3434
"@types/node": "^18.16.3",
3535
"@vercel/ncc": "^0.36.1",
36-
"typescript": "^4.9.5"
36+
"typescript": "^5.0.4"
3737
}
3838
}

hlint-run/src/run.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ async function runHLint(cmd: string, args: string[]): Promise<HLintResult> {
4545
function getOverallCheckResult(failOn: CheckMode, {ideas, statusCode}: HLintResult): CheckResult {
4646
const hintsBySev = HLINT_SEV_LEVELS.map(sev => ([sev, ideas.filter(hint => hint.severity === sev).length]));
4747
const hintSummary = hintsBySev
48-
.filter(([_sevName, numHints]) => numHints > 0)
48+
.filter(([_sevName, numHints]) => +numHints > 0)
4949
.map(([sev, num]) => `${sev} (${num})`).join(', ');
5050

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

hlint-run/yarn.lock

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,16 @@
1818
"@actions/io" "^1.0.1"
1919

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

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

3232
"@actions/tool-cache@^2.0.1":
3333
version "2.0.1"
@@ -42,9 +42,9 @@
4242
uuid "^3.3.2"
4343

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

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

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

6969
uuid@^3.3.2:
7070
version "3.4.0"

0 commit comments

Comments
 (0)