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

Turn on strictBindCallApply in tsconfig #1835

Closed
ST-DDT opened this issue Feb 13, 2023 · 9 comments
Closed

Turn on strictBindCallApply in tsconfig #1835

ST-DDT opened this issue Feb 13, 2023 · 9 comments
Labels
c: infra Changes to our infrastructure or project setup p: 1-normal Nothing urgent
Milestone

Comments

@ST-DDT
Copy link
Member

ST-DDT commented Feb 13, 2023

#651 partially activated strict mode, this flag was omitted at that time and should probably be turned on.

// "strictBindCallApply": true,

Related issues:

@Shinigami92
Copy link
Member

I tried to set strictBindCallApply: true but I have a problem in line

const result: ReturnType<Method> = method.apply(this, args);

But as we want to get rid of this anyway

I will put no more effort into strictBindCallApply until then

@ST-DDT
Copy link
Member Author

ST-DDT commented Feb 14, 2023

Is it possible to just replace this with undefined?

@Shinigami92
Copy link
Member

Is it possible to just replace this with undefined?

Could you explain a bit how you come to this conclusion? I would like to understand what your thought-process is.

@ST-DDT
Copy link
Member Author

ST-DDT commented Feb 14, 2023

Since the value isnt bound to anything useful in the first place (aka this isnt bound to anything specific since it isnt even in the helpers module directly and thus doesnt get bound by the constructor). We could just drop it entirely.
Or am I missing something?

@Shinigami92
Copy link
Member

image

I suggest setting strictBindCallApply locally and try around a bit on your own
That could speed up the process and doesn't require so much writing here

@ST-DDT
Copy link
Member Author

ST-DDT commented Feb 14, 2023

Done: #1842

@ST-DDT ST-DDT self-assigned this Feb 14, 2023
@ST-DDT ST-DDT moved this from Todo to Awaiting Review in Faker Roadmap Feb 14, 2023
@ST-DDT
Copy link
Member Author

ST-DDT commented Feb 19, 2023

Blocked by #1842


I no longer know how to fix these lines:

this[name] = this[name].bind(this);

For most modules I can simply do:

this[name] = this[name].bind(this, ...[]);

but that doesn't work for the helpers module.

@ST-DDT ST-DDT added s: on hold Blocked by something or frozen to avoid conflicts and removed s: on hold Blocked by something or frozen to avoid conflicts labels Feb 19, 2023
@ST-DDT ST-DDT removed their assignment Feb 21, 2023
@ST-DDT
Copy link
Member Author

ST-DDT commented May 6, 2023

@ST-DDT ST-DDT added the s: on hold Blocked by something or frozen to avoid conflicts label May 6, 2023
@ST-DDT ST-DDT removed the s: on hold Blocked by something or frozen to avoid conflicts label Oct 5, 2023
@xDivisionByZerox
Copy link
Member

I will close this as this has been activated implicitly in #2102.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: infra Changes to our infrastructure or project setup p: 1-normal Nothing urgent
Projects
No open projects
Status: Awaiting Review
Development

No branches or pull requests

3 participants