-
-
Notifications
You must be signed in to change notification settings - Fork 126
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
base: master
Are you sure you want to change the base?
Changes from all commits
a0522f7
0431f58
4945997
1b889b4
5d6eb34
e67ab85
1552664
2402425
706e9c5
58c2457
642d403
663af15
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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<AsyncAPIDocumentInterface>(null as any); | ||
React.createContext<AsyncAPIDocumentInterface>(null as never); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think your changes here is unnecessarily strict and semantically incorrect in this scenario. I'd suggest we use the existing type :) |
||
|
||
export function useSpec() { | ||
return useContext(SpecificationContext); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @DhairyaMajmudar the |
||
} | ||
|
||
export class AsyncApiWebComponent extends React.Component<AsyncApiWebComponentProps> { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this line should be removed