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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ rules in templates can be disabled with eslint directives with mustache or html
| [template-no-page-title-component](docs/rules/template-no-page-title-component.md) | disallow usage of ember-page-title component | | | |
| [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-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 (gjs/gts) | | 🔧 | |
| [template-no-trailing-spaces](docs/rules/template-no-trailing-spaces.md) | disallow trailing whitespace at the end of lines in templates | | 🔧 | |
Expand Down
49 changes: 49 additions & 0 deletions docs/rules/template-no-restricted-invocations.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# ember/template-no-restricted-invocations

<!-- end auto-generated rule header -->

Disallow certain components, helpers or modifiers from being used.

Use cases include:

- You bring in some addon like ember-composable-helpers, but your team deems one or many of the helpers not suitable and wants to guard against their usage
- You want to discourage use of a deprecated component

## Examples

Given a config of:

```json
["foo-bar"]
```

This rule **forbids** the following:

```hbs
{{foo-bar}}
```

```hbs
{{#foo-bar}}{{/foo-bar}}
```

```hbs
<FooBar />
```

## Configuration

One of these:

- string[] - helpers or components to disallow (using kebab-case names like `nested-scope/component-name`)
- object[] - with the following keys:
- `names` - string[] - helpers or components to disallow (using kebab-case names like `nested-scope/component-name`)
- `message` - string - custom error message to report for violations (typically a deprecation notice / explanation of why not to use it and a recommended replacement)

## Related Rules

- [ember/no-restricted-service-injections](https://github.com/ember-cli/eslint-plugin-ember/blob/master/docs/rules/no-restricted-service-injections.md)

## References

- [ember-cli-deprecation-workflow](https://github.com/mixonic/ember-cli-deprecation-workflow)
Loading
Loading