Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: enforce correct TypeScript types for dependent-usage.json object #2951

Merged
merged 1 commit into from
Dec 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions www/src/types/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export interface IUsage {
filePath: string,
line: number,
column: number,
version: string,
index: number,
}

export interface IComponentUsageData {
Expand All @@ -24,14 +24,14 @@ export interface IComponentUsageData {
export interface IDependentProjectsUsages extends Omit<IDependentUsage, 'count'> {
version: string,
name: string,
repository: { type: string, url: string },
repository: { type: string, url: string } | string,
folderName: string,
}

export interface IDependentUsage {
version?: string,
name?: string,
repository?: { type: string, url: string },
repository?: { type: string, url: string } | string,
repositoryUrl?: string,
count: number,
folderName?: string,
Expand Down
5 changes: 2 additions & 3 deletions www/src/utils/getDependentProjectsUsages.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@ import dependentProjectsAnalysis from '../../../dependent-usage.json'; // eslint
import getGithubProjectUrl from './getGithubProjectUrl';
import { IDependentProjectsUsages, IDependentUsage, IUsage } from '../types/types';

const {
projectUsages: dependentProjectsUsages,
} = dependentProjectsAnalysis;
const { projectUsages } = dependentProjectsAnalysis;
const dependentProjectsUsages = projectUsages as unknown as IDependentProjectsUsages[];

export default function getDependentProjectsUsages() {
const dependentProjects: IDependentUsage[] = [];
Expand Down