HeavenShallBurn HeavenShallBurn - 6 months ago 31
Javascript Question

ESLint - new line before return with IIFE

Have the following simple code:
Image here

How to avoid this notification? I think this is because I used the IIFE function.

Thanks in advance.

Answer

If you want to disable it for this specific case you can just add a disable comment on the same line: (function(){ // eslint-disable-line newline-before-return

If you'd like to disable it for the entire project, edit your .eslintrc file to add it to the rules section:

{
    "rules": {
        "newline-before-return": "off"
    }
}

More info on configuration here: http://eslint.org/docs/user-guide/configuring