sfcc/no-storefront-isml-rendering
Disallows rendering ISML through an SFRA storefront response.
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
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 - Does not report
dw/template/ISMLordw/util/Template, so cartridges can still render email, XML, and other non-storefront templates
Use sfcc/no-template-rendering as well when all template rendering is prohibited.
Default behavior
- ⚪ Severity: off by default; error in the
pwaandstorefront-nextpresets - ➖ Auto-fix: none
Example
Invalid
js
const server = require("server")
server.get("Home", function (req, res, next) {
res.render("home/homepage")
next()
})Valid
js
const Template = require("dw/util/Template")
function renderEmail(model) {
return new Template("mail/order").render(model)
}