jahaziel17 / wro4j

Automatically exported from code.google.com/p/wro4j
0 stars 0 forks source link

Need processor to enforce JS style rules #806

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
JSHint no longer supports Javascript styling rules. See 
https://github.com/jshint/jshint/issues/1309

The "beautifyJS" plugin is not an appropriate replacement because it discard 
source-code comments.

We need to add an additional plugin that will cause the build to fail if 
code-styling rules are violated. I'm not sure what plugin that is (I haven't 
researched what's available).

Original issue reported on code.google.com by cow...@bbs.darktech.org on 21 Oct 2013 at 6:02

GoogleCodeExporter commented 8 years ago
https://github.com/mdevils/node-jscs is a possible candidate, but I'm not sure 
if wro4j can run nodeJS plugins.

Original comment by cow...@bbs.darktech.org on 22 Oct 2013 at 2:38

GoogleCodeExporter commented 8 years ago
Isn't jslint a good candidate? 
It is possible to run node.js in wro4j (example nodeCoffeeScript processor), 
but it is not cross platform and has a precondition to have node.js installed.

Original comment by alex.obj...@gmail.com on 22 Oct 2013 at 2:40

GoogleCodeExporter commented 8 years ago
I haven't dug too deeply into jslint but the reason I migrated from it to 
jshint in the first place is that the author is very opinionated about what is 
the "correct" style (as if it were an objective decision).

I'm looking for a plugin that lets developers enforce whatever style they see 
fit, understanding that this is a subjective decision.

Original comment by cow...@bbs.darktech.org on 22 Oct 2013 at 3:35

GoogleCodeExporter commented 8 years ago
I've created https://github.com/mdevils/node-jscs/issues/58 asking the author 
for a Rhino version.

Original comment by cow...@bbs.darktech.org on 22 Oct 2013 at 5:28

GoogleCodeExporter commented 8 years ago
Alex,

Is a browser version sufficient for our purposes? If not, can you please 
explain the difference between that and Rhino and I'll pass the word on to the 
author of jscs?

Original comment by cow...@bbs.darktech.org on 22 Oct 2013 at 6:43

GoogleCodeExporter commented 8 years ago
yes, it should be sufficient.

Original comment by alex.obj...@gmail.com on 22 Oct 2013 at 7:35

GoogleCodeExporter commented 8 years ago
I don't necessarily need a rhino version, I need a single js (merging entire 
jscs library), which can be evaluated in rhino easily to apply processing.

Original comment by alex.obj...@gmail.com on 23 Oct 2013 at 7:15

GoogleCodeExporter commented 8 years ago
https://github.com/mdevils/node-jscs/issues/58 has been resolved. Consider 
integrating it into wro4j at your convenience.

Original comment by cow...@bbs.darktech.org on 4 Nov 2013 at 9:09

GoogleCodeExporter commented 8 years ago
Where can I find the rhino version? Is it available as a webjar?

Original comment by alex.obj...@gmail.com on 4 Nov 2013 at 9:17

GoogleCodeExporter commented 8 years ago
I believe you want 
https://github.com/mdevils/node-jscs/blob/master/jscs-browser.js

There is no Webjar for it, but I can certainly add one once you're ready (run a 
quick test and let me know whether a local copy of the browser version works).

Original comment by cow...@bbs.darktech.org on 4 Nov 2013 at 9:33

GoogleCodeExporter commented 8 years ago
isn t eslint what you are looking for ?

Original comment by perceb...@gmail.com on 12 Dec 2013 at 4:45

GoogleCodeExporter commented 8 years ago
eslint is yet another linter. jscs is focused primarily on coding style, not 
coding mistakes, so I think it's a better fit for what I'm looking for.

That being said, I haven't investigated eslint too deeply. What makes you 
believe it'll do a better job?

Original comment by cow...@bbs.darktech.org on 12 Dec 2013 at 5:21

GoogleCodeExporter commented 8 years ago
node-jscs is actively replacing code removed by jshint. See 
https://github.com/mdevils/node-jscs/issues/102 for example.

This reinforces the fact that we should integrate it into wro4j.

Original comment by cow...@bbs.darktech.org on 3 Jan 2014 at 7:43

GoogleCodeExporter commented 8 years ago
I haven't investigated this too deeply yet, but this might interest you: 
https://github.com/eirslett/frontend-maven-plugin

Apparently it allows you to download, install and run node.js apps as part of 
the Maven build process.

Original comment by cow...@bbs.darktech.org on 18 Mar 2014 at 6:42