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

Add no-computed-without-dependent-keys rule #346

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

gmurphey
Copy link
Contributor

Todo:

  • Add documentation

const ember = require('../utils/ember');

//------------------------------------------------------------------------------
// General rule - Don't introduce side-effects in computed properties
Copy link
Member

Choose a reason for hiding this comment

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

the comment banner will need to be updated or removed

message: 'A computed property needs dependent keys'
}]
},
],
Copy link
Member

Choose a reason for hiding this comment

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

can you add tests for a few of the common computed property macros?

@gmurphey
Copy link
Contributor Author

Also realized we'll need to ignore volatile computeds for this rule.

@gmurphey gmurphey force-pushed the no-computed-without-dependent-keys branch from 4823a98 to 99ae07b Compare December 3, 2018 16:28
@Turbo87 Turbo87 changed the title Adding no-computed-without-dependent-keys rule Add no-computed-without-dependent-keys rule Jan 10, 2019
@rwjblue
Copy link
Member

rwjblue commented Jun 26, 2019

I'd love to land this.

@gmurphey - Have any cycles to address the feedback and rebase?

@rwjblue
Copy link
Member

rwjblue commented Jun 26, 2019

Thoughts on using require-computed-dependent-keys instead of no-computed-without-dependent-keys? I don't feel strongly either way, just wondering what folks thought...

Copy link
Member

@rwjblue rwjblue left a comment

Choose a reason for hiding this comment

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

Also need to add an invalid test for:

        export default Ember.Component({
          foo: computed({
            get() {
              return this.get('bar') * 2;
            }
          })
        });

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

Successfully merging this pull request may close these issues.

3 participants