ember-cli / ember-cli/eslint-plugin-ember

New Rule: no-self-referencing-properties

Open
#1,124 2 comments 1 reaction 0 assignees View on GitHub
enhancement New Rule
Dominant language
JavaScript
Stars
263
Forks
214
Avg merge
30m
Merged PRs (30d)
5

Description

This rule would catch the issue that led to the bug in #1118

This rule would lint all macros as well as computed properties and getters for self-referential behavior. It would be applied to classic syntax as well as native syntax.

```js
import Component from '@ember/component';
import { computed } from '@ember/object';
import { reads } from '@ember/object/computed';

export default MyComponent extends Component {
// BAD
get foo() {
return this.foo;
}

// BAD
@computed('bar')
get bar() {
return this.bar;
}

// BAD
@computed('not-biz')
get biz() {
return this.biz;
}

// BAD
@reads('baz') baz;
}
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.