Skip to content

Commit 0bab8a0

Browse files
committed
feat: enable more recommended rules for v10
1 parent 442acca commit 0bab8a0

17 files changed

+42
-12
lines changed

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ Rules are grouped by category to help you understand their purpose. Each rule ha
108108
| :white_check_mark: | [no-new-mixins](./docs/rules/no-new-mixins.md) | disallow the creation of new mixins |
109109
| :white_check_mark: | [no-observers](./docs/rules/no-observers.md) | disallow usage of observers |
110110
| :white_check_mark::wrench: | [no-old-shims](./docs/rules/no-old-shims.md) | disallow usage of old shims for modules |
111-
| | [no-string-prototype-extensions](./docs/rules/no-string-prototype-extensions.md) | disallow usage of `String` prototype extensions |
111+
| :white_check_mark: | [no-string-prototype-extensions](./docs/rules/no-string-prototype-extensions.md) | disallow usage of `String` prototype extensions |
112112

113113
### Ember Data
114114

@@ -125,7 +125,7 @@ Rules are grouped by category to help you understand their purpose. Each rule ha
125125
| :white_check_mark::wrench: | [no-get-with-default](./docs/rules/no-get-with-default.md) | disallow usage of the Ember's `getWithDefault` function |
126126
| :white_check_mark::wrench: | [no-get](./docs/rules/no-get.md) | require using ES5 getters instead of Ember's `get` / `getProperties` functions |
127127
| | [no-proxies](./docs/rules/no-proxies.md) | disallow using array or object proxies |
128-
| | [no-try-invoke](./docs/rules/no-try-invoke.md) | disallow usage of the Ember's `tryInvoke` util |
128+
| :white_check_mark: | [no-try-invoke](./docs/rules/no-try-invoke.md) | disallow usage of the Ember's `tryInvoke` util |
129129
| :white_check_mark::wrench: | [require-super-in-lifecycle-hooks](./docs/rules/require-super-in-lifecycle-hooks.md) | require super to be called in lifecycle hooks |
130130
| :wrench: | [use-ember-get-and-set](./docs/rules/use-ember-get-and-set.md) | enforce usage of `Ember.get` and `Ember.set` |
131131

@@ -138,7 +138,7 @@ Rules are grouped by category to help you understand their purpose. Each rule ha
138138
| :car: | [no-actions-hash](./docs/rules/no-actions-hash.md) | disallow the actions hash in components, controllers, and routes |
139139
| :car: | [no-classic-classes](./docs/rules/no-classic-classes.md) | disallow "classic" classes in favor of native JS classes |
140140
| :white_check_mark::wrench: | [no-ember-super-in-es-classes](./docs/rules/no-ember-super-in-es-classes.md) | disallow use of `this._super` in ES class methods |
141-
| | [no-empty-glimmer-component-classes](./docs/rules/no-empty-glimmer-component-classes.md) | disallow empty backing classes for Glimmer components |
141+
| :white_check_mark: | [no-empty-glimmer-component-classes](./docs/rules/no-empty-glimmer-component-classes.md) | disallow empty backing classes for Glimmer components |
142142

143143
### jQuery
144144

@@ -164,7 +164,7 @@ Rules are grouped by category to help you understand their purpose. Each rule ha
164164
| :white_check_mark: | [no-capital-letters-in-routes](./docs/rules/no-capital-letters-in-routes.md) | disallow routes with uppercased letters in router.js |
165165
| :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 |
166166
| :white_check_mark: | [no-private-routing-service](./docs/rules/no-private-routing-service.md) | disallow injecting the private routing service |
167-
| | [no-shadow-route-definition](./docs/rules/no-shadow-route-definition.md) | enforce no route path definition shadowing |
167+
| :white_check_mark: | [no-shadow-route-definition](./docs/rules/no-shadow-route-definition.md) | enforce no route path definition shadowing |
168168
| | [no-unnecessary-index-route](./docs/rules/no-unnecessary-index-route.md) | disallow unnecessary `index` route definition |
169169
| :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 |
170170
| | [route-path-style](./docs/rules/route-path-style.md) | enforce usage of kebab-case (instead of snake_case or camelCase) in route paths |
@@ -191,14 +191,14 @@ Rules are grouped by category to help you understand their purpose. Each rule ha
191191
| :white_check_mark: | [no-pause-test](./docs/rules/no-pause-test.md) | disallow usage of the `pauseTest` helper in tests |
192192
| | [no-replace-test-comments](./docs/rules/no-replace-test-comments.md) | disallow 'Replace this with your real tests' comments in test files |
193193
| :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 |
194-
| :wrench: | [no-settled-after-test-helper](./docs/rules/no-settled-after-test-helper.md) | disallow usage of `await settled()` right after test helper that calls it internally |
194+
| :white_check_mark::wrench: | [no-settled-after-test-helper](./docs/rules/no-settled-after-test-helper.md) | disallow usage of `await settled()` right after test helper that calls it internally |
195195
| :white_check_mark: | [no-test-and-then](./docs/rules/no-test-and-then.md) | disallow usage of the `andThen` test wait helper |
196196
| :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 |
197197
| :white_check_mark: | [no-test-module-for](./docs/rules/no-test-module-for.md) | disallow usage of `moduleFor`, `moduleForComponent`, etc |
198-
| | [no-test-support-import](./docs/rules/no-test-support-import.md) | disallow importing of "test-support" files in production code. |
198+
| :white_check_mark: | [no-test-support-import](./docs/rules/no-test-support-import.md) | disallow importing of "test-support" files in production code. |
199199
| :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. |
200200
| :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 |
201-
| :wrench: | [require-valid-css-selector-in-test-helpers](./docs/rules/require-valid-css-selector-in-test-helpers.md) | disallow using invalid CSS selectors in test helpers |
201+
| :white_check_mark::wrench: | [require-valid-css-selector-in-test-helpers](./docs/rules/require-valid-css-selector-in-test-helpers.md) | disallow using invalid CSS selectors in test helpers |
202202

