diff --git a/library/src/components/Extensions.tsx b/library/src/components/Extensions.tsx index b98d44c00..5d8a87f0e 100644 --- a/library/src/components/Extensions.tsx +++ b/library/src/components/Extensions.tsx @@ -1,6 +1,5 @@ /* eslint-disable @typescript-eslint/no-unsafe-return */ /* eslint-disable @typescript-eslint/no-unsafe-assignment */ - import React from 'react'; import { Schema } from './Schema'; diff --git a/library/src/components/Schema.tsx b/library/src/components/Schema.tsx index 8ec964f8a..462edbe72 100644 --- a/library/src/components/Schema.tsx +++ b/library/src/components/Schema.tsx @@ -512,9 +512,7 @@ const AdditionalItems: React.FunctionComponent = ({ if (!Array.isArray(schema.items())) { return null; } - - // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-explicit-any - const additionalItems = schema.additionalItems() as any; + const additionalItems = schema.additionalItems(); if (additionalItems === true || additionalItems === undefined) { return (

diff --git a/library/src/contexts/useSpec.ts b/library/src/contexts/useSpec.ts index 92b863166..b027d8a21 100644 --- a/library/src/contexts/useSpec.ts +++ b/library/src/contexts/useSpec.ts @@ -2,8 +2,7 @@ import React, { useContext } from 'react'; import { AsyncAPIDocumentInterface } from '@asyncapi/parser'; export const SpecificationContext = - // eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-explicit-any - React.createContext(null as any); + React.createContext(null as never); export function useSpec() { return useContext(SpecificationContext); diff --git a/library/src/helpers/schema.ts b/library/src/helpers/schema.ts index 12846eab9..af11cb632 100644 --- a/library/src/helpers/schema.ts +++ b/library/src/helpers/schema.ts @@ -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 diff --git a/web-component/src/AsyncApiWebComponent.tsx b/web-component/src/AsyncApiWebComponent.tsx index 9bcb139ab..92b2c6267 100644 --- a/web-component/src/AsyncApiWebComponent.tsx +++ b/web-component/src/AsyncApiWebComponent.tsx @@ -26,12 +26,10 @@ function retrieveSchemaProp( let schemaFetchOptions = props.schemaFetchOptions; if (!schemaUrl || schemaUrl === 'undefined') { - // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-explicit-any - schemaUrl = undefined as any; + schemaUrl = undefined; } if (!schemaFetchOptions) { - // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-explicit-any - schemaFetchOptions = undefined as any; + schemaFetchOptions = undefined; } let schema = props.schema || {}; @@ -50,7 +48,7 @@ function retrieveSchemaProp( export interface AsyncApiWebComponentProps extends AsyncApiProps { cssImportPath?: string; schemaFetchOptions?: RequestInit; - schemaUrl: string; + schemaUrl?: string; } export class AsyncApiWebComponent extends React.Component {