Skip to content

Commit 449181f

Browse files
chore(types): list inferred any locations without a type column
1 parent 1e3e209 commit 449181f

1 file changed

Lines changed: 4 additions & 8 deletions

File tree

‎tooling/type-coverage.js‎

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ const ESCAPE_HATCH_DIRECTORIES = ["lib/", "hot/"];
4444
* @typedef {object} InferredAny
4545
* @property {number} line the line, from 1
4646
* @property {string} name the identifier
47-
* @property {string} type the type TypeScript infers for it
4847
*/
4948

5049
/** @type {Record<string, InferredAny[]>} */
@@ -273,8 +272,7 @@ for (const sourceFile of program.getSourceFiles()) {
273272
if (!isTyped && inferredAny && type.flags & ts.TypeFlags.Any) {
274273
inferredAny.push({
275274
line: line + 1,
276-
name: node.getText(sourceFile),
277-
type: typeText
275+
name: node.getText(sourceFile)
278276
});
279277
}
280278
statementIndex++;
@@ -582,13 +580,11 @@ if (baseCounts) {
582580
/** @type {string[]} */
583581
const lines = [];
584582
for (const file of worse) {
585-
for (const { line, name, type } of inferredAnyByFile[file] || []) {
586-
lines.push(
587-
`| \`${file}:${line}\` | \`${name}\` | \`${type.replace(/\|/g, "\\|")}\` |`
588-
);
583+
for (const { line, name } of inferredAnyByFile[file] || []) {
584+
lines.push(`- \`${file}:${line}\` \`${name}\``);
589585
}
590586
}
591-
report += `\n<details><summary>Inferred \`any\` in the files this pull request adds some to</summary>\n\n| Location | Identifier | Type |\n| :-- | :-- | :-- |\n${lines.join("\n")}\n\n</details>\n`;
587+
report += `\n<details><summary>Inferred \`any\` in the files this pull request adds some to</summary>\n\n${lines.join("\n")}\n\n</details>\n`;
592588
}
593589
}
594590

0 commit comments

Comments
 (0)