203203
<!--RULES_TABLE_END-->
204204

docs/rules/no-empty-glimmer-component-classes.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# no-empty-glimmer-component-classes
22

3+
:white_check_mark: The `"extends": "plugin:ember/recommended"` property in a configuration file enables this rule.
4+
35
This rule will catch and prevent the use of empty backing classes for Glimmer components.
46

57
## Rule Details

docs/rules/no-settled-after-test-helper.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# no-settled-after-test-helper
22

3+
:white_check_mark: The `"extends": "plugin:ember/recommended"` property in a configuration file enables this rule.
4+
35
: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.
46

57
Most of the test helper functions in

docs/rules/no-shadow-route-definition.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# no-shadow-route-definition
22

3+
:white_check_mark: The `"extends": "plugin:ember/recommended"` property in a configuration file enables this rule.
4+
35
Enforce no route path definition shadowing in Router.
46

57
## Rule Details

docs/rules/no-string-prototype-extensions.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# no-string-prototype-extensions
22

3+
:white_check_mark: The `"extends": "plugin:ember/recommended"` property in a configuration file enables this rule.
4+
35
Ember by default extends certain native JavaScript objects with additional
46
methods. This can lead to problems in certain situations. One example is relying
57
on these methods in addons, but that addon being used in an app that has the

docs/rules/no-test-support-import.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# no-test-support-import
22

3+
:white_check_mark: The `"extends": "plugin:ember/recommended"` property in a configuration file enables this rule.
4+
35
No importing of test support files into non-test code..
46

57
**TL;DR** Do not import from a file located in addon-test-support into non-test code. Doing so will result in production errors that are not capable of being caught in tests as require statements are available in tests but not on production builds.

docs/rules/no-try-invoke.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# no-try-invoke
22

3+
:white_check_mark: The `"extends": "plugin:ember/recommended"` property in a configuration file enables this rule.
4+
35
This rule will catch and prevent the use of `tryInvoke`.
46

57
## Rule Details

docs/rules/require-valid-css-selector-in-test-helpers.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# require-valid-css-selector-in-test-helpers
22

3+
:white_check_mark: The `"extends": "plugin:ember/recommended"` property in a configuration file enables this rule.
4+
35
: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.
46

57
Test helpers and querySelector methods should be called with valid CSS selectors. Most of the time invalid selectors will result in a failing test but that is not always the case.

lib/recommended-rules.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ module.exports = {
2020
"ember/no-duplicate-dependent-keys": "error",
2121
"ember/no-ember-super-in-es-classes": "error",
2222
"ember/no-ember-testing-in-module-scope": "error",
23+
"ember/no-empty-glimmer-component-classes": "error",
2324
"ember/no-function-prototype-extensions": "error",
2425
"ember/no-get-with-default": "error",
2526
"ember/no-get": "error",
@@ -40,18 +41,24 @@ module.exports = {
4041
"ember/no-pause-test": "error",
4142
"ember/no-private-routing-service": "error",
4243
"ember/no-restricted-resolver-tests": "error",
44+
"ember/no-settled-after-test-helper": "error",
45+
"ember/no-shadow-route-definition": "error",
4346
"ember/no-side-effects": "error",
47+
"ember/no-string-prototype-extensions": "error",
4448
"ember/no-test-and-then": "error",
4549
"ember/no-test-import-export": "error",
4650
"ember/no-test-module-for": "error",
51+
"ember/no-test-support-import": "error",
4752
"ember/no-test-this-render": "error",
53+
"ember/no-try-invoke": "error",
4854
"ember/no-unnecessary-route-path-option": "error",
4955
"ember/no-volatile-computed-properties": "error",
5056
"ember/prefer-ember-test-helpers": "error",
5157
"ember/require-computed-macros": "error",
5258
"ember/require-computed-property-dependencies": "error",
5359
"ember/require-return-from-computed": "error",
5460
"ember/require-super-in-lifecycle-hooks": "error",
61+
"ember/require-valid-css-selector-in-test-helpers": "error",
5562
"ember/routes-segments-snake-case": "error",
5663
"ember/use-brace-expansion": "error",
5764
"ember/use-ember-data-rfc-395-imports": "error"

lib/rules/no-empty-glimmer-component-classes.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ module.exports = {
1414
docs: {
1515
description: 'disallow empty backing classes for Glimmer components',
1616
category: 'Ember Octane',
17-
recommended: false,
17+
recommended: true,
1818
url:
1919
'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-empty-glimmer-component-classes.md',
2020
},

0 commit comments

Comments
 (0)