Skip to content

Commit de1e4e6

Browse files
chore: remove unused wellKnownTypes (#2179)
## PR Checklist - [ ] Addresses an existing open issue: fixes #000 (Didn't create task for this simple thing) - [x] That issue was marked as [`status: accepting prs`](https://github.com/JoshuaKGoldberg/TypeStat/issues?q=is%3Aopen+is%3Aissue+label%3A%22status%3A+accepting+prs%22) - [x] Steps in [CONTRIBUTING.md](https://github.com/JoshuaKGoldberg/TypeStat/blob/main/.github/CONTRIBUTING.md) were taken ## Overview I don't know when `wellKnownTypes` became unused, but nothing seems to be using it anymore. 🐙
1 parent 2666558 commit de1e4e6

File tree

2 files changed

+0
-26
lines changed

2 files changed

+0
-26
lines changed

src/services/language.ts

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,8 @@ import ts from "typescript";
44

55
import { TypeStatOptions } from "../options/types.js";
66
import { arrayify, uniquify } from "../shared/arrays.js";
7-
import { isIntrinsicNameType, WellKnownTypeName } from "../shared/typeNodes.js";
87
import { createProgramConfiguration } from "./createProgramConfiguration.js";
98

10-
export type WellKnownTypes = Readonly<
11-
Record<WellKnownTypeName, Readonly<ts.Type>>
12-
>;
13-
149
/**
1510
* Language service and type information with their backing TypeScript configuration.
1611
*/
@@ -19,7 +14,6 @@ export interface LanguageServices {
1914
readonly parsedConfiguration: ts.ParsedCommandLine;
2015
readonly printers: Printers;
2116
readonly program: ts.Program;
22-
readonly wellKnownTypes: WellKnownTypes;
2317
}
2418

2519
export interface Printers {
@@ -97,24 +91,11 @@ export const createLanguageServices = (
9791
},
9892
};
9993

100-
let wellKnownTypes: undefined | WellKnownTypes;
101-
10294
return {
10395
languageService,
10496
parsedConfiguration,
10597
printers,
10698
program,
107-
get wellKnownTypes(): WellKnownTypes {
108-
return (wellKnownTypes ??= program
109-
.getTypeCatalog()
110-
.reduce<Record<WellKnownTypeName, ts.Type>>((acc, type) => {
111-
if (isIntrinsicNameType(type)) {
112-
acc[type.intrinsicName] = type;
113-
}
114-
115-
return acc;
116-
}, {} as WellKnownTypes));
117-
},
11899
};
119100
};
120101
/* eslint-enable @typescript-eslint/unbound-method */

src/types.d.ts

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)