The code I have is as follows:
$('.panel').each( function() {
$(this).css('height', 'auto');
$(this).find('.portlet-panel-item').css('height', 'auto');
});
I am getting the following error: 37:26 warning Missing function expression name func-names.
I can't use the ES6 arrow functions because of the way this is being handled in the two use cases.
How can I fix this issue without having to put named functions for each?
You should either use a named function or disable the rule.
From AirBnB JavaScript style guide:
Don’t forget to name the expression - anonymous functions can make it harder to locate the problem in an Error's call stack.
You can set this rule to check "always", "as-needed", or "never" by using a comment, so in your case:
/*eslint func-names: ["error", "never"]*/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With