diff --git a/README.md b/README.md index 118014a552..fd7a909acf 100644 --- a/README.md +++ b/README.md @@ -247,6 +247,7 @@ rules in templates can be disabled with eslint directives with mustache or html | [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-no-action](docs/rules/template-no-action.md) | disallow {{action}} helper | | | | ### Ember Data diff --git a/docs/rules/template-no-action.md b/docs/rules/template-no-action.md new file mode 100644 index 0000000000..3b6f043820 --- /dev/null +++ b/docs/rules/template-no-action.md @@ -0,0 +1,54 @@ +# ember/template-no-action + + + +Disallows the use of `{{action}}` helper. + +The `{{action}}` helper is deprecated in favor of the `{{on}}` modifier and `{{fn}}` helper, which provide better performance and clearer intent. + +## Examples + +Examples of **incorrect** code for this rule: + +```gjs + +``` + +```gjs + +``` + +Examples of **correct** code for this rule: + +```gjs + +``` + +```gjs + +``` + +```gjs + +``` + +## Migration + +- Replace `(action "methodName")` with method references or `(fn this.methodName)` +- Replace `