0

Linting tool Invalid Aura API error

The below line of code is showing warning like in the image

if($A.util.isUndefinedOrNull(someVar)){
}

As per the documentation below are not valid

Aura.something(); // Use $A instead
$A.util.fake(); // fake is not available in $A.util

But in the aura documentation isUndefinedOrNull method is available. Did anyone get this issue?

  • Can you please add your code as well in the question – maniac coder Sep 5 '19 at 0:21
  • i getting warning in the linting tool when ever i use this function $A.util.isUndefinedOrNull(someVar) – mohan Sep 25 '19 at 8:59
0

You can try using this in your javascript helper file

NotBlank : function(checkString) {
    return (checkString != '' && checkString != null &&
            !$A.util.isEmpty(checkString) && !$A.util.isUndefined(checkString));
}

This will work the same way "$A.util.isUndefinedOrNull" is supposed to work. For example,

if(helper.NotBlank(someVar)){
}
| improve this answer | |
  • can you install Lightning Linter Chrome extension? i was facing error where ever "$A.util.isUndefinedOrNull" this is being used. – mohan Sep 26 '19 at 12:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.