ESLint: Fix problems so linter check passes

This fixes errors caused by turning `@typescript-eslint/ban-ts-comment` on.
This commit is contained in:
regexowl 2024-03-14 11:25:03 +01:00 committed by Klara Simickova
parent d2ea46f243
commit a7d320e4a8
5 changed files with 16 additions and 19 deletions

View file

@ -111,8 +111,7 @@ const ProfileSelector = ({ input }: ProfileSelectorProps) => {
change('kernel', undefined);
change('disabledServices', undefined);
change('enabledServices', undefined);
// @ts-ignore
setProfileName(undefined);
setProfileName('');
reinitDependingSteps(change);
};

View file

@ -15,12 +15,15 @@ type repoPropType = {
};
const RepoName = ({ repoUrl }: repoPropType) => {
const { data, isSuccess, isFetching, isError } = useListRepositoriesQuery({
// @ts-ignore
url: repoUrl,
contentType: 'rpm',
origin: 'external',
});
const { data, isSuccess, isFetching, isError } = useListRepositoriesQuery(
{
// @ts-ignore if repoUrl is undefined the query is going to get skipped, so it's safe to ignore the linter here
url: repoUrl,
contentType: 'rpm',
origin: 'external',
},
{ skip: !repoUrl }
);
const errorLoading = () => {
return (

View file

@ -516,7 +516,7 @@ export const RegisterNowList = () => {
})();
});
const { isError } = useShowActivationKeyQuery(
// @ts-ignore - type of 'activationKey' might not be strictly compatible with the expected type for 'name'.
// @ts-ignore type of 'activationKey' might not be strictly compatible with the expected type for 'name'.
{ name: activationKey },
{
skip: !activationKey,

View file

@ -24,8 +24,7 @@ export const AzureResourceGroups = () => {
const [isOpen, setIsOpen] = useState(false);
const { data: sourceDetails, isFetching } = useGetSourceUploadInfoQuery(
// @ts-ignore
{ id: azureSource },
{ id: parseInt(azureSource as string) },
{
skip: !azureSource,
}

View file

@ -50,8 +50,7 @@ const enhancedApi = imageBuilderApi.enhanceEndpoints({
queryFulfilled
.then(() => {
dispatch(
// Typescript is unaware of tag types being defined concurrently in enhanceEndpoints()
// @ts-expect-error
// @ts-expect-error Typescript is unaware of tag types being defined concurrently in enhanceEndpoints()
imageBuilderApi.util.invalidateTags(['Blueprints', 'Blueprint'])
);
dispatch(
@ -78,8 +77,7 @@ const enhancedApi = imageBuilderApi.enhanceEndpoints({
onQueryStarted: async (_, { dispatch, queryFulfilled }) => {
queryFulfilled
.then(() => {
// Typescript is unaware of tag types being defined concurrently in enhanceEndpoints()
// @ts-expect-error
// @ts-expect-error Typescript is unaware of tag types being defined concurrently in enhanceEndpoints()
dispatch(imageBuilderApi.util.invalidateTags(['Blueprints']));
dispatch(
addNotification({
@ -110,8 +108,7 @@ const enhancedApi = imageBuilderApi.enhanceEndpoints({
.then(() => {
dispatch(
imageBuilderApi.util.invalidateTags([
// Typescript is unaware of tag types being defined concurrently in enhanceEndpoints()
// @ts-expect-error
// @ts-expect-error Typescript is unaware of tag types being defined concurrently in enhanceEndpoints()
{ type: 'Clone', id: composeId },
])
);
@ -169,8 +166,7 @@ const enhancedApi = imageBuilderApi.enhanceEndpoints({
queryFulfilled
.then(() => {
dispatch(
// Typescript is unaware of tag types being defined concurrently in enhanceEndpoints()
// @ts-expect-error
// @ts-expect-error Typescript is unaware of tag types being defined concurrently in enhanceEndpoints()
imageBuilderApi.util.invalidateTags(['Blueprints', 'Compose'])
);
dispatch(