Skip to content
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.

Add noForIn rule #4747

Merged
merged 29 commits into from Jul 4, 2019
Merged

Add noForIn rule #4747

merged 29 commits into from Jul 4, 2019

Conversation

jpike88
Copy link
Contributor

@jpike88 jpike88 commented May 29, 2019

PR checklist

Overview of change:

Is there anything you'd like reviewers to focus on?

I have no idea what I'm doing, this is taken straight from the Microsoft-tslint-contrib repo, with some minor tweaks made. Help lol

CHANGELOG.md entry:

[new-rule] no-for-in

@palantirtech
Copy link
Member

Thanks for your interest in palantir/tslint, @jpike88! Before we can accept your pull request, you need to sign our contributor license agreement - just visit https://cla.palantir.com/ and follow the instructions. Once you sign, I'll automatically update this pull request.

@jpike88
Copy link
Contributor Author

jpike88 commented May 29, 2019

@JoshuaKGoldberg am trying to make that test pass... could you suggest the correct code for that?

@JoshuaKGoldberg
Copy link
Contributor

JoshuaKGoldberg commented May 29, 2019

@jpike88 please clean up build failures; we'll be able to review once they're done.

Note that there are a couple outside of this PR: #4745

Edit: sorry, just saw your comment! Mine wasn't very helpful. 😦 . +1 to adidahiya's suggestion.

@adidahiya
Copy link
Contributor

Try merging master to get the fix for #4745

@jpike88
Copy link
Contributor Author

jpike88 commented Jun 9, 2019

@JoshuaKGoldberg finally, looking forward to the pr and release!

@jpike88
Copy link
Contributor Author

jpike88 commented Jun 13, 2019

Guys, any movement?

@adidahiya
Copy link
Contributor

@jpike88 thanks for updating the PR, I'll take a look today

src/rules/noForInRule.ts Outdated Show resolved Hide resolved
const object = {test:1, test2:1 ,test3:1};
for (const key in object) {
~~~~~~~~~~~~~~~~~~~~~~~~~~~
if (object.hasOwnProperty(key)) {.
Copy link
Contributor

Choose a reason for hiding this comment

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

stray trailing .

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Suggested change
if (object.hasOwnProperty(key)) {.
if (object.hasOwnProperty(key)) {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Suggested change
if (object.hasOwnProperty(key)) {.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Suggested change
if (object.hasOwnProperty(key)) {.
if (object.hasOwnProperty(key)) {

test/rules/no-for-in/test.ts.lint Outdated Show resolved Hide resolved
test/rules/no-for-in/test.ts.lint Outdated Show resolved Hide resolved
test/rules/no-for-in/test.ts.lint Outdated Show resolved Hide resolved
@@ -0,0 +1,23 @@
// this should pass
Copy link
Contributor

Choose a reason for hiding this comment

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

no need to write this, it's implied by the lack of lint failure marker

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Suggested change
// this should pass

src/rules/noForInRule.ts Outdated Show resolved Hide resolved
src/rules/noForInRule.ts Outdated Show resolved Hide resolved
src/configuration.ts Outdated Show resolved Hide resolved
Co-Authored-By: Adi Dahiya <adi.dahiya14@gmail.com>
src/configuration.ts Outdated Show resolved Hide resolved
src/configuration.ts Outdated Show resolved Hide resolved
src/configuration.ts Outdated Show resolved Hide resolved
src/configuration.ts Outdated Show resolved Hide resolved
src/configuration.ts Outdated Show resolved Hide resolved
src/rules/noForInRule.ts Outdated Show resolved Hide resolved
src/rules/noForInRule.ts Show resolved Hide resolved
src/configuration.ts Outdated Show resolved Hide resolved
@adidahiya
Copy link
Contributor

You missed some of my code suggestions - please go to the Files tab of the PR and apply them all as a batch

Josh Pike and others added 2 commits July 3, 2019 13:22
Co-Authored-By: Adi Dahiya <adi.dahiya14@gmail.com>
Copy link
Contributor

@adidahiya adidahiya left a comment

Choose a reason for hiding this comment

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

need to fix lint failure

src/rules/noForInRule.ts Outdated Show resolved Hide resolved
src/rules/noForInRule.ts Outdated Show resolved Hide resolved
Josh Pike and others added 2 commits July 4, 2019 09:32
Co-Authored-By: Adi Dahiya <adi.dahiya14@gmail.com>
Co-Authored-By: Adi Dahiya <adi.dahiya14@gmail.com>
@jpike88
Copy link
Contributor Author

jpike88 commented Jul 4, 2019

@adidahiya at last... hopefully this is it lol

@adidahiya adidahiya merged commit f31dd94 into palantir:master Jul 4, 2019
@adidahiya
Copy link
Contributor

thanks @jpike88!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

no-for-in
4 participants