Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow semicolon at the end of an IIFE #663

Closed
dalelotts opened this issue Oct 19, 2016 · 3 comments

Comments

@dalelotts
Copy link

commented Oct 19, 2016

Since converting to standard, users of my directives are having problems with concatenating and minifying my directive with other code. The root cause of the problem is that standard does not allow ; at the end of an IIFE.

If my directive is concatenated with another file that starts with an IIFE they get a parser error and report defects like the following:
dalelotts/angular-bootstrap-datetimepicker#347
dalelotts/angular-bootstrap-datetimepicker#338

If I could terminate my IIFE with a ;, this would fix the issues they are having.

@qzb

This comment has been minimized.

Copy link

commented Oct 21, 2016

I'm afraid that eslint doesn't support such exception. Currently all you can do is suppressing error raised by semi rule for last line of the file:

;(function () {
  // ...
})()

; // eslint-disable-line semi
@dalelotts

This comment has been minimized.

Copy link
Author

commented Oct 21, 2016

Thanks for the update! At least I have a work around.

@Flet

This comment has been minimized.

Copy link
Member

commented Oct 24, 2016

Thanks for the help @qzb!

I found a related issue in eslint: eslint/eslint#6271

Unfortunately it looks like they did not decide to implement this option. Sorry!

Closing this for now, but feel free to continue discussion.

@Flet Flet closed this Oct 24, 2016

@lock lock bot locked as resolved and limited conversation to collaborators May 10, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
3 participants
You can’t perform that action at this time.