HeavenShallBurn HeavenShallBurn - 2 years ago 131
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 Source

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

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download