Repository: ember-cli/eslint-plugin-ember
Pull request #940 (2020-09-07 21:13:06)

Enable additional recommended rules
* [no-assignment-of-untracked-properties-used-in-tracking-contexts](https://github.com/ember-cli/eslint-plugin-ember/blob/master/docs/rules/no-assignment-of-untracked-properties-used-in-tracking-contexts.md)
* [no-controller-access-in-routes](https://github.com/ember-cli/eslint-plugin-ember/blob/master/docs/rules/no-controller-access-in-routes.md)
* [no-invalid-test-waiters](https://github.com/ember-cli/eslint-plugin-ember/blob/master/docs/rules/no-invalid-test-waiters.md)
* [no-noop-setup-on-error-in-before](https://github.com/ember-cli/eslint-plugin-ember/blob/master/docs/rules/no-noop-setup-on-error-in-before.md)
* [no-test-this-render](https://github.com/ember-cli/eslint-plugin-ember/blob/master/docs/rules/no-test-this-render.md)
* [prefer-ember-test-helpers](https://github.com/ember-cli/eslint-plugin-ember/blob/master/docs/rules/prefer-ember-test-helpers.md)

Part of https://github.com/ember-cli/eslint-plugin-ember/issues/825.


Patch:
diff --git a/README.md b/README.md
index 2ac10bfe..326092eb 100644
--- a/README.md
+++ b/README.md
@@ -76,7 +76,7 @@ Rules are grouped by category to help you understand their purpose. Each rule ha
 |:---|:--------|:------------|
 |  | [computed-property-getters](./docs/rules/computed-property-getters.md) | enforce the consistent use of getters in computed properties |
 | :white_check_mark: | [no-arrow-function-computed-properties](./docs/rules/no-arrow-function-computed-properties.md) | disallow arrow functions in computed properties |
-| :wrench: | [no-assignment-of-untracked-properties-used-in-tracking-contexts](./docs/rules/no-assignment-of-untracked-properties-used-in-tracking-contexts.md) | disallow assignment of untracked properties that are used as computed property dependencies |
+| :white_check_mark::wrench: | [no-assignment-of-untracked-properties-used-in-tracking-contexts](./docs/rules/no-assignment-of-untracked-properties-used-in-tracking-contexts.md) | disallow assignment of untracked properties that are used as computed property dependencies |
 | :car: | [no-computed-properties-in-native-classes](./docs/rules/no-computed-properties-in-native-classes.md) | disallow using computed properties in native classes |
 | :white_check_mark: | [no-deeply-nested-dependent-keys-with-each](./docs/rules/no-deeply-nested-dependent-keys-with-each.md) | disallow usage of deeply-nested computed property dependent keys with `@each` |
 | :white_check_mark::wrench: | [no-duplicate-dependent-keys](./docs/rules/no-duplicate-dependent-keys.md) | disallow repeating computed property dependent keys |
@@ -159,7 +159,7 @@ Rules are grouped by category to help you understand their purpose. Each rule ha
 |    | Rule ID | Description |
 |:---|:--------|:------------|
 | :white_check_mark: | [no-capital-letters-in-routes](./docs/rules/no-capital-letters-in-routes.md) | disallow routes with uppercased letters in router.js |
-|  | [no-controller-access-in-routes](./docs/rules/no-controller-access-in-routes.md) | disallow routes from accessing the controller outside of setupController/resetController |
+| :white_check_mark: | [no-controller-access-in-routes](./docs/rules/no-controller-access-in-routes.md) | disallow routes from accessing the controller outside of setupController/resetController |
 | :white_check_mark: | [no-private-routing-service](./docs/rules/no-private-routing-service.md) | disallow injecting the private routing service |
 |  | [no-unnecessary-index-route](./docs/rules/no-unnecessary-index-route.md) | disallow unnecessary `index` route definition |
 | :white_check_mark::wrench: | [no-unnecessary-route-path-option](./docs/rules/no-unnecessary-route-path-option.md) | disallow unnecessary usage of the route `path` option |
@@ -181,17 +181,17 @@ Rules are grouped by category to help you understand their purpose. Each rule ha
 |    | Rule ID | Description |
 |:---|:--------|:------------|
 | :white_check_mark: | [no-ember-testing-in-module-scope](./docs/rules/no-ember-testing-in-module-scope.md) | disallow use of `Ember.testing` in module scope |
-|  | [no-invalid-test-waiters](./docs/rules/no-invalid-test-waiters.md) | disallow incorrect usage of test waiter APIs |
+| :white_check_mark: | [no-invalid-test-waiters](./docs/rules/no-invalid-test-waiters.md) | disallow incorrect usage of test waiter APIs |
 | :white_check_mark: | [no-legacy-test-waiters](./docs/rules/no-legacy-test-waiters.md) | disallow the use of the legacy test waiter APIs |
-| :wrench: | [no-noop-setup-on-error-in-before](./docs/rules/no-noop-setup-on-error-in-before.md) | disallows using no-op setupOnerror in `before` or `beforeEach` |
+| :white_check_mark::wrench: | [no-noop-setup-on-error-in-before](./docs/rules/no-noop-setup-on-error-in-before.md) | disallows using no-op setupOnerror in `before` or `beforeEach` |
 | :white_check_mark: | [no-pause-test](./docs/rules/no-pause-test.md) | disallow usage of the `pauseTest` helper in tests |
 |  | [no-replace-test-comments](./docs/rules/no-replace-test-comments.md) | disallow 'Replace this with your real tests' comments in test files |
 | :white_check_mark: | [no-restricted-resolver-tests](./docs/rules/no-restricted-resolver-tests.md) | disallow the use of patterns that use the restricted resolver in tests |
 | :white_check_mark: | [no-test-and-then](./docs/rules/no-test-and-then.md) | disallow usage of the `andThen` test wait helper |
 | :white_check_mark: | [no-test-import-export](./docs/rules/no-test-import-export.md) | disallow importing of "-test.js" in a test file and exporting from a test file |
 | :white_check_mark: | [no-test-module-for](./docs/rules/no-test-module-for.md) | disallow usage of `moduleFor`, `moduleForComponent`, etc |
-|  | [no-test-this-render](./docs/rules/no-test-this-render.md) | disallow usage of the `this.render` in tests, recommending to use @ember/test-helpers' `render` instead. |
-|  | [prefer-ember-test-helpers](./docs/rules/prefer-ember-test-helpers.md) | enforce usage of `@ember/test-helpers` methods over native window methods |
+| :white_check_mark: | [no-test-this-render](./docs/rules/no-test-this-render.md) | disallow usage of the `this.render` in tests, recommending to use @ember/test-helpers' `render` instead. |
+| :white_check_mark: | [prefer-ember-test-helpers](./docs/rules/prefer-ember-test-helpers.md) | enforce usage of `@ember/test-helpers` methods over native window methods |
 
 <!--RULES_TABLE_END-->
 
diff --git a/docs/rules/no-assignment-of-untracked-properties-used-in-tracking-contexts.md b/docs/rules/no-assignment-of-untracked-properties-used-in-tracking-contexts.md
index 9710c1ae..b86d41b6 100644
--- a/docs/rules/no-assignment-of-untracked-properties-used-in-tracking-contexts.md
+++ b/docs/rules/no-assignment-of-untracked-properties-used-in-tracking-contexts.md
@@ -1,5 +1,7 @@
 # no-assignment-of-untracked-properties-used-in-tracking-contexts
 
+:white_check_mark: The `"extends": "plugin:ember/recommended"` property in a configuration file enables this rule.
+
 :wrench: The `--fix` option on the [command line](https://eslint.org/docs/user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule.
 
 Ember 3.13 added an assertion that fires when using assignment `this.x = 123` on an untracked property that is used in a tracking context such as a computed property.
diff --git a/docs/rules/no-controller-access-in-routes.md b/docs/rules/no-controller-access-in-routes.md
index b883c701..182292c8 100644
--- a/docs/rules/no-controller-access-in-routes.md
+++ b/docs/rules/no-controller-access-in-routes.md
@@ -1,5 +1,7 @@
 # no-controller-access-in-routes
 
+:white_check_mark: The `"extends": "plugin:ember/recommended"` property in a configuration file enables this rule.
+
 Accessing the controller in a route outside of `setupController`/`resetController` hooks (where it is passed as an argument) is discouraged.
 
 If access is required regardless, `controllerFor` must be used to assert the controller isn't undefined as it is not guaranteed to be eagerly loaded (for optimization purposes).
diff --git a/docs/rules/no-noop-setup-on-error-in-before.md b/docs/rules/no-noop-setup-on-error-in-before.md
index 76d969d8..0d29fe2e 100644
--- a/docs/rules/no-noop-setup-on-error-in-before.md
+++ b/docs/rules/no-noop-setup-on-error-in-before.md
@@ -1,5 +1,7 @@
 # no-noop-setup-on-error-in-before
 
+:white_check_mark: The `"extends": "plugin:ember/recommended"` property in a configuration file enables this rule.
+
 :wrench: The `--fix` option on the [command line](https://eslint.org/docs/user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule.
 
 Disallows use of no-op `setupOnerror` in `before`/`beforeEach` since it could mask errors or rejections in tests unintentionally
diff --git a/lib/recommended-rules.js b/lib/recommended-rules.js
index c7268979..51e69236 100644
--- a/lib/recommended-rules.js
+++ b/lib/recommended-rules.js
@@ -11,9 +11,11 @@ module.exports = {
   "ember/jquery-ember-run": "error",
   "ember/new-module-imports": "error",
   "ember/no-arrow-function-computed-properties": "error",
+  "ember/no-assignment-of-untracked-properties-used-in-tracking-contexts": "error",
   "ember/no-attrs-in-components": "error",
   "ember/no-attrs-snapshot": "error",
   "ember/no-capital-letters-in-routes": "error",
+  "ember/no-controller-access-in-routes": "error",
   "ember/no-deeply-nested-dependent-keys-with-each": "error",
   "ember/no-duplicate-dependent-keys": "error",
   "ember/no-ember-super-in-es-classes": "error",
@@ -26,10 +28,12 @@ module.exports = {
   "ember/no-incorrect-computed-macros": "error",
   "ember/no-invalid-debug-function-arguments": "error",
   "ember/no-invalid-dependent-keys": "error",
+  "ember/no-invalid-test-waiters": "error",
   "ember/no-jquery": "error",
   "ember/no-legacy-test-waiters": "error",
   "ember/no-mixins": "error",
   "ember/no-new-mixins": "error",
+  "ember/no-noop-setup-on-error-in-before": "error",
   "ember/no-observers": "error",
   "ember/no-old-shims": "error",
   "ember/no-on-calls-in-components": "error",
@@ -40,8 +44,10 @@ module.exports = {
   "ember/no-test-and-then": "error",
   "ember/no-test-import-export": "error",
   "ember/no-test-module-for": "error",
+  "ember/no-test-this-render": "error",
   "ember/no-unnecessary-route-path-option": "error",
   "ember/no-volatile-computed-properties": "error",
+  "ember/prefer-ember-test-helpers": "error",
   "ember/require-computed-macros": "error",
   "ember/require-computed-property-dependencies": "error",
   "ember/require-return-from-computed": "error",
diff --git a/lib/rules/no-assignment-of-untracked-properties-used-in-tracking-contexts.js b/lib/rules/no-assignment-of-untracked-properties-used-in-tracking-contexts.js
index 6efad4e6..2350d483 100644
--- a/lib/rules/no-assignment-of-untracked-properties-used-in-tracking-contexts.js
+++ b/lib/rules/no-assignment-of-untracked-properties-used-in-tracking-contexts.js
@@ -90,7 +90,7 @@ module.exports = {
       description:
         'disallow assignment of untracked properties that are used as computed property dependencies',
       category: 'Computed Properties',
-      recommended: false,
+      recommended: true,
       url:
         'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-assignment-of-untracked-properties-used-in-tracking-contexts.md',
     },
diff --git a/lib/rules/no-controller-access-in-routes.js b/lib/rules/no-controller-access-in-routes.js
index 839ef556..deaf4e48 100644
--- a/lib/rules/no-controller-access-in-routes.js
+++ b/lib/rules/no-controller-access-in-routes.js
@@ -18,7 +18,7 @@ module.exports = {
       description:
         'disallow routes from accessing the controller outside of setupController/resetController',
       category: 'Routes',
-      recommended: false,
+      recommended: true,
       url:
         'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-controller-access-in-routes.md',
     },
diff --git a/lib/rules/no-noop-setup-on-error-in-before.js b/lib/rules/no-noop-setup-on-error-in-before.js
index 1b410fcf..bcd4c1e5 100644
--- a/lib/rules/no-noop-setup-on-error-in-before.js
+++ b/lib/rules/no-noop-setup-on-error-in-before.js
@@ -13,7 +13,7 @@ module.exports = {
     docs: {
       description: 'disallows using no-op setupOnerror in `before` or `beforeEach`',
       category: 'Testing',
-      recommended: false,
+      recommended: true,
       url:
         'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-noop-setup-on-error-in-before.md',
     },


Test patch:
diff --git a/docs/rules/no-invalid-test-waiters.md b/docs/rules/no-invalid-test-waiters.md
index aaf9f8ab..2b1ace60 100644
--- a/docs/rules/no-invalid-test-waiters.md
+++ b/docs/rules/no-invalid-test-waiters.md
@@ -1,5 +1,7 @@
 # no-invalid-test-waiters
 
+:white_check_mark: The `"extends": "plugin:ember/recommended"` property in a configuration file enables this rule.
+
 Prevents invalid usage of test waiters.
 
 ## Rule Details
diff --git a/docs/rules/no-test-this-render.md b/docs/rules/no-test-this-render.md
index b1e16b0d..86a472d7 100644
--- a/docs/rules/no-test-this-render.md
+++ b/docs/rules/no-test-this-render.md
@@ -1,5 +1,7 @@
 # no-test-this-render
 
+:white_check_mark: The `"extends": "plugin:ember/recommended"` property in a configuration file enables this rule.
+
 Ember's `this.render`/`this.clearRender` method and [`@ember/test-helpers`](https://github.com/emberjs/ember-test-helpers)'s `render`/`clearRender` method are equivalent, but using `@ember/test-helpers`' `render`/`clearRender` method is the recommended approach.
 
 ## Rule Details
diff --git a/docs/rules/prefer-ember-test-helpers.md b/docs/rules/prefer-ember-test-helpers.md
index 4b592110..91cf5eb8 100644
--- a/docs/rules/prefer-ember-test-helpers.md
+++ b/docs/rules/prefer-ember-test-helpers.md
@@ -1,5 +1,7 @@
 # prefer-ember-test-helpers
 
+:white_check_mark: The `"extends": "plugin:ember/recommended"` property in a configuration file enables this rule.
+
 This rule ensures the correct Ember test helper is imported when using methods that have a native window counterpart.
 
 There are currently 3 Ember test helper methods that have a native window counterpart:
diff --git a/lib/rules/no-invalid-test-waiters.js b/lib/rules/no-invalid-test-waiters.js
index ba95b7f0..08297666 100644
--- a/lib/rules/no-invalid-test-waiters.js
+++ b/lib/rules/no-invalid-test-waiters.js
@@ -26,7 +26,7 @@ module.exports = {
     docs: {
       description: 'disallow incorrect usage of test waiter APIs',
       category: 'Testing',
-      recommended: false,
+      recommended: true,
       url:
         'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-invalid-test-waiters.md',
     },
diff --git a/lib/rules/no-test-this-render.js b/lib/rules/no-test-this-render.js
index 82366923..2ad386b6 100644
--- a/lib/rules/no-test-this-render.js
+++ b/lib/rules/no-test-this-render.js
@@ -18,6 +18,7 @@ module.exports = {
       description:
         "disallow usage of the `this.render` in tests, recommending to use @ember/test-helpers' `render` instead.",
       category: 'Testing',
+      recommended: true,
       url:
         'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-test-this-render.md',
     },
diff --git a/lib/rules/prefer-ember-test-helpers.js b/lib/rules/prefer-ember-test-helpers.js
index 9a117159..5902ff22 100644
--- a/lib/rules/prefer-ember-test-helpers.js
+++ b/lib/rules/prefer-ember-test-helpers.js
@@ -37,7 +37,7 @@ module.exports = {
     docs: {
       description: 'enforce usage of `@ember/test-helpers` methods over native window methods',
       category: 'Testing',
-      recommended: false,
+      recommended: true,
       url:
         'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/prefer-ember-test-helpers.md',
     },
diff --git a/tests/__snapshots__/recommended.js.snap b/tests/__snapshots__/recommended.js.snap
index eb5db219..8e900bc9 100644
--- a/tests/__snapshots__/recommended.js.snap
+++ b/tests/__snapshots__/recommended.js.snap
@@ -8,9 +8,11 @@ Array [
   "jquery-ember-run",
   "new-module-imports",
   "no-arrow-function-computed-properties",
+  "no-assignment-of-untracked-properties-used-in-tracking-contexts",
   "no-attrs-in-components",
   "no-attrs-snapshot",
   "no-capital-letters-in-routes",
+  "no-controller-access-in-routes",
   "no-deeply-nested-dependent-keys-with-each",
   "no-duplicate-dependent-keys",
   "no-ember-super-in-es-classes",
@@ -23,10 +25,12 @@ Array [
   "no-incorrect-computed-macros",
   "no-invalid-debug-function-arguments",
   "no-invalid-dependent-keys",
+  "no-invalid-test-waiters",
   "no-jquery",
   "no-legacy-test-waiters",
   "no-mixins",
   "no-new-mixins",
+  "no-noop-setup-on-error-in-before",
   "no-observers",
   "no-old-shims",
   "no-on-calls-in-components",
@@ -37,8 +41,10 @@ Array [
   "no-test-and-then",
   "no-test-import-export",
   "no-test-module-for",
+  "no-test-this-render",
   "no-unnecessary-route-path-option",
   "no-volatile-computed-properties",
+  "prefer-ember-test-helpers",
   "require-computed-macros",
   "require-computed-property-dependencies",
   "require-return-from-computed",