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

chore: turn on noImplicitThis #1842

Merged
merged 8 commits into from
Feb 20, 2023
Merged

chore: turn on noImplicitThis #1842

merged 8 commits into from
Feb 20, 2023

Conversation

ST-DDT
Copy link
Member

@ST-DDT ST-DDT commented Feb 14, 2023

Fixes #1835, #1838

Both rules need to be changed at the same time, because they cannot be fixed individually.

@ST-DDT ST-DDT added p: 1-normal Nothing urgent c: infra Changes to our infrastructure or project setup labels Feb 14, 2023
@ST-DDT ST-DDT self-assigned this Feb 14, 2023
@ST-DDT ST-DDT marked this pull request as ready for review February 14, 2023 15:48
@ST-DDT ST-DDT requested a review from a team as a code owner February 14, 2023 15:48
@ST-DDT ST-DDT requested a review from a team February 14, 2023 15:48
@ST-DDT ST-DDT linked an issue Feb 14, 2023 that may be closed by this pull request
Copy link
Member

@Shinigami92 Shinigami92 left a comment

Choose a reason for hiding this comment

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

As already discussed in Discord, but to transparently ask this here again:
Does this still work with something like

class X {
  y = 1
  a() {
    return this.y
  }
}
const x = new X()
unqiue(x.a) // is y still bound to the class instance?

@ST-DDT
Copy link
Member Author

ST-DDT commented Feb 14, 2023

In v7.6 and next it outputs undefined.
After this PR it will throw an error.

Neither is correct.

FFR: In v7.6 and next this is { exec: [Getter] } which isn't useful at all.

FWIW Both variants work when using faker.helpers.unique(x.a.bind(x)).

@ST-DDT ST-DDT requested review from Shinigami92 and a team February 15, 2023 09:40
@codecov
Copy link

codecov bot commented Feb 15, 2023

Codecov Report

Merging #1842 (4a2bcb7) into next (be5bd5c) will decrease coverage by 0.02%.
The diff coverage is 100.00%.

Additional details and impacted files
@@            Coverage Diff             @@
##             next    #1842      +/-   ##
==========================================
- Coverage   99.63%   99.62%   -0.02%     
==========================================
  Files        2346     2346              
  Lines      236489   236489              
  Branches     1148     1141       -7     
==========================================
- Hits       235633   235600      -33     
- Misses        834      867      +33     
  Partials       22       22              
Impacted Files Coverage Δ
src/modules/helpers/index.ts 99.21% <100.00%> (ø)
src/modules/helpers/unique.ts 98.78% <100.00%> (ø)
src/modules/internet/user-agent.ts 84.61% <0.00%> (-9.77%) ⬇️

@xDivisionByZerox xDivisionByZerox changed the title chore: turn on strictBindCallApply and strictBindCallApply chore: turn on strictBindCallApply and noImplicitThis Feb 15, 2023
@ST-DDT ST-DDT requested a review from a team February 15, 2023 18:22
@Shinigami92 Shinigami92 added the needs rebase There is a merge conflict label Feb 17, 2023
@ST-DDT ST-DDT removed the needs rebase There is a merge conflict label Feb 19, 2023
@ST-DDT ST-DDT changed the title chore: turn on strictBindCallApply and noImplicitThis chore: turn on noImplicitThis Feb 19, 2023
@ST-DDT ST-DDT enabled auto-merge (squash) February 20, 2023 11:38
@ST-DDT ST-DDT merged commit 0eba320 into next Feb 20, 2023
@ST-DDT ST-DDT deleted the chore/tsconfig-rules-for-shini branch February 20, 2023 11:43
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: Done
Development

Successfully merging this pull request may close these issues.

Turn on noImplicitThis in tsconfig
3 participants