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

Remove all @ts-ignore #14221

Merged
merged 1 commit into from
Jun 28, 2022
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
1 change: 0 additions & 1 deletion airbyte-webapp/.eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@
"@typescript-eslint/ban-ts-comment": [
"warn",
{
"ts-ignore": "allow-with-description",
"ts-expect-error": "allow-with-description"
}
],
Expand Down
2 changes: 1 addition & 1 deletion airbyte-webapp/src/components/EntityTable/utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export function getEntityTableData<

const connectEntities = entityConnections.map((connection) => ({
name: connection[connectType]?.name || "",
// @ts-ignore ts is not that clever to infer such types
// @ts-expect-error ts is not that clever to infer such types
connector: connection[connectType]?.[`${connectType}Name`] || "",
status: connection.status,
lastSyncStatus: getConnectionSyncStatus(connection.status, connection.latestSyncJobStatus),
Expand Down
29 changes: 13 additions & 16 deletions airbyte-webapp/src/components/Table/Table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -161,22 +161,19 @@ const Table: React.FC<IProps> = ({ columns, data, onClickRow, erroredRows, sortB
onClick={() => onClickRow?.(row.original)}
erroredRows={erroredRows && !!row.original.error}
>
{
// @ts-ignore needs to address proper types for table
row.cells.map((cell: ICellProps, key) => {
return (
<Td
{...cell.getCellProps()}
collapse={cell.column.collapse}
customPadding={cell.column.customPadding}
customWidth={cell.column.customWidth}
key={`table-cell-${row.id}-${key}`}
>
{cell.render("Cell")}
</Td>
);
})
}
{row.cells.map((cell: ICellProps, key) => {
return (
<Td
{...cell.getCellProps()}
collapse={cell.column.collapse}
customPadding={cell.column.customPadding}
customWidth={cell.column.customWidth}
key={`table-cell-${row.id}-${key}`}
>
{cell.render("Cell")}
</Td>
);
})}
</Tr>
);
})}
Expand Down
2 changes: 1 addition & 1 deletion airbyte-webapp/src/core/domain/connector/SourceService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export class SourceService extends AirbyteRequestService {
const e = new CommonRequestError(result);
// Generate error with failed status and received logs
e._status = 400;
// @ts-ignore address this case
// @ts-expect-error address this case
e.response = result.jobInfo;
throw e;
}
Expand Down
6 changes: 3 additions & 3 deletions airbyte-webapp/src/core/jsonSchema/schemaToYup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,17 +119,17 @@ export const buildYupFormForJsonSchema = (
const hasDefault = isDefined(jsonSchema.default);

if (hasDefault) {
// @ts-ignore can't infer correct type here so lets just use default from json_schema
// @ts-expect-error can't infer correct type here so lets just use default from json_schema
schema = schema.default(jsonSchema.default);
}

if (!hasDefault && jsonSchema.const) {
// @ts-ignore can't infer correct type here so lets just use default from json_schema
// @ts-expect-error can't infer correct type here so lets just use default from json_schema
schema = schema.oneOf([jsonSchema.const]).default(jsonSchema.const);
}

if (jsonSchema.enum) {
// @ts-ignore as enum is array we are going to use it as oneOf for yup
// @ts-expect-error as enum is array we are going to use it as oneOf for yup
schema = schema.oneOf(jsonSchema.enum);
}

Expand Down
2 changes: 1 addition & 1 deletion airbyte-webapp/src/core/request/AirbyteRequestService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ async function parseResponse<T>(response: Response): Promise<T> {
return await response.json();
}

// @ts-ignore TODO: needs refactoring of services
// @ts-expect-error TODO: needs refactoring of services
return response;
}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ const News: React.FC = () => {
<FormattedMessage id="login.selfhosting" />
</H2>
<GitBlock>
{/*@ts-ignore github icon fails here*/}
<GitIcon icon={faGithub} />
<div>
<H4>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ const SidebarPopout: React.FC<{
label: (
<Item href={config.links.slackLink} target="_blank">
<Icon>
{/*@ts-ignore slack icon fails here*/}
<FontAwesomeIcon icon={faSlack} />
</Icon>
<FormattedMessage id="sidebar.joinSlack" />
Expand Down