cflint/CFLint

False error reporting for arrow functions

tcm151 opened this issue · 7 comments

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
image
doesn't show error when using the full chunky function syntax
image

@tcm151 cfparser added some support for lambda functions a little while ago I wonder whats tripping it up here? cfparser/cfparser@b6475f7 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

image
image
image
image
image

This is still the only one that works without an error
image

I'm just going to exclude that rule for the meantime since it's not a major blocker for what I need it for