Open tcm151 opened 1 month ago
@tcm151 cfparser added some support for lambda functions a little while ago I wonder whats tripping it up here? https://github.com/cfparser/cfparser/commit/b6475f72dad69fd986e3a8c7320f031880be0be4 try using parens around your arguments ?
Also
temp = metadata.filter(m => m.DATA_TYPE != "P" && m.DATA_VALUE != "");
appears to work fine for me ? what version of cflint are you using ? try using this one and let me know if it fixes your issue
https://github.com/cfmleditor/CFLint/releases/tag/1.5.5-SNAPSHOT
Didn't know there was a snapshot, thanks for that! I've been using 1.5
@tcm151 no guarantees, just wanted to rule out an old version of the parser. The parser can get a bit crossed up with syntax depending on lots of other factors. Often as soon as you isolate the syntax it does fine, but embedded in a file with all kinds of other code can sometimes cause a problem. So if you're able to isolate it and reproduce the problem, that would help with some diagnosis ( but sometimes not an easy fix )
It's coming from a pretty small file, only 25-30 lines so I don't think there is too much affecting it that way. I'll give the snapshot a try and see if that resolves the issue
@ghedwards still no luck with the snapshot version, I've tried as many combinations of arrow functions syntax as I can think of
This is still the only one that works without an error
I'm just going to exclude that rule for the meantime since it's not a major blocker for what I need it for
Arrow functions have been included in ACF since 2018, however CFLint false shows a missing semi colon error when they are used.
Example: shows error when using arrow function
doesn't show error when using the full chunky function syntax
![image](https://github.com/user-attachments/assets/d2a4c2b1-a51b-43b9-bfb5-633e6b60c244)