Mixins and layout property with ember-decorators

Here are two doubts with their solutions that I had today while working with ember-decorators that could be useful for someone else:

what’s the recommended strategy for handling mixins with e-decorators?

I found the answer in a @pzuraq’s post. Using export default class FooComponent extends Component.extend(FooMixin).

How to set up the layout property of a component with e-decorators? (in-repo-addon)

@chriskrycho suggested me this way

import Component from '@ember/component';
import layout from 'my-addon/templates/my-component';
export default class MyComponent extends Component {
 layout = layout;
}

Just layoutworks too but you get an eslint style error because of a no-unused-vars in the import. So his way is better. Also, Babel’s support for class properties must be enabled.

3 Likes

Thanks! We’re about to implement decorators as soon as we upgrade to the 3.4 LTS release.

This looks like a bug in either eslint or eslint-babel.