# Linter warning about object as default property

**URL:** <https://discuss.emberjs.com/t/linter-warning-about-object-as-default-property/17479>\
**Category:** Uncategorized\
**Created:** [February 5, 2020, 9:14am UTC](https://discuss.emberjs.com/t/linter-warning-about-object-as-default-property/17479 "2020-02-05T09:14:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bsylvain](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/bsylvain/32/16348_2.png) [@bsylvain](https://discuss.emberjs.com/u/bsylvain)\
**Post date:** [February 5, 2020, 9:14am UTC](https://discuss.emberjs.com/t/linter-warning-about-object-as-default-property/17479/1 "2020-02-05T09:14:07Z")

</div>

My linter return the following warning: `Only string, number, symbol, boolean, null, undefined, and function are allowed as default properties ember/avoid-leaking-state-in-ember-object`

for this line in a model :

` providerValues:{someprovider:'Some Provider',otherprovider:'Other Provider' }`

That I use to complete this property : `provider:DS.attr('string')`

How should I set static values in a model to avoid this warning ?

---

<div class="post-metadata">

**Author:** ![dknutsen](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/dknutsen/32/16471_2.png) [@dknutsen](https://discuss.emberjs.com/u/dknutsen)\
**Post date:** [February 5, 2020, 4:44pm UTC](https://discuss.emberjs.com/t/linter-warning-about-object-as-default-property/17479/2 "2020-02-05T16:44:44Z")

</div>

The two most common solutions I’ve seen are returning it from a “dummy” computed property or, cleaner and better IMO, wrapping it in `Object.freeze()` e.g.

```auto
providerValues: Object.freeze({ someprovider:'Some Provider',otherprovider:'Other Provider' })

```

This signals that it won’t be mutated at runtime, which follows the both the letter of the law and the spirit, as it were. [Here’s another thread](https://discuss.emberjs.com/t/working-around-avoid-leaking-state-in-ember-objects-eslint-rule/14864) for more reading.
