Skip to content

Lint against using class and .extend together (except with mixins) #4

@pzuraq

Description

@pzuraq

In general, the following pattern should be avoided:

export default class PersonComponent extends Component.extend({
  fullName: computed({
    get() {
      return `${this.firstName} ${this.lastName}`; 
    }
  })
}) {
  firstName = 'Diana';
  lastName = 'Prince';
}

However, it is valid to pass a number of mixins to .extend()

export default class PersonComponent extends Component.extend(FullNameMixin, OtherMixin) {
  firstName = 'Diana';
  lastName = 'Prince';
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions