Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ Rules are grouped by category to help you understand their purpose. Each rule ha
| :white_check_mark: | [no-new-mixins](./docs/rules/no-new-mixins.md) | disallow the creation of new mixins |
| :white_check_mark: | [no-observers](./docs/rules/no-observers.md) | disallow usage of observers |
| :white_check_mark::wrench: | [no-old-shims](./docs/rules/no-old-shims.md) | disallow usage of old shims for modules |
| | [no-string-prototype-extensions](./docs/rules/no-string-prototype-extensions.md) | disallow usage of `String` prototype extensions |
| :white_check_mark: | [no-string-prototype-extensions](./docs/rules/no-string-prototype-extensions.md) | disallow usage of `String` prototype extensions |

### Ember Data

Expand All @@ -125,7 +125,7 @@ Rules are grouped by category to help you understand their purpose. Each rule ha
| :white_check_mark::wrench: | [no-get-with-default](./docs/rules/no-get-with-default.md) | disallow usage of the Ember's `getWithDefault` function |
| :white_check_mark::wrench: | [no-get](./docs/rules/no-get.md) | require using ES5 getters instead of Ember's `get` / `getProperties` functions |
| | [no-proxies](./docs/rules/no-proxies.md) | disallow using array or object proxies |
| | [no-try-invoke](./docs/rules/no-try-invoke.md) | disallow usage of the Ember's `tryInvoke` util |
| :white_check_mark: | [no-try-invoke](./docs/rules/no-try-invoke.md) | disallow usage of the Ember's `tryInvoke` util |
| :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 |
| :wrench: | [use-ember-get-and-set](./docs/rules/use-ember-get-and-set.md) | enforce usage of `Ember.get` and `Ember.set` |

Expand All @@ -138,7 +138,7 @@ Rules are grouped by category to help you understand their purpose. Each rule ha
| :car: | [no-actions-hash](./docs/rules/no-actions-hash.md) | disallow the actions hash in components, controllers, and routes |
| :car: | [no-classic-classes](./docs/rules/no-classic-classes.md) | disallow "classic" classes in favor of native JS classes |
| :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 |
| | [no-empty-glimmer-component-classes](./docs/rules/no-empty-glimmer-component-classes.md) | disallow empty backing classes for Glimmer components |
| :white_check_mark: | [no-empty-glimmer-component-classes](./docs/rules/no-empty-glimmer-component-classes.md) | disallow empty backing classes for Glimmer components |

### jQuery

Expand All @@ -164,7 +164,7 @@ Rules are grouped by category to help you understand their purpose. Each rule ha
| :white_check_mark: | [no-capital-letters-in-routes](./docs/rules/no-capital-letters-in-routes.md) | disallow routes with uppercased letters in router.js |
| :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-shadow-route-definition](./docs/rules/no-shadow-route-definition.md) | enforce no route path definition shadowing |
| :white_check_mark: | [no-shadow-route-definition](./docs/rules/no-shadow-route-definition.md) | enforce no route path definition shadowing |
| | [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 |
| | [route-path-style](./docs/rules/route-path-style.md) | enforce usage of kebab-case (instead of snake_case or camelCase) in route paths |
Expand All @@ -191,14 +191,14 @@ Rules are grouped by category to help you understand their purpose. Each rule ha
| :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 |
| :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 |
| :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 |
| :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-support-import](./docs/rules/no-test-support-import.md) | disallow importing of "test-support" files in production code. |
| :white_check_mark: | [no-test-support-import](./docs/rules/no-test-support-import.md) | disallow importing of "test-support" files in production code. |
| :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 |
| :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 |
| :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 |

<!--RULES_TABLE_END-->

Expand Down
2 changes: 2 additions & 0 deletions docs/rules/no-empty-glimmer-component-classes.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# no-empty-glimmer-component-classes

:white_check_mark: The `"extends": "plugin:ember/recommended"` property in a configuration file enables this rule.

This rule will catch and prevent the use of empty backing classes for Glimmer components.

## Rule Details
Expand Down
2 changes: 2 additions & 0 deletions docs/rules/no-settled-after-test-helper.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# no-settled-after-test-helper

: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.

Most of the test helper functions in
Expand Down
2 changes: 2 additions & 0 deletions docs/rules/no-shadow-route-definition.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# no-shadow-route-definition

:white_check_mark: The `"extends": "plugin:ember/recommended"` property in a configuration file enables this rule.

Enforce no route path definition shadowing in Router.

## Rule Details
Expand Down
2 changes: 2 additions & 0 deletions docs/rules/no-string-prototype-extensions.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# no-string-prototype-extensions

:white_check_mark: The `"extends": "plugin:ember/recommended"` property in a configuration file enables this rule.

Ember by default extends certain native JavaScript objects with additional
methods. This can lead to problems in certain situations. One example is relying
on these methods in addons, but that addon being used in an app that has the
Expand Down
2 changes: 2 additions & 0 deletions docs/rules/no-test-support-import.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# no-test-support-import

