Repository: ember-cli/eslint-plugin-ember
Pull request #174 (2017-11-15 08:02:43)

Disable and deprecate `avoid-leaking-state-in-components` rule
related to https://github.com/ember-cli/eslint-plugin-ember/pull/156

/cc @michalsnik @rwjblue 


Patch:
diff --git a/README.md b/README.md
index e29775a5..01611381 100644
--- a/README.md
+++ b/README.md
@@ -96,7 +96,6 @@ The `--fix` option on the command line automatically fixes problems reported by
 
 |    | Rule ID | Description |
 |:---|:--------|:------------|
-| :white_check_mark: | [avoid-leaking-state-in-components](./docs/rules/avoid-leaking-state-in-components.md) | Avoids state leakage |
 | :white_check_mark: | [jquery-ember-run](./docs/rules/jquery-ember-run.md) | Prevents usage of jQuery without Ember Run Loop |
 | :white_check_mark: | [no-attrs-in-components](./docs/rules/no-attrs-in-components.md) | Disallow usage of this.attrs in components |
 | :white_check_mark: | [no-attrs-snapshot](./docs/rules/no-attrs-snapshot.md) | Disallow use of attrs snapshot in `didReceiveAttrs` and `didUpdateAttrs` |
@@ -107,6 +106,13 @@ The `--fix` option on the command line automatically fixes problems reported by
 | :white_check_mark: | [routes-segments-snake-case](./docs/rules/routes-segments-snake-case.md) | Enforces usage of snake_cased dynamic segments in routes |
 
 
+### Ember Object
+
+|    | Rule ID | Description |
+|:---|:--------|:------------|
+| :white_check_mark: | [avoid-leaking-state-in-ember-objects](./docs/rules/avoid-leaking-state-in-ember-objects.md) | Avoids state leakage |
+
+
 ### Stylistic Issues
 
 |    | Rule ID | Description |
@@ -123,6 +129,7 @@ The `--fix` option on the command line automatically fixes problems reported by
 
 | Rule ID | Replaced by |
 |:--------|:------------|
+| [avoid-leaking-state-in-components](./docs/rules/avoid-leaking-state-in-components.md) | [avoid-leaking-state-in-ember-objects](./docs/rules/avoid-leaking-state-in-ember-objects.md) |
 | [local-modules](./docs/rules/local-modules.md) | [new-module-imports](./docs/rules/new-module-imports.md) |
 
 <!--RULES_TABLE_END-->
diff --git a/lib/recommended-rules.js b/lib/recommended-rules.js
index fc0244d8..55900d8a 100644
--- a/lib/recommended-rules.js
+++ b/lib/recommended-rules.js
@@ -6,7 +6,8 @@
  */
 module.exports = {
   "ember/alias-model-in-controller": "off",
-  "ember/avoid-leaking-state-in-components": "error",
+  "ember/avoid-leaking-state-in-components": "off",
+  "ember/avoid-leaking-state-in-ember-objects": "error",
   "ember/closure-actions": "error",
   "ember/jquery-ember-run": "error",
   "ember/local-modules": "off",
diff --git a/lib/rules/avoid-leaking-state-in-components.js b/lib/rules/avoid-leaking-state-in-components.js
index 58755a38..900c605a 100644
--- a/lib/rules/avoid-leaking-state-in-components.js
+++ b/lib/rules/avoid-leaking-state-in-components.js
@@ -12,9 +12,11 @@ module.exports = {
     docs: {
       description: 'Avoids state leakage',
       category: 'Possible Errors',
-      recommended: true
+      recommended: false,
+      replacedBy: ['avoid-leaking-state-in-ember-objects'],
     },
     fixable: null, // or "code" or "whitespace"
+    deprecated: true,
     schema: [{
       type: 'array',
       items: { type: 'string' },


Test patch:
diff --git a/tests/__snapshots__/recommended.js.snap b/tests/__snapshots__/recommended.js.snap
index 6d17554c..8299b4b4 100644
--- a/tests/__snapshots__/recommended.js.snap
+++ b/tests/__snapshots__/recommended.js.snap
@@ -2,7 +2,6 @@
 
 exports[`recommended rules 1`] = `
 Array [
-  "avoid-leaking-state-in-components",
   "avoid-leaking-state-in-ember-objects",
   "closure-actions",
   "jquery-ember-run",