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

Verify computed property dependencies #115

Merged
merged 1 commit into from
Dec 5, 2016

Conversation

nikku
Copy link
Contributor

@nikku nikku commented Dec 4, 2016

With the PR merged this code snipped will fail to compile:

export default {
  computed: {
    bar: () => { return new Date().getTime(); }
  }
};

Helps newbies to properly use computed properties and verifies the compiler does not generate broken code (would generate if ( ) somewhere in the code base otherwise.

Improves the validator to fail if someone forgets to declare
dependent properties for computed state:

```
export default {
  computed: {
    bar: () => { return new Date().getTime(); }
  }
};
```
@codecov-io
Copy link

codecov-io commented Dec 4, 2016

Current coverage is 90.88% (diff: 100%)

Merging #115 into master will increase coverage by 0.02%

@@             master       #115   diff @@
==========================================
  Files            48         48          
  Lines          1324       1328     +4   
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
+ Hits           1203       1207     +4   
  Misses          121        121          
  Partials          0          0          

Powered by Codecov. Last update 5770048...65cdead

@Rich-Harris Rich-Harris merged commit 3935d05 into sveltejs:master Dec 5, 2016
@Rich-Harris
Copy link
Member

This is a nice touch, thanks

@nikku nikku deleted the validate-computed-prop branch December 5, 2016 07:24
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

Successfully merging this pull request may close these issues.

None yet

3 participants