:white_check_mark: The `"extends": "plugin:ember/recommended"` property in a configuration file enables this rule.

No importing of test support files into non-test code..

**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.
Expand Down
2 changes: 2 additions & 0 deletions docs/rules/no-try-invoke.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# no-try-invoke

:white_check_mark: The `"extends": "plugin:ember/recommended"` property in a configuration file enables this rule.

This rule will catch and prevent the use of `tryInvoke`.

## Rule Details
Expand Down
2 changes: 2 additions & 0 deletions docs/rules/require-valid-css-selector-in-test-helpers.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# require-valid-css-selector-in-test-helpers

: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.

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.
Expand Down
7 changes: 7 additions & 0 deletions lib/recommended-rules.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ module.exports = {
"ember/no-duplicate-dependent-keys": "error",
"ember/no-ember-super-in-es-classes": "error",
"ember/no-ember-testing-in-module-scope": "error",
"ember/no-empty-glimmer-component-classes": "error",
"ember/no-function-prototype-extensions": "error",
"ember/no-get-with-default": "error",
"ember/no-get": "error",
Expand All @@ -40,18 +41,24 @@ module.exports = {
"ember/no-pause-test": "error",
"ember/no-private-routing-service": "error",
"ember/no-restricted-resolver-tests": "error",
"ember/no-settled-after-test-helper": "error",
"ember/no-shadow-route-definition": "error",
"ember/no-side-effects": "error",
"ember/no-string-prototype-extensions": "error",
"ember/no-test-and-then": "error",
"ember/no-test-import-export": "error",
"ember/no-test-module-for": "error",
"ember/no-test-support-import": "error",
"ember/no-test-this-render": "error",
"ember/no-try-invoke": "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",
"ember/require-super-in-lifecycle-hooks": "error",
"ember/require-valid-css-selector-in-test-helpers": "error",
"ember/routes-segments-snake-case": "error",
"ember/use-brace-expansion": "error",
"ember/use-ember-data-rfc-395-imports": "error"
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/no-empty-glimmer-component-classes.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module.exports = {
docs: {
description: 'disallow empty backing classes for Glimmer components',
category: 'Ember Octane',
recommended: false,
recommended: true,
url:
'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-empty-glimmer-component-classes.md',
},
Expand Down
1 change: 1 addition & 0 deletions lib/rules/no-settled-after-test-helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ module.exports = {
description:
'disallow usage of `await settled()` right after test helper that calls it internally',
category: 'Testing',
recommended: true,
url:
'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-settled-after-test-helper.md',
},
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/no-shadow-route-definition.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ module.exports = {
docs: {
description: 'enforce no route path definition shadowing',
category: 'Routes',
recommended: false,
recommended: true,
url:
'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-shadow-route-definition.md',
},
Expand Down
1 change: 1 addition & 0 deletions lib/rules/no-string-prototype-extensions.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ module.exports = {
docs: {
description: 'disallow usage of `String` prototype extensions',
category: 'Deprecations',
recommended: true,
url:
'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-string-prototype-extensions.md',
},
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/no-test-support-import.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ module.exports = {
docs: {
description: 'disallow importing of "test-support" files in production code.',
category: 'Testing',
recommended: false,
recommended: true,
url:
'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-test-support-import.md',
},
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/no-try-invoke.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ module.exports = {
docs: {
description: "disallow usage of the Ember's `tryInvoke` util",
category: 'Ember Object',
recommended: false,
recommended: true,
url:
'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-try-invoke.md',
},
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/require-valid-css-selector-in-test-helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ module.exports = {
docs: {
description: 'disallow using invalid CSS selectors in test helpers',
category: 'Testing',
recommended: false,
recommended: true,
url:
'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/require-valid-css-selector-in-test-helpers.md',
},
Expand Down
7 changes: 7 additions & 0 deletions tests/__snapshots__/recommended.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Array [
"no-duplicate-dependent-keys",
"no-ember-super-in-es-classes",
"no-ember-testing-in-module-scope",
"no-empty-glimmer-component-classes",
"no-function-prototype-extensions",
"no-get-with-default",
"no-get",
Expand All @@ -37,18 +38,24 @@ Array [
"no-pause-test",
"no-private-routing-service",
"no-restricted-resolver-tests",
"no-settled-after-test-helper",
"no-shadow-route-definition",
"no-side-effects",
"no-string-prototype-extensions",
"no-test-and-then",
"no-test-import-export",
"no-test-module-for",
"no-test-support-import",
"no-test-this-render",
"no-try-invoke",
"no-unnecessary-route-path-option",
"no-volatile-computed-properties",
"prefer-ember-test-helpers",
"require-computed-macros",
"require-computed-property-dependencies",
"require-return-from-computed",
"require-super-in-lifecycle-hooks",
"require-valid-css-selector-in-test-helpers",
"routes-segments-snake-case",
"use-brace-expansion",
"use-ember-data-rfc-395-imports",
Expand Down