Closed filiprafalowicz closed 6 months ago
@filiprafalowicz thank you for getting involved. We will try to create a test for this and reproduce it. I'm just curious how you are using lightning flow scanner and which version?
@RubenHalman I have added Lightning Flow Scanner as part of my PR validation pipeline and the project I am working on currently is heavily leveraging flows. This is why I have been reporting all of these issues / enhancements recently.
I was using version 2.17.0
of the main plugin, but I see 2.19.0
was released recently so I will upgrade the plugin on my side.
@filiprafalowicz Thanks, I just wanted to make sure you are using the sfdx plugin. I think you are right on your initial analysis. l have created this PR as an initial starting point for this issue, which includes a new test case based on the flow you provided.
@filiprafalowicz this has been resolved with version: "3.6.0", which I will soon publish in both the vsc and sf cli solutions
When sending emails directly from the Flows, we need to very often use Text Templates resource which may use some formulas to dynamically generate email content based on the criteria. However for this scenario, lightning flow scanner will report UnusedVariable rule violation as Text Templates are not included in the logic that searches for variable usage.
Below is a sample flow that will trigger rule violation:
I think the issue is caused by
textTemplates
element being defined asflowMetadata
instead offlowVariables
in the Flow.ts file.