Various linting errors across platform

Hi all!

I seem to be experiencing new linting errors across the platform (in components, in js queries, retool workflow queries, etc.) that previously did not exist. This seems to mostly affect new code, but changing old code slightly brings them up.

There's honestly too many places where this is happening for me to list them all, but at least one is here:

The data is returned correctly, all references have values, json is structured correctly, etc. So if I ignore the linting errors, I am successful :slight_smile: If I don't, I end up down a mean rabbithole solving a non-existent problem!

Similar thing here Item not defined in column status indicator:

Any ideas on why this might be happening?

There are multiple ways to run into the "not defined" linting warnings that we are investigating :disappointed:. I'll post here if I get any updates. There's also a workflows specific bug where the linter says connected blocks are not defined despite working when run

1 Like

I'm getting a lot of this now too.
Screen Shot 2024-05-09 at 11.51.09 am

if you just want the warning to go away so you don't have to look at it anymore you can do {{ item == null? "" : item.product }}. the proper way to make it go away is only temporary. there are a few ways this warning can be generated, but in your case item hasn't been initialized and/or instantiated yet so the variable is null or 'undefined' which means the linter thinks you're trying to access the product property on an object named item that doesn't exist yet. this has to do with the data source you have selected. If I was a betting man, I'd bet the query or whatever you use to populate a variable hasn't been ran yet so the output is unknown making the data source also unknown and that makes the item variable unknown. if you just run the query once it'll set the output or variable, which in-turn gives the component an array to use as the data source so it can generate the values for item and make the warning go away

if you run the queryAllCandidateJobs block it should have the variables initialized making that go away. similar to my reply above, you can also use the turnary operator to force it away: queryAllCandidateJobs == null? "" : queryAllCandidateJobs.data

just note that it uses == and not === as we want to force javascript coercion (for any fellow c language people, this is just an implicit conversion which is skipped when === is used :beers: )

2 Likes

You can see the actual value it's returning though. If it's not defined, how is it showing the String and populating the list?

if the linter throws a warning but the UI framework ignores or misses it then we would be seeing this happen. I dont know for sure how retool works in the background but thos is def one way for it to happen.

1 Like