# Detecting duplicate hooks in component

**URL:** <https://discuss.emberjs.com/t/detecting-duplicate-hooks-in-component/15045>\
**Category:** Ember CLI\
**Created:** [July 2, 2018, 11:23am UTC](https://discuss.emberjs.com/t/detecting-duplicate-hooks-in-component/15045 "2018-07-02T11:23:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bracke](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/bracke/32/15900_2.png) [@bracke](https://discuss.emberjs.com/u/bracke)\
**Post date:** [July 2, 2018, 11:23am UTC](https://discuss.emberjs.com/t/detecting-duplicate-hooks-in-component/15045/1 "2018-07-02T11:23:02Z")

</div>

Hi

Is there any way to make ember-cli warn about duplicate hooks in a component?

Example:

```
didReceiveAttrs(){
	this._super(...arguments);
..
...

},
..
..
.
..
.
.
didReceiveAttrs(){
	this._super(...arguments);
..
..
},

```

I just wasted an hour figuring out why my code (the first one) was not being called 🙂

kind regards

Bent Bracke

---

<div class="post-metadata">

**Author:** ![esbanarango](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/esbanarango/32/10210_2.png) [@esbanarango](https://discuss.emberjs.com/u/esbanarango)\
**Post date:** [July 2, 2018, 2:28pm UTC](https://discuss.emberjs.com/t/detecting-duplicate-hooks-in-component/15045/2 "2018-07-02T14:28:03Z")

</div>

Hello @bracke 👋 !

Ember-cli doesn’t have this feature and I don’t think it will. BUT you could use [eslint-plugin-ember](https://github.com/ember-cli/eslint-plugin-ember) and generate that new rule using the [official yeoman generator](https://github.com/eslint/generator-eslint).

---

<div class="post-metadata">

**Author:** ![jelhan](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/jelhan/32/16917_2.png) [@jelhan](https://discuss.emberjs.com/u/jelhan)\
**Post date:** [July 2, 2018, 2:36pm UTC](https://discuss.emberjs.com/t/detecting-duplicate-hooks-in-component/15045/3 "2018-07-02T14:36:58Z")

</div>

I’m getting a linting error on a newly created project using `ember-cli@3.1.4`:

```auto
/home/foo/tmp/test-lint/app/components/my-component.js
  7:3 error Duplicate key 'didReceiveAttrs' no-dupe-keys

✖ 1 problem (1 error, 0 warnings)

```

The eslint rule is called [`no-duple-keys`](https://eslint.org/docs/rules/no-dupe-keys) and part of the `eslint:recommended` base configuration.
