Hi, The "extra comma" at the last property in object literal definition is missed with JS Inspector, which is perhaps the most common error in javascript.
In addition to many of the static code analysis issues, it deliberately offers a more restrictive set of suggestions to make use of a subset of JavaScript that, by doing so, actually helps eliminate a lot of the nastier bugs.
The rationale, including counter-examples, appears in JavaScript: The Good Parts and is quite compelling. And it'd have to be if you're literally asking people to not use parts of the langauge or change their coding style to something they already deem as readabe. It's a short read and makes a convert out of the majority that grok its message.
As such, I don't think it's that IntelliJ's JavaScript support is lacking, but that there's a desire by the community to be able to turn the dial to 11 (if I make make a SpinalTap reference). IntelliJ seems like the better way to do that, rather than relying on two tools.
For instance, while IntelliJ gives me the big green square, if I run that same code through JSLint, it will:
suggest that ++ be converted to += 1
be far more strict on my indentation
require that I move all declarations to the top of a function
require that I have "use strict"
make sure I don't reference the object I'm defining within itself unless its been declared first
insure a specific and consistent use of spaces for functions and properties
it compains if certain keywords (e.g. with) used because of some nasty side effects
it catches quite a number of illegal Unicode chacters that slip by IntelliJ
it suggests certain constructs that are normally are not necessary when it makes clear intent (e.g. like a semicolon on an empty switch's case statement)
it wants all if/else blocks wrapped in braces
and more...
In other words, it goes beyond valid and clean code to suggesting things that also convey clear intent, especially bizare scoping issues and edge cases, and steers away of wobbly parts of the language.
Entering "JSLint IntelliJ" in Google takes one immediately to this thread, btw. So if there's a better place or a more appropiate resource, this would be the place request users to do a soft redirect.
Hello Ming,
No, and we don't plan to implement it. What checks does jslint perform that
aren't covered by the built-in JavaScript inspections?
--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"
Hi,
The "extra comma" at the last property in object literal definition is missed with JS Inspector, which is perhaps the most common error in javascript.
IDEA flags syntax error in following code just after the comma
obj = {
property:"",
}
Hi Mossienkov,
Yes! It works with IDEA 9.0, maybe I got the wrong impression from old version, sorry for mis-understanding.
In addition to many of the static code analysis issues, it deliberately offers a more restrictive set of suggestions to make use of a subset of JavaScript that, by doing so, actually helps eliminate a lot of the nastier bugs.
The rationale, including counter-examples, appears in JavaScript: The Good Parts and is quite compelling. And it'd have to be if you're literally asking people to not use parts of the langauge or change their coding style to something they already deem as readabe. It's a short read and makes a convert out of the majority that grok its message.
As such, I don't think it's that IntelliJ's JavaScript support is lacking, but that there's a desire by the community to be able to turn the dial to 11 (if I make make a SpinalTap reference). IntelliJ seems like the better way to do that, rather than relying on two tools.
For instance, while IntelliJ gives me the big green square, if I run that same code through JSLint, it will:
In other words, it goes beyond valid and clean code to suggesting things that also convey clear intent, especially bizare scoping issues and edge cases, and steers away of wobbly parts of the language.
-wls
Found some more:
Hello Walt,
We'd really appreciate it if you could file feature requests in YouTrack
(http://youtrack.jetbrains.net/) for all of your suggestions.
--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"
I'd be happy to, I didn't know I could do that.
Entering "JSLint IntelliJ" in Google takes one immediately to this thread, btw. So if there's a better place or a more appropiate resource, this would be the place request users to do a soft redirect.
-wls
For the sake of future generations - Intellij Idea 11 has JSLint buuilt in.
I just discovered this in the latest pycharm beta. Thanks!