Skip to content

Commit 03d6ce1

Browse files
committed
Eating my own dog food
1 parent bfe6fba commit 03d6ce1

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

src/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
type FilePath = string;
2-
export type SymbolType = 'type' | 'interface' | 'enum';
2+
type SymbolType = 'type' | 'interface' | 'enum';
33

44
type UnusedFileIssues = Set<FilePath>;
55
type UnusedExportIssues = Record<string, Record<string, Issue>>;

src/util.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ const isFile = async (filePath: string) => {
1212
}
1313
};
1414

15-
export const findFile = async (cwd: string, fileName: string): Promise<string> => {
15+
const findFile = async (cwd: string, fileName: string): Promise<string> => {
1616
const filePath = path.join(cwd, fileName);
1717
if (await isFile(filePath)) return filePath;
1818
return findFile(path.resolve(cwd, '..'), fileName);
1919
};
2020

21-
export const resolvePaths = (cwd: string, patterns: string | string[]) => {
21+
const resolvePaths = (cwd: string, patterns: string | string[]) => {
2222
return [patterns].flat().map(pattern => {
2323
if (pattern.startsWith('!')) return '!' + path.join(cwd, pattern.slice(1));
2424
return path.join(cwd, pattern);
@@ -51,11 +51,6 @@ export const partitionSourceFiles = (projectFiles: SourceFile[], productionFiles
5151
return [usedFiles, unusedFiles];
5252
};
5353

54-
export const isType = (declaration: ExportedDeclarations) =>
55-
declaration.isKind(ts.SyntaxKind.TypeAliasDeclaration) ||
56-
declaration.isKind(ts.SyntaxKind.InterfaceDeclaration) ||
57-
declaration.isKind(ts.SyntaxKind.EnumDeclaration);
58-
5954
export const getType = (declaration: ExportedDeclarations) => {
6055
if (declaration.isKind(ts.SyntaxKind.TypeAliasDeclaration)) return 'type';
6156
if (declaration.isKind(ts.SyntaxKind.InterfaceDeclaration)) return 'interface';

0 commit comments

Comments
 (0)