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

Fix more prefer-const warnings #137

Closed
GoodForOneFare opened this issue May 26, 2016 · 2 comments
Closed

Fix more prefer-const warnings #137

GoodForOneFare opened this issue May 26, 2016 · 2 comments
Assignees
Labels

Comments

@GoodForOneFare
Copy link
Member

GoodForOneFare commented May 26, 2016

The js-codemod/no-vars transform should be picking these off, but there are many left behind in places that should use const.

For example, in product-resource-browser.js, this loop should use a const for the variant variable in its for loop:

for (let variant of product.variants) {
  variant.disabled = this._variantDisabled(variant, product);
  variant.alreadyAdded = this._variantSelected(variant);

  if ((product.alreadyAdded === null || product.alreadyAdded) && !variant.disabled) {
    product.alreadyAdded = variant.alreadyAdded;
  }
}
@lemonmade
Copy link
Member

I have noticed this mostly in for of loops, I think there must be some logic off in the transform we use for this specific case.

@lemonmade lemonmade added the bug label May 26, 2016
@lemonmade lemonmade self-assigned this May 31, 2016
@lemonmade
Copy link
Member

Fix submitted to js-codemod: cpojer/js-codemod#43

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

No branches or pull requests

2 participants