简体   繁体   English

令牌“。”上的语法错误,jshint中此标记之后的标识符

[英]Syntax error on token “.”, Identifier expected after this token in jshint

I am working with Eclipse and installed jshint for my application development with node.js, and now I am working on socket.io, where I have written following code. 我正在使用Eclipse并使用node.js为我的应用程序开发安装了jshint,现在我正在使用socket.io,我编写了以下代码。

io.sockets.in('room').emit('event_name', data);

here I am getting warrning from jshint as follows in Eclipse (Kepler). 在这里,我在Eclipse(Kepler)中从jshint得到如下的警告。

Syntax error on token ".", Identifier expected after this token

How Do I solve this problem? 我该如何解决这个问题? Can someone tell me what the syntax error is here? 有人能告诉我这里的语法错误是什么吗?

According to the JSHint docs: http://www.jshint.com/docs/ 根据JSHint文档: http//www.jshint.com/docs/

ignoreThis(); // jshint ignore:line

That should work. 这应该工作。 There may also be some other configuration to ignore certain errors. 可能还有一些其他配置可以忽略某些错误。 Obviously you wouldn't want to ignore all syntax errors... 显然你不想忽略所有语法错误......

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM