# ember/template-no-with
💼 This rule is enabled in the 📋 `template-lint-migration` [config](https://github.com/ember-cli/eslint-plugin-ember#-configurations).
> **HBS Only**: This rule applies to classic `.hbs` template files only (loose mode). It is not relevant for `gjs`/`gts` files (strict mode), where these patterns cannot occur.
The use of `{{with}}` has been deprecated, you should replace it with either `{{let}}` or a combination of `{{let}}`, `{{if}}` and `{{else}}`.
## Examples
This rule **forbids** the following:
```gjs
{{#with (hash name="Ben" age=4) as |person|}}
Hi {{person.name}}, you are {{person.age}} years old.
{{/with}}
```
```gjs
{{#with user.posts as |blogPosts|}}
There are {{blogPosts.length}} blog posts.
{{/with}}
```
```gjs
{{#with user.posts as |blogPosts|}}
There are {{blogPosts.length}} blog posts.
{{else}}
There are no blog posts.
{{/with}}
```
This rule **allows** the following:
```gjs
{{#let (hash name="Ben" age=4) as |person|}}
Hi {{person.name}}, you are {{person.age}} years old.
{{/let}}
```
```gjs
{{#let user.posts as |blogPosts|}}
{{#if blogPosts.length}}
There are {{blogPosts.length}} blog posts.
{{/if}}
{{/let}}
```
```gjs
{{#let user.posts as |blogPosts|}}
{{#if blogPosts.length}}
There are {{blogPosts.length}} blog posts.
{{else}}
There are no blog posts.
{{/if}}
{{/let}}
```
## References
- [Deprecate {{with}} RFC](https://github.com/emberjs/rfcs/blob/master/text/0445-deprecate-with.md)
- More information is available at the [Deprecation Guide](https://deprecations.emberjs.com/v3.x/#toc_ember-glimmer-with-syntax)