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

refactor: types refactoring #1063

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
9 changes: 3 additions & 6 deletions library/src/components/Extensions.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
/* eslint-disable @typescript-eslint/no-unsafe-return */
/* eslint-disable @typescript-eslint/no-unsafe-assignment */

import React from 'react';

import { Schema } from './Schema';
import type { SchemaInterface } from '@asyncapi/parser';

import { SchemaHelpers } from '../helpers';

interface Props {
name?: string;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
item: any;
item: SchemaInterface;
}

export const Extensions: React.FunctionComponent<Props> = ({
Expand All @@ -22,7 +19,7 @@ export const Extensions: React.FunctionComponent<Props> = ({
return null;
}

const schema = SchemaHelpers.jsonToSchema(extensions);
const schema: SchemaInterface = SchemaHelpers.jsonToSchema(extensions);

return (
schema && (
Expand Down
2 changes: 1 addition & 1 deletion library/src/helpers/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ export class SchemaHelpers {
}

// eslint-disable-next-line @typescript-eslint/no-explicit-any
static jsonToSchema(value: any): any {
static jsonToSchema(value: any): SchemaInterface {
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
const json = this.jsonFieldToSchema(value);
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
Expand Down
Loading