Lint errors on using documented platform features

Hey There,

At the moment I am doing my first app with a dynamic installation page.

I am using onFormLoad as documented and use a custom event apiKeyChanged to validate the API key and load groupnames via API from our Freshdesk instance.

Both functions work fine and there were no issues in 10.0.0 (or 10.0.1, don’t remember where I’ve been until yesterday).
Yesterday I did do the update to 10.1.2 and now, when packing or validating, I do get lint errors:

Lint errors:
✖ config\assets\iparams.js::1: 'onFormLoad' is defined but never used.
✖ config\assets\iparams.js::9: 'apiKeyChanged' is defined but never used.

Why is this coming up in the latest version? The feature still works fine, but there shouldn’t be an error coming up for code, you are using as intended!

Could you check this? Thank you!

All the best

Tom

Hey @ThomasH,

This issue happens because the latest FDK update (10.1.2) introduced stricter code validation (linting). It sees these functions in your JavaScript file but doesn’t realize they are being called directly from your HTML page, so it flags them as “unused.”

Since your code works perfectly, you can safely tell the validator to ignore these rules by adding a special comment at the very top of your iparams.js file:

/* eslint-disable no-unused-vars */

Alternatively, you can add /* global onFormLoad, apiKeyChanged */ to the top of the file so the system knows they are meant to be used globally.

Best,

Himanshu

Thank you @Himanshu_Sharma

Your alternative approach did not work, but disabling linting does.

Best

Tom