Require
setstatements to have a target variable.
| Type | problem |
| Default severity | error in recommended and strict |
| Fixable | — |
The correct form of a set statement is set @variable = expression. A bare set = expression with no target is either a parse error or produces undefined runtime behavior. This always indicates a typo or incomplete code.
| Setting | Values | Default |
|---|---|---|
| severity | "error" | "warn" | "off" |
"error" |
This rule has no configuration options.
Not allowed:
%%[
set = Lookup("MyDE", "Value", "Key", @key)
]%%
Allowed:
%%[
var @result
set @result = Lookup("MyDE", "Value", "Key", @key)
]%%
// eslint.config.js
rules: { 'sfmc/amp-set-requires-target': 'off' }