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

Side effects in conditions are not detected #259

Closed
Baukereg opened this issue Jun 1, 2018 · 0 comments
Closed

Side effects in conditions are not detected #259

Baukereg opened this issue Jun 1, 2018 · 0 comments

Comments

@Baukereg
Copy link

Baukereg commented Jun 1, 2018

The next code throws a no-side-effects error:

foo: computed(function() {
  this.set('bar', 'someValue');
})

Yet this code doesn't:

foo: computed(function() {
  const condition = true;
  if (condition) {
    this.set('bar', 'someValue');
  }
})
@Baukereg Baukereg changed the title Side effect in conditions are not detected Side effects in conditions are not detected Jun 1, 2018
gmurphey pushed a commit to gmurphey/eslint-plugin-ember that referenced this issue Jun 5, 2018
rwjblue pushed a commit that referenced this issue Jul 9, 2018
…260)

* Updating no-side-effects rule to better detect sets inside of block statements within computeds. Fixes #259.

* Fixing false positive errors when using set property in computed object.

* Adding extra test cases.

* Testing for Ember.set more accurately.
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

No branches or pull requests

1 participant