sfcc/no-isml-rendering
Disallows server-side ISML and template rendering.
This rule is opt-in and is not part of the recommended config. It is enabled by the PWA and Storefront Next architecture presets.
What it checks
- Reports static access to
dw/template/ISMLanddw/util/Template - Reports
res.render(...)whenresis the response parameter of a handler registered through an imported SFRAserverbinding - Supports aliased
serverand response bindings - Ignores unrelated objects with a
render()method and locally shadowedservervariables
ISML files themselves are outside ESLint's JavaScript scope. This rule prevents JavaScript rendering dependencies but does not report template files stored in the repository.
Default behavior
- Severity: off (opt-in)
- Auto-fix: none
Examples
Invalid
js
const server = require("server")
server.get("Home", function (req, res, next) {
res.render("home/homepage")
next()
})Invalid
js
const ISML = require("dw/template/ISML")
ISML.renderTemplate("mail/order", model)