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

Immediately-invoked function expressions are an error in the linter #600

Closed
thomas-jeepe opened this issue Nov 25, 2015 · 6 comments
Closed
Assignees

Comments

@thomas-jeepe
Copy link

In case you don't know what that thing is.

This code (function(){})() is an error in the linter despite being perfectly valid, it says string literal expected.

I also want to say, the intellisense on the editor is amazing and I can't wait for jsx support :)

@egamma egamma added the info-needed Issue requires more information from poster label Nov 25, 2015
@egamma
Copy link
Member

egamma commented Nov 25, 2015

I assume this is in a JS file. Do you have an linter jshint, eslint, jscs enabled? if yes you should file it against the corresponding linter.

@alexdima
Copy link
Member

@thomas-jeepe ping:

  • what linter have you configured?
  • is this TypeScript or JavaScript?

@thomas-jeepe
Copy link
Author

Sorry, didn't get the notifications. I haven't configured a linter at all, used the one out of the box, It was originally in a flowtype file where I got the error, I just tried it in js file and I got the error.

Looks like it is after an es6 import statement without semicolons

// lints fine
var ONE = (function(a){return 1}())

// lints fine
(function(a){return 1}())

// lints fine
import blah from 'blah';
(function(a){return 1}())

// errors
import blah from 'blah'
(function(a){return 1}())

@alexdima alexdima added the bug Issue identified by VS Code Team member as probable bug label Dec 1, 2015
@alexdima
Copy link
Member

alexdima commented Dec 1, 2015

@thomas-jeepe Thank you for getting back to us. I can reproduce, I also get squigglies when the semicolon is missing.

@alexdima alexdima removed the info-needed Issue requires more information from poster label Dec 1, 2015
@jrieken jrieken added the javascript JavaScript support issues label Dec 4, 2015
@jrieken jrieken modified the milestone: Dec 2015 Dec 4, 2015
@jrieken jrieken removed bug Issue identified by VS Code Team member as probable bug javascript JavaScript support issues labels Dec 4, 2015
@jrieken
Copy link
Member

jrieken commented Dec 4, 2015

This is either an issue with the TypeScript compiler or specified as that. See TS playground for reference: http://www.typescriptlang.org/Playground#src=%2F%2F%20errors%0D%0Aimport%20blah%20from%20'blah'%0D%0A(function%20(a)%20%7B%20return%201%20%7D%20())%0D%0A

@jrieken
Copy link
Member

jrieken commented Dec 4, 2015

This issue was moved to microsoft/TypeScript#5931

@jrieken jrieken closed this as completed Dec 4, 2015
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants
@egamma @jrieken @alexdima @thomas-jeepe and others