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: remove some instances of implicit any #1066

Merged
merged 33 commits into from
May 26, 2022

Conversation

sethidden
Copy link
Contributor

@sethidden sethidden commented May 26, 2022

Note this PR is meant to remove only implicit any, such as writing the below in a .ts file

const func = (a) => // a is any, even though I didn't write a: any

I tried setting noImplicitAny in tsconfig so the cases I'm removing here wouldn't even build but there's too many cases to fix. Even after this PR, there are ~140 implicit any related errors left.

I only fixed the easy ones here. The ones that are left are more difficult (require changes in implementation, removal of certain files etc.)

const integrationKey = `$${tag}`;

if (!nuxtCtx.$vsf || !nuxtCtx.$vsf[integrationKey]) {
if (!nuxtCtx.$vsf || !(nuxtCtx.$vsf as Record<string, any>)[integrationKey]) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Intentional cast with any since it's expected that you can assign anything

locale: undefined,
country: undefined,
currency: undefined,
locale: undefined as undefined,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't be avoided

@sethidden sethidden changed the title refactor: remove implicit any refactor: remove some instances of implicit any May 26, 2022
@@ -1,902 +1,15 @@
/* istanbul ignore file */
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I asked about this file on Slack. I don't really see it being used apart from the few interfaces I left at the bottom.

@sethidden sethidden force-pushed the M2-647-enable-no-implicit-any branch from ac81685 to a17cde3 Compare May 26, 2022 10:28
@sethidden sethidden force-pushed the M2-647-enable-no-implicit-any branch from 7af5dc0 to 9b44e15 Compare May 26, 2022 10:45
@sethidden sethidden marked this pull request as ready for review May 26, 2022 10:52
@@ -1,6 +1,6 @@
import type { CustomerCreateInput } from '~/modules/GraphQL/types';

export const generateUserData = (userData): CustomerCreateInput => {
export const generateUserData = (userData: any): CustomerCreateInput => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you tried with Customer or User instead of any here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes but they didn't fit. This is M2-664

@sethidden sethidden merged commit 3361241 into develop May 26, 2022
@sethidden sethidden deleted the M2-647-enable-no-implicit-any branch May 26, 2022 12:36
@Frodigo Frodigo modified the milestones: 1.0.0-rc.8, 1.0.0-rc.9 May 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants