eclipsesource / jshint-eclipse

JSHint integration for the Eclipse IDE
http://github.eclipsesource.com/jshint-eclipse/
146 stars 31 forks source link

Can I copy/paste some jshint-eclipse Java classes in tern.java #104

Closed angelozerr closed 9 years ago

angelozerr commented 9 years ago

@ralfstx I'm integrating ESLint in tern.java https://github.com/angelozerr/tern.java/issues/234 and there are several Java Classes of jshint-eclipse that I would like to integrate inside tern.java (liek path pattern matching).

Can I do that? If yes can I change package name?

Thanks for your answre.

ralfstx commented 9 years ago

Hi Angelo, you can modify and re-use any part of this project under the terms of the EPL, that is, keep copyright notices intact (with your additions of course) and publish them also under EPL.

I have to say, that especially the path pattern matching is something I'd like to remove in jshint-eclipse and replace it with support for .jshintignore files (#64) which follow a different syntax.

Ideally, we would join forces and extract a common extensible JavaScript linter integration for Eclipse. This would allow for jshint, jslint, eslint, jscs etc. plugins on top of it. Would that be interesting?

angelozerr commented 9 years ago

Hi Angelo, you can modify and re-use any part of this project under the terms of the EPL, that is, keep copyright notices intact (with your additions of course) and publish them also under EPL.

Cool! tern.java has EPL license, so it will work.

I have to say, that especially the path pattern matching is something I'd like to remove in jshint-eclipse and replace it with support for .jshintignore files (#64) which follow a different syntax.

In tern.java I have script path https://github.com/angelozerr/tern.java/wiki/Tern-Script-Path but I don't manage exclude path. Your pattern path seems managing that, that's why I would like to integrate it. Script path is a generic mean to find files (like JSDT Include path). I have started to develop a translator JSDT path -> Tern Scripat path My idea is to provide other translator X -> Tern script path like bower -> Tern script, .jshintignore -> Tern Script path, etc

Ideally, we would join forces and extract a common extensible JavaScript linter integration for Eclipse. This would allow for jshint, jslint, eslint, jscs etc. plugins on top of it.

That's my goal too! I would like to provide those linter inside tern.java. Today tern.java provides 2 linter :

I will provides soon jshint too with a tern-jshint tern plugin

Those linter are tern plugins that you can execute inside Eclipse IDE but with other JavaScript editor like Emacs https://github.com/katspaugh/tern-lint.el

Why wrapping eslint, jshint, etc in a tern plugin? Because tern.java execute tern plugin with node.js (it provides embed nodejs, so no need to install nodejs). I think that to execute jshint with nodejs (instead of executing with Rhino like you have done) is better.

Would that be interesting?

Yes!!!

As I said you, I'm planning to provide several linter inside tern.java. So if you like this idea, I will be really happy to work with you.

For your information, JBoss, Liferay IDE and MyEclipse have integrated tern.java and does contribution. It should be fantastic if you could contribute to tern.java if you like it.

ralfstx commented 9 years ago

I think that to execute jshint with nodejs (instead of executing with Rhino like you have done) is better.

I agree. WebStorm uses the same approach. When I've started with jshint-eclipse, node was not on my radar.

it provides embed nodejs, so no need to install nodejs

That scares me a little. I only trust software installed from a trusted Linux packaging repository. How do you select the right nodejs for the architecture?

angelozerr commented 9 years ago

That scares me a little. I only trust software installed from a trusted Linux packaging repository. How do you select the right nodejs for the architecture?

JBoss guys have done great job about this feature. There are a plugin which host nodejs for each OS. After to provide the well embed nodejs Eclipse-PlatformFilter is used :

Eclipse-PlatformFilter: (& (osgi.ws=gtk)(osgi.os=linux)(osgi.arch=x86_64))

See https://github.com/angelozerr/tern.java/blob/master/eclipse/tern.eclipse.ide.server.nodejs.embed.linux.gtk.x86_64/META-INF/MANIFEST.MF#L12

If you don't install an embed nodejs plugin, tern.java searchs your installed nodejs.

ralfstx commented 9 years ago

Sounds good, Angelo. I'll give it a try.

paulvi commented 9 years ago

@ralfstx said

Ideally, we would join forces and extract a common extensible JavaScript linter integration for Eclipse. This would allow for jshint, jslint, eslint, jscs etc. plugins on top of it. Would that be interesting?

Looking forward to see some cooperation.

angelozerr commented 9 years ago

@ralfstx I have integrated JSHint and ESLint inside tern.java. It's almost possible to add easily (with a tern plugin) your own linter. Please read :

My work is not finished, I must improve again the tern builder and support complex matches like ignore files etc. It's just a start of extensible linter (just write JavaScript tern plugin) executed with node.js. Hope you will like it.

angelozerr commented 9 years ago

@ralfstx for your information, I have implemented tern linter with a WTP Tern Validator. See https://github.com/angelozerr/tern.java/wiki/Tern-Linter

So validation is done "as you are typing" or with Manual/Build actions (I have not implemented an IncrementalBuilder, just use WTP ValidationBuilder).

Next step is to customize JSHint with an UI and for your information I have started a JSON Editor based on WTP https://github.com/angelozerr/eclipse-wtp-json It supports JSON comments (that it is used for JSHint). See https://github.com/angelozerr/eclipse-wtp-json/wiki/SyntaxColoring#json-comment

My idea is to provide completion too inside JSON Editor for having JSHint completion. The JSON Editor is not stable (I must improve the synch between editor and IJSONModel (like IDOMMOdel for XML)

Hope you will like it.