eslint-plugin-ember
Version:
ESLint plugin for Ember.js apps
486 lines (412 loc) โข 67 kB
Markdown
# eslint-plugin-ember
[](https://npmjs.org/package/eslint-plugin-ember)
[](https://npmjs.org/package/eslint-plugin-ember)

> An ESLint plugin that provides a set of rules for Ember applications based on commonly known good practices.
## โ๏ธRequirements
- [ESLint](https://eslint.org/) `>= 8.40.0`
- [Node.js](https://nodejs.org/) `>= 20.19`
## ๐ Usage
### 1. Install plugin
```shell
npm install --save-dev eslint-plugin-ember
```
### 2. Update your config
```js
// eslint.config.js (flat config)
const eslintPluginEmberRecommended = require('eslint-plugin-ember/configs/recommended');
module.exports = [
...eslintPluginEmberRecommended,
];
```
or
```js
// .eslintrc.js (legacy config)
module.exports = {
plugins: ['ember'],
extends: [
'eslint:recommended',
'plugin:ember/recommended' // or other configuration
],
rules: {
// override / enable optional rules
'ember/no-replace-test-comments': 'error'
}
};
```
## gts/gjs
lint files having `First-Class Component Templates` (fcct)
learn more at [ember-template-imports](https://github.com/ember-template-imports/ember-template-imports)
> [!NOTE]
> special care should be used when setting up parsers, since they cannot be overwritten. thus they should be used in override only and specific to file types
gjs/gts support is provided by the [ember-eslint-parser](https://github.com/NullVoxPopuli/ember-eslint-parser)
> [!NOTE]
> if you import .gts files in .ts files, then `ember-eslint-parser` is required for .ts as well to enable typed linting
```js
// .eslintrc.js
module.exports = {
overrides: [
{
files: ['**/*.{js,ts}'],
plugins: ['ember'],
parser: '@typescript-eslint/parser',
extends: [
'eslint:recommended',
'plugin:ember/recommended', // or other configuration
],
rules: {
// override / enable optional rules
'ember/no-replace-test-comments': 'error'
}
},
{
files: ['**/*.gts'],
parser: 'ember-eslint-parser',
plugins: ['ember'],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:ember/recommended',
'plugin:ember/recommended-gts',
],
},
{
files: ['**/*.gjs'],
parser: 'ember-eslint-parser',
plugins: ['ember'],
extends: [
'eslint:recommended',
'plugin:ember/recommended',
'plugin:ember/recommended-gjs',
],
},
{
files: ['tests/**/*.{js,ts,gjs,gts}'],
rules: {
// override / enable optional rules
'ember/no-replace-test-comments': 'error'
}
},
],
};
```
### rules applied to fcct templates
- semi rule, same as [prettier plugin](https://github.com/gitKrystan/prettier-plugin-ember-template-tag/issues/1)
- no-undef rule will take effect for template vars (includes js scope)
- no-unused rule will take effect for template block params
rules in templates can be disabled with eslint directives with mustache or html comments:
```hbs
<template>
<div>
{{!eslint-disable-next-line}}
{{test}}
</div>
<div>
{{!--eslint-disable--}}
{{test}}
{{test}}
{{test}}
{{!--eslint-enable--}}
</div>
</template>
```
```hbs
<template>
<div>
<!--eslint-disable-next-line-->
{{test}}
</div>
<div>
<!-- eslint-disable -->
{{test}}
{{test}}
{{test}}
<!-- eslint-enable -->
</div>
</template>
```
## Migrating from ember-template-lint
If you are replacing `ember-template-lint` with this plugin, use the `template-lint-migration` config to get the equivalent set of rules:
```js
// eslint.config.js (flat config)
import eslintPluginEmberRecommended from 'eslint-plugin-ember/configs/recommended';
import eslintPluginEmberTemplateLintMigration from 'eslint-plugin-ember/configs/template-lint-migration';
export default [
...eslintPluginEmberRecommended,
...eslintPluginEmberTemplateLintMigration,
{
rules: {
// Migrate custom overrides from your .template-lintrc.*:
'ember/template-no-bare-strings': ['error', { allowlist: ['ร'] }],
'ember/template-no-inline-styles': 'off',
},
},
];
```
`template-lint-migration` mirrors the ember-template-lint `recommended` preset.
### Linting `.hbs` files
ESLint flat config only picks up `.hbs` files when a `files` glob names them. Add a dedicated block so they route to the Handlebars parser:
```js
// eslint.config.mjs
import { hbsParser, plugin as emberPlugin } from 'eslint-plugin-ember/recommended';
export default [
// ...other blocks...
{
files: ['app/**/*.hbs'],
languageOptions: { parser: hbsParser },
plugins: { ember: emberPlugin },
rules: {
'ember/template-no-bare-strings': 'error',
// ...other template rules...
},
},
];
```
Make sure no earlier `@typescript-eslint/parser` block's `files` glob reaches `.hbs` โ narrow it to `['**/*.{js,ts,gjs,gts}']` (or similar). Flat config merges rules across every matching block, so even if our HBS block overrides the parser, type-info rules from a matching TS block still layer on and fail with errors like:
> Parsing error: `โฆ` was not found by the project service because the extension for the file (`.hbs`) is non-standard.
or
> Error while loading rule `@typescript-eslint/await-thenable`: You have used a rule which requires type information.
### Replacing `template-lint-disable` comments
Inline disable directives need to be rewritten to ESLint's syntax, prefixed with `ember/template-`. For now, only two scopes are supported: the next line, or the rest of the file. For example, replace:
```hbs
{{!template-lint-disable no-invalid-role}}
```
with:
```hbs
{{!eslint-disable-next-line ember/template-no-invalid-role}}
```
To disable a rule for an entire `.gjs`/`.gts` file, use a regular ESLint file-level directive in the JS region โ it applies to the `<template>` contents as well:
```gjs
/* eslint-disable ember/template-no-invalid-role */
<template>
<div role="range"></div>
</template>
```
## ๐งฐ Configurations
<!-- begin auto-generated configs list -->
| | Name |
| :------------------------------ | :------------------------ |
| | `base` |
| โ
| `recommended` |
|  | `recommended-gjs` |
|  | `recommended-gts` |
| ๐ | `template-lint-migration` |
<!-- end auto-generated configs list -->
## ๐ Rules
<!-- begin auto-generated rules list -->
๐ผ [Configurations](https://github.com/ember-cli/eslint-plugin-ember#-configurations) enabled in.\
โ
Set in the `recommended` [configuration](https://github.com/ember-cli/eslint-plugin-ember#-configurations).\
 Set in the `recommended-gjs` [configuration](https://github.com/ember-cli/eslint-plugin-ember#-configurations).\
 Set in the `recommended-gts` [configuration](https://github.com/ember-cli/eslint-plugin-ember#-configurations).\
๐ Set in the `template-lint-migration` [configuration](https://github.com/ember-cli/eslint-plugin-ember#-configurations).\
๐ง Automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/user-guide/command-line-interface#--fix).\
๐ก Manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions).
### Accessibility
| Nameย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย | Description | ๐ผ | ๐ง | ๐ก |
| :--------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------- | :- | :- | :- |
| [template-link-href-attributes](docs/rules/template-link-href-attributes.md) | require href attribute on link elements | ๐ | | |
| [template-no-abstract-roles](docs/rules/template-no-abstract-roles.md) | disallow abstract ARIA roles | ๐ | | |
| [template-no-accesskey-attribute](docs/rules/template-no-accesskey-attribute.md) | disallow accesskey attribute | ๐ | ๐ง | |
| [template-no-aria-hidden-body](docs/rules/template-no-aria-hidden-body.md) | disallow aria-hidden on body element | ๐ | ๐ง | |
| [template-no-aria-unsupported-elements](docs/rules/template-no-aria-unsupported-elements.md) | disallow ARIA roles, states, and properties on elements that do not support them | ๐ | | |
| [template-no-autofocus-attribute](docs/rules/template-no-autofocus-attribute.md) | disallow autofocus attribute | ๐ | ๐ง | |
| [template-no-duplicate-landmark-elements](docs/rules/template-no-duplicate-landmark-elements.md) | disallow duplicate landmark elements without unique labels | ๐ | | |
| [template-no-empty-headings](docs/rules/template-no-empty-headings.md) | disallow empty heading elements | ๐ | | |
| [template-no-heading-inside-button](docs/rules/template-no-heading-inside-button.md) | disallow heading elements inside button elements | ๐ | | |
| [template-no-invalid-aria-attributes](docs/rules/template-no-invalid-aria-attributes.md) | disallow invalid aria-* attributes | ๐ | | |
| [template-no-invalid-interactive](docs/rules/template-no-invalid-interactive.md) | disallow non-interactive elements with interactive handlers | ๐ | | |
| [template-no-invalid-link-text](docs/rules/template-no-invalid-link-text.md) | disallow invalid or uninformative link text content | ๐ | | |
| [template-no-invalid-link-title](docs/rules/template-no-invalid-link-title.md) | disallow invalid title attributes on link elements | ๐ | | |
| [template-no-invalid-role](docs/rules/template-no-invalid-role.md) | disallow invalid ARIA roles | ๐ | | |
| [template-no-nested-interactive](docs/rules/template-no-nested-interactive.md) | disallow nested interactive elements | ๐ | | |
| [template-no-nested-landmark](docs/rules/template-no-nested-landmark.md) | disallow nested landmark elements | ๐ | | |
| [template-no-pointer-down-event-binding](docs/rules/template-no-pointer-down-event-binding.md) | disallow pointer down event bindings | ๐ | | |
| [template-no-positive-tabindex](docs/rules/template-no-positive-tabindex.md) | disallow positive tabindex values | ๐ | | |
| [template-no-redundant-role](docs/rules/template-no-redundant-role.md) | disallow redundant role attributes | ๐ | ๐ง | |
| [template-no-unsupported-role-attributes](docs/rules/template-no-unsupported-role-attributes.md) | disallow ARIA attributes that are not supported by the element role | ๐ | ๐ง | |
| [template-no-whitespace-within-word](docs/rules/template-no-whitespace-within-word.md) | disallow excess whitespace within words (e.g. "W e l c o m e") | ๐ | | |
| [template-require-aria-activedescendant-tabindex](docs/rules/template-require-aria-activedescendant-tabindex.md) | require non-interactive elements with aria-activedescendant to have tabindex | ๐ | ๐ง | |
| [template-require-context-role](docs/rules/template-require-context-role.md) | require ARIA roles to be used in appropriate context | ๐ | | |
| [template-require-iframe-title](docs/rules/template-require-iframe-title.md) | require iframe elements to have a title attribute | ๐ | | |
| [template-require-input-label](docs/rules/template-require-input-label.md) | require label for form input elements | ๐ | | |
| [template-require-lang-attribute](docs/rules/template-require-lang-attribute.md) | require lang attribute on html element | ๐ | | |
| [template-require-mandatory-role-attributes](docs/rules/template-require-mandatory-role-attributes.md) | require mandatory ARIA attributes for ARIA roles | ๐ | | |
| [template-require-media-caption](docs/rules/template-require-media-caption.md) | require captions for audio and video elements | ๐ | | |
| [template-require-presentational-children](docs/rules/template-require-presentational-children.md) | require presentational elements to only contain presentational children | ๐ | | |
| [template-require-valid-alt-text](docs/rules/template-require-valid-alt-text.md) | require valid alt text for images and other elements | ๐ | | |
| [template-require-valid-form-groups](docs/rules/template-require-valid-form-groups.md) | require grouped form controls to have fieldset/legend or WAI-ARIA group labeling | | | |
| [template-table-groups](docs/rules/template-table-groups.md) | require table elements to use table grouping elements | ๐ | | |
### Best Practices
| Nameย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย | Description | ๐ผ | ๐ง | ๐ก |
| :----------------------------------------------------------------------------------------------------------------- | :--------------------------------------------------------------------------- | :- | :- | :- |
| [template-builtin-component-arguments](docs/rules/template-builtin-component-arguments.md) | disallow setting certain attributes on builtin components | ๐ | | |
| [template-no-action-modifiers](docs/rules/template-no-action-modifiers.md) | disallow usage of {{action}} modifiers | | ๐ง | |
| [template-no-action-on-submit-button](docs/rules/template-no-action-on-submit-button.md) | disallow action attribute on submit buttons | ๐ | | |
| [template-no-args-paths](docs/rules/template-no-args-paths.md) | disallow args.foo paths in templates, use @foo instead | ๐ | ๐ง | |
| [template-no-arguments-for-html-elements](docs/rules/template-no-arguments-for-html-elements.md) | disallow @arguments on HTML elements | ๐ | | |
| [template-no-array-prototype-extensions](docs/rules/template-no-array-prototype-extensions.md) | disallow usage of Ember Array prototype extensions | ๐ | ๐ง | |
| [template-no-at-ember-render-modifiers](docs/rules/template-no-at-ember-render-modifiers.md) | disallow usage of @ember/render-modifiers | ๐ | | |
| [template-no-bare-strings](docs/rules/template-no-bare-strings.md) | disallow bare strings in templates (require translation/localization) | | | |
| [template-no-bare-yield](docs/rules/template-no-bare-yield.md) | disallow templates whose only meaningful content is a bare {{yield}} | | | |
| [template-no-block-params-for-html-elements](docs/rules/template-no-block-params-for-html-elements.md) | disallow block params on HTML elements | ๐ | | |
| [template-no-builtin-form-components](docs/rules/template-no-builtin-form-components.md) | disallow usage of built-in form components | ๐ | | |
| [template-no-capital-arguments](docs/rules/template-no-capital-arguments.md) | disallow capital arguments (use lowercase @arg instead of @Arg) | ๐ | | |
| [template-no-chained-this](docs/rules/template-no-chained-this.md) | disallow redundant `this.this` in templates | | ๐ง | |
| [template-no-class-bindings](docs/rules/template-no-class-bindings.md) | disallow passing classBinding or classNameBindings as arguments in templates | ๐ | | |
| [template-no-curly-component-invocation](docs/rules/template-no-curly-component-invocation.md) | disallow curly component invocation, use angle bracket syntax instead | ๐ | ๐ง | |
| [template-no-debugger](docs/rules/template-no-debugger.md) | disallow {{debugger}} in templates | ๐ | | |
| [template-no-duplicate-attributes](docs/rules/template-no-duplicate-attributes.md) | disallow duplicate attribute names in templates | ๐ | ๐ง | |
| [template-no-duplicate-id](docs/rules/template-no-duplicate-id.md) | disallow duplicate id attributes | ๐ | | |
| [template-no-dynamic-subexpression-invocations](docs/rules/template-no-dynamic-subexpression-invocations.md) | disallow dynamic subexpression invocations | | | |
| [template-no-element-event-actions](docs/rules/template-no-element-event-actions.md) | disallow element event actions (use {{on}} modifier instead) | | | |
| [template-no-forbidden-elements](docs/rules/template-no-forbidden-elements.md) | disallow specific HTML elements | ๐ | | |
| [template-no-html-comments](docs/rules/template-no-html-comments.md) | disallow HTML comments in templates | ๐ | ๐ง | |
| [template-no-implicit-this](docs/rules/template-no-implicit-this.md) | require explicit `this` in property access | ๐ | | |
| [template-no-index-component-invocation](docs/rules/template-no-index-component-invocation.md) | disallow index component invocations | ๐ | | |
| [template-no-inline-event-handlers](docs/rules/template-no-inline-event-handlers.md) | disallow DOM event handler attributes | | | |
| [template-no-inline-linkto](docs/rules/template-no-inline-linkto.md) | disallow inline form of LinkTo component | | ๐ง | |
| [template-no-inline-styles](docs/rules/template-no-inline-styles.md) | disallow inline styles | ๐ | | |
| [template-no-input-block](docs/rules/template-no-input-block.md) | disallow block usage of {{input}} helper | ๐ | | |
| [template-no-input-tagname](docs/rules/template-no-input-tagname.md) | disallow tagName attribute on {{input}} helper | ๐ | | |
| [template-no-invalid-meta](docs/rules/template-no-invalid-meta.md) | disallow invalid meta tags | ๐ | | |
| [template-no-log](docs/rules/template-no-log.md) | disallow {{log}} in templates | ๐ | | |
| [template-no-model-argument-in-route-templates](docs/rules/template-no-model-argument-in-route-templates.md) | disallow @model argument in route templates | | ๐ง | |
| [template-no-multiple-empty-lines](docs/rules/template-no-multiple-empty-lines.md) | disallow multiple consecutive empty lines in templates | | ๐ง | |
| [template-no-mut-helper](docs/rules/template-no-mut-helper.md) | disallow usage of (mut) helper | | | |
| [template-no-negated-condition](docs/rules/template-no-negated-condition.md) | disallow negated conditions in if/unless | ๐ | ๐ง | |
| [template-no-nested-splattributes](docs/rules/template-no-nested-splattributes.md) | disallow nested ...attributes usage | ๐ | | |
| [template-no-obscure-array-access](docs/rules/template-no-obscure-array-access.md) | disallow obscure array access patterns like `objectPath.@each.property` | ๐ | ๐ง | |
| [template-no-obsolete-elements](docs/rules/template-no-obsolete-elements.md) | disallow obsolete HTML elements | ๐ | | |
| [template-no-outlet-outside-routes](docs/rules/template-no-outlet-outside-routes.md) | disallow {{outlet}} outside of route templates | ๐ | | |
| [template-no-page-title-component](docs/rules/template-no-page-title-component.md) | disallow usage of ember-page-title component | | | |
| [template-no-passed-in-event-handlers](docs/rules/template-no-passed-in-event-handlers.md) | disallow passing event handlers directly as component arguments | ๐ | | |
| [template-no-positional-data-test-selectors](docs/rules/template-no-positional-data-test-selectors.md) | disallow positional data-test-* params in curly invocations | ๐ | ๐ง | |
| [template-no-potential-path-strings](docs/rules/template-no-potential-path-strings.md) | disallow potential path strings in attribute values | ๐ | | |
| [template-no-redundant-fn](docs/rules/template-no-redundant-fn.md) | disallow unnecessary usage of (fn) helper | ๐ | ๐ง | |
| [template-no-restricted-invocations](docs/rules/template-no-restricted-invocations.md) | disallow certain components, helpers or modifiers from being used | | | |
| [template-no-splattributes-with-class](docs/rules/template-no-splattributes-with-class.md) | disallow splattributes with class attribute | | | |
| [template-no-this-in-template-only-components](docs/rules/template-no-this-in-template-only-components.md) | disallow this in template-only components | | ๐ง | |
| [template-no-trailing-spaces](docs/rules/template-no-trailing-spaces.md) | disallow trailing whitespace at the end of lines in templates | | ๐ง | |
| [template-no-unavailable-this](docs/rules/template-no-unavailable-this.md) | disallow `this` in templates that are not inside a class or function | | | |
| [template-no-unnecessary-component-helper](docs/rules/template-no-unnecessary-component-helper.md) | disallow unnecessary component helper | ๐ | ๐ง | |
| [template-no-unnecessary-concat](docs/rules/template-no-unnecessary-concat.md) | disallow unnecessary string concatenation | | ๐ง | |
| [template-no-unnecessary-curly-parens](docs/rules/template-no-unnecessary-curly-parens.md) | disallow unnecessary parentheses enclosing statements in curlies | ๐ | ๐ง | |
| [template-no-unused-block-params](docs/rules/template-no-unused-block-params.md) | disallow unused block parameters in templates | ๐ | | |
| [template-no-valueless-arguments](docs/rules/template-no-valueless-arguments.md) | disallow valueless named arguments | ๐ | | |
| [template-no-whitespace-for-layout](docs/rules/template-no-whitespace-for-layout.md) | disallow using whitespace for layout purposes | ๐ | | |
| [template-no-yield-block-params-to-else-inverse](docs/rules/template-no-yield-block-params-to-else-inverse.md) | disallow yielding block params to else or inverse block | | | |
| [template-no-yield-only](docs/rules/template-no-yield-only.md) | disallow components that only yield | ๐ | | |
| [template-no-yield-to-default](docs/rules/template-no-yield-to-default.md) | disallow yield to default block | ๐ | | |
| [template-require-button-type](docs/rules/template-require-button-type.md) | require button elements to have a valid type attribute | ๐ | ๐ง | |
| [template-require-each-key](docs/rules/template-require-each-key.md) | require key attribute in {{#each}} loops | | ๐ง | |
| [template-require-form-method](docs/rules/template-require-form-method.md) | require form method attribute | | ๐ง | |
| [template-require-has-block-helper](docs/rules/template-require-has-block-helper.md) | require (has-block) helper usage instead of hasBlock property | ๐ | ๐ง | |
| [template-require-iframe-src-attribute](docs/rules/template-require-iframe-src-attribute.md) | require iframe elements to have src attribute | | ๐ง | |
| [template-require-splattributes](docs/rules/template-require-splattributes.md) | require splattributes usage in component templates | | | |
| [template-require-strict-mode](docs/rules/template-require-strict-mode.md) | require templates to be in strict mode | | | |
| [template-require-valid-named-block-naming-format](docs/rules/template-require-valid-named-block-naming-format.md) | require valid named block naming format | ๐ | ๐ง | |
| [template-self-closing-void-elements](docs/rules/template-self-closing-void-elements.md) | require self-closing on void elements | | ๐ง | |
| [template-simple-modifiers](docs/rules/template-simple-modifiers.md) | require simple modifier syntax | ๐ | | |
| [template-simple-unless](docs/rules/template-simple-unless.md) | require simple conditions in unless blocks | ๐ | ๐ง | |
| [template-sort-invocations](docs/rules/template-sort-invocations.md) | require sorted attributes and modifiers | | ๐ง | |
| [template-splat-attributes-only](docs/rules/template-splat-attributes-only.md) | disallow ...spread other than ...attributes | ๐ | | |
| [template-style-concatenation](docs/rules/template-style-concatenation.md) | disallow string concatenation in inline styles | ๐ | | |
### Components
| Nameย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย | Description | ๐ผ | ๐ง | ๐ก |
| :------------------------------------------------------------------------- | :----------------------------------------------------------------------------------------------------------------------------------- | :- | :- | :- |
| [no-attrs-in-components](docs/rules/no-attrs-in-components.md) | disallow usage of `this.attrs` in components | โ
| | |
| [no-attrs-snapshot](docs/rules/no-attrs-snapshot.md) | disallow use of attrs snapshot in the `didReceiveAttrs` and `didUpdateAttrs` component hooks | โ
| | |
| [no-builtin-form-components](docs/rules/no-builtin-form-components.md) | disallow usage of built-in form components | | | |
| [no-classic-components](docs/rules/no-classic-components.md) | enforce using Glimmer components | โ
| | |
| [no-component-lifecycle-hooks](docs/rules/no-component-lifecycle-hooks.md) | disallow usage of "classic" ember component lifecycle hooks. Render modifiers or custom functional modifiers should be used instead. | โ
| | |
| [no-on-calls-in-components](docs/rules/no-on-calls-in-components.md) | disallow usage of `on` to call lifecycle hooks in components | โ
| | |
| [require-tagless-components](docs/rules/require-tagless-components.md) | disallow using the wrapper element of a component | โ
| | |
### Computed Properties
| Nameย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย | Description | ๐ผ | ๐ง | ๐ก |
| :----------------------------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------ | :- | :- | :- |
| [computed-property-getters](docs/rules/computed-property-getters.md) | enforce the consistent use of getters in computed properties | | | |
| [no-arrow-function-computed-properties](docs/rules/no-arrow-function-computed-properties.md) | disallow arrow functions in computed properties | โ
| | |
| [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 | โ
| ๐ง | |
| [no-computed-properties-in-native-classes](docs/rules/no-computed-properties-in-native-classes.md) | disallow using computed properties in native classes | โ
| | |
| [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` | โ
| | |
| [no-duplicate-dependent-keys](docs/rules/no-duplicate-dependent-keys.md) | disallow repeating computed property dependent keys | โ
| ๐ง | |
| [no-incorrect-computed-macros](docs/rules/no-incorrect-computed-macros.md) | disallow incorrect usage of computed property macros | โ
| ๐ง | |
| [no-invalid-dependent-keys](docs/rules/no-invalid-dependent-keys.md) | disallow invalid dependent keys in computed properties | โ
| ๐ง | |
| [no-side-effects](docs/rules/no-side-effects.md) | disallow unexpected side effects in computed properties | โ
| | |
| [no-volatile-computed-properties](docs/rules/no-volatile-computed-properties.md) | disallow volatile computed properties | โ
| | |
| [require-computed-macros](docs/rules/require-computed-macros.md) | require using computed property macros when possible | โ
| ๐ง | |
| [require-computed-property-dependencies](docs/rules/require-computed-property-dependencies.md) | require dependencies to be declared statically in computed properties | โ
| ๐ง | |
| [require-return-from-computed](docs/rules/require-return-from-computed.md) | disallow missing return statements in computed properties | โ
| | |
| [use-brace-expansion](docs/rules/use-brace-expansion.md) | enforce usage of brace expansion in computed property dependent keys | โ
| | |
### Controllers
| Name | Description | ๐ผ | ๐ง | ๐ก |
| :--------------------------------------------------------------------------------- | :------------------------------------ | :- | :- | :- |
| [alias-model-in-controller](docs/rules/alias-model-in-controller.md) | enforce aliasing model in controllers | | | |
| [avoid-using-needs-in-controllers](docs/rules/avoid-using-needs-in-controllers.md) | disallow using `needs` in controllers | โ
| | |
| [no-controllers](docs/rules/no-controllers.md) | disallow non-essential controllers | | | |
### Deprecations
| Name | Description | ๐ผ | ๐ง | ๐ก |
| :----------------------------------------------------------------------------------------------- | :-------------------------------------------------------- | :- | :- | :- |
| [closure-actions](docs/rules/closure-actions.md) | enforce usage of closure actions | โ
| | |
| [new-module-imports](docs/rules/new-module-imports.md) | enforce using "New Module Imports" from Ember RFC #176 | โ
| | |
| [no-array-prototype-extensions](docs/rules/no-array-prototype-extensions.md) | disallow usage of Ember's `Array` prototype extensions | | ๐ง | |
| [no-at-ember-render-modifiers](docs/rules/no-at-ember-render-modifiers.md) | disallow importing from @ember/render-modifiers | โ
| | |
| [no-deprecated-router-transition-methods](docs/rules/no-deprecated-router-transition-methods.md) | enforce usage of router service transition methods | โ
| ๐ง | |
| [no-function-prototype-extensions](docs/rules/no-function-prototype-extensions.md) | disallow usage of Ember's `function` prototype extensions | โ
| | |
| [no-implicit-injections](docs/rules/no-implicit-injections.md) | enforce usage of implicit service injections | โ
| ๐ง | |
| [no-mixins](docs/rules/no-mixins.md) | disallow the usage of mixins | โ
| | |
| [no-new-mixins](docs/rules/no-new-mixins.md) | disallow the creation of new mixins | โ
| | |
| [no-observers](docs/rules/no-observers.md) | disallow usage of observers | โ
| | |
| [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 | โ
| | |
| [template-deprecated-inline-view-helper](docs/rules/template-deprecated-inline-view-helper.md) | disallow inline {{view}} helper | ๐ | ๐ง | |
| [template-deprecated-render-helper](docs/rules/template-deprecated-render-helper.md) | disallow {{render}} helper | ๐ | ๐ง | |
| [template-no-action](docs/rules/template-no-action.md) | disallow {{action}} helper | ๐ | | |
| [template-no-attrs-in-components](docs/rules/template-no-attrs-in-components.md) | disallow attrs in component templates | ๐ | | |
| [template-no-link-to-positional-params](docs/rules/template-no-link-to-positional-params.md) | disallow positional params in LinkTo component | ๐ | | |
| [template-no-link-to-tagname](docs/rules/template-no-link-to-tagname.md) | disallow tagName attribute on LinkTo component | ๐ | | |
| [template-no-route-action](docs/rules/template-no-route-action.md) | disallow usage of route-action helper | ๐ | | |
| [template-no-unbound](docs/rules/template-no-unbound.md) | disallow {{unbound}} helper | ๐ | | |
| [template-no-with](docs/rules/template-no-with.md) | disallow {{with}} helper | ๐ | | |
### Ember Data
| Nameย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย | Description | ๐ผ | ๐ง | ๐ก |
| :------------------------------------------------------------------------------------- | :-------------------------------------------------------------------- | :- | :- | :- |
| [no-empty-attrs](docs/rules/no-empty-attrs.md) | disallow usage of empty attributes in Ember Data models | | | |
| [require-async-inverse-relationship](docs/rules/require-async-inverse-relationship.md) | require inverse to be specified in @belongsTo and @hasMany decorators | | | |
| [use-ember-data-rfc-395-imports](docs/rules/use-ember-data-rfc-395-imports.md) | enforce usage of `@ember-data/` package imports instead `ember-data` | โ
| ๐ง | |
### Ember Object
| Nameย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย | Description | ๐ผ | ๐ง | ๐ก |
| :----------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------- | :- | :- | :- |
| [avoid-leaking-state-in-ember-objects](docs/rules/avoid-leaking-state-in-ember-objects.md) | disallow state leakage | โ
| | |
| [no-get](docs/rules/no-get.md) | require using ES5 getters instead of Ember's `get` / `getProperties` functions | โ
| ๐ง | |
| [no-get-with-default](docs/rules/no-get-with-default.md) | disallow usage of the Ember's `getWithDefault` function | โ
| ๐ง | |
| [no-modifier-argument-destructuring](docs/rules/no-modifier-argument-destructuring.md) | disallow destructuring of modifier arguments to avoid consuming tracked data too early | | | |
| [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 | โ
| | |
| [require-super-in-lifecycle-hooks](docs/rules/require-super-in-lifecycle-hooks.md) | require super to be called in lifecycle hooks | โ
| ๐ง | |
| [use-ember-get-and-set](docs/rules/use-ember-get-and-set.md) | enforce usage of `Ember.get` and `Ember.set` | | ๐ง | |
### Ember Octane
| Nameย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย | Description | ๐ผ | ๐ง | ๐ก |
| :----------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------- | :-------------------------------------------------------------- | :- | :- |
| [classic-decorator-hooks](docs/rules/classic-decorator-hooks.md) | enforce using correct hooks for both classic and non-classic classes | โ
| | |
| [classic-decorator-no-classic-methods](docs/rules/classic-decorator-no-classic-methods.md) | disallow usage of classic APIs such as `get`/`set` in classes that aren't explicitly decorated with `@classic` | โ
| | |
| [no-actions-hash](docs/rules/no-actions-hash.md) | disallow the actions hash in components, controllers, and routes | โ
| | |
| [no-classic-classes](docs/rules/no-classic-classes.md) | disallow "classic" classes in favor of native JS classes | โ
| | |
| [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 | โ
| | |
| [no-tracked-built-ins](docs/rules/no-tracked-built-ins.md) | enforce usage of `@ember/reactive/collections` imports instead of `tracked-built-ins` | | ๐ง | |
| [no-tracked-properties-from-args](docs/rules/no-tracked-properties-from-args.md) | disallow creating @tracked properties from this.args | โ
| | |
| [template-no-deprecated](docs/rules/template-no-deprecated.md) | disallow using deprecated Glimmer components, helpers, and modifiers in templates | | | |
| [template-no-let-reference](docs/rules/template-no-let-reference.md) | disallow referencing let variables in \<template\> |   | | |
### jQuery
| Name | Description | ๐ผ | ๐ง | ๐ก |
| :------------------------------------------------- | :------------------------------------------------- | :- | :- | :- |
| [jquery-ember-run](docs/rules/jquery-ember-run.md) | disallow usage of jQuery without an Ember run loop | โ
| | |
| [no-global-jquery](docs/rules/no-global-jquery.md) | disallow usage of global jQuery object | โ
| | |
| [no-jquery](docs/rules/no-jquery.md) | disallow any usage of jQuery | โ
| | |
### Miscellaneous
| Nameย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย | Description | ๐ผ | ๐ง | ๐ก |
| :--------------------------------------------------------------------------------------------------------------------- | :---------------------------------------------------------------------------------------------------------------------------- | :- | :- | :- |
| [named-functions-in-promises](docs/rules/named-functions-in-promises.md) | enforce usage of named functions in promises | | | |
| [no-html-safe](docs/rules/no-html-safe.md) | disallow the use of `htmlSafe` | | | |
| [no-incorrect-calls-with-inline-anonymous-functions](do