Best way to run Sonarqube local analysis with javascript project - javascript

In our CI environment the SonarQube build breaker plugin is installed, and build will fail if Sonar scan alert threshold is reached. Developer needs to run SonarQube local analysis and fix any new issues and submit changes again.
But this process does not work for javascript project. SonarQube Eclipse plugin does not support javascript yet, while maven sonar runner only generates a json file as the result. This is not user friendly to developer.
So my question is: is there any other option to make javascript local analysis visualized besides installing local SonarQube server? Thanks.
Best Regards,

For developers to check their code prior to commit, they can use the Issues Report plugin for now. See http://docs.codehaus.org/display/SONAR/Issues+Report+Plugin.

You can use the SonarLint tool with Eclipse.
SonarLint is an extension to your favorite IDE that provides on-the-fly feedback to developers on new bugs and quality issues injected into their code.
http://www.sonarlint.org

Related

Visual Studio Code - compile Javascript on save

The tutor of my video tutorial compiles javascript/react on save with his VS Code editor. Mine dont.
How can I config VS Code to do this?
Remark:
I find solution for typescript "Visual Studio Code - compile on save", but suggested solution does not work for me.
#added information:
the project is created with create.react-app. npm start opens chrome, and compilation errors are then shown in Chrome's DEV-Console, as noted by Shishani . My tutor has the code compiled on VS Code Terminal console. This offers a quick check of the code compilation before I go to webbrowser, to check for errors there, which seems to me much more intimidating with it's long callstacks.
If you create your React project with create-react-app, and then start it with npm start, it compiles automatically on save. Also, if it's not a React project, but just JS/HTML/CSS, you can open your project with the "Live Server" extension in VSCode, and it will update your page every time you save a file in your VSCode workspace.
You can even do like I do, and enable constant autosave, with the AutoSave: afterDelay setting in VSCode (if you dare), and then set the save delay to a super small number (mine is 2ms) so you don't even need to hit save anymore (go to File>Preferences>Settings>[Search "Auto Save"]).
If you have created react project using there official cli tool (create-react-app) then on saving js files it gets re-compile. This is because they are using webpack bundler behind the scene.
If you have created normal html or js files without any such cli tools then it won't work directly, You have to use some kind of bundler with dev-server support to do it.
Parcel! is a great bundler to use without configuration

How can I find JavaScript project option in Eclipse 2020-06?

I have downloaded Eclipse IDE for Web and JavaScript Developers package of 2020-06 version. But while creating project I am not seeing "JavaScript Project" option upon doing "File >> New". Can anyone please help me out?
As of that release, you no longer need a distinct JavaScript Project and its associated Include Path and other options, as JavaScript support is primarily coming from the Wild Web Developer project. WWD provides features to the Generic Editor, and doesn't place any requirements on the file to be in a particular folder in a special kind of project. Ideally, you just create a JavaScript file and start coding without needing to tell Eclipse anything about your project that you're not already setting up otherwise.
If you are unable to create a Static Web Project, I recommend:
double check your installed software - do you have all the sub-packages for Web Development?
take a look at the CodeMix project (also installable through the Eclipse market place) - its a commercial product but may have what you need in there.
The following steps worked:
To get back the JSDT JavaScript editor you have to uninstall Eclipse Wild Web Developer and install JavaScript Development Tools from the Eclipse IDE 2020-03 release.
Uninstall Eclipse Wild Web Developer: In Help > About Eclipse IDE: Installation Details, in the Installed Software tab select Eclipse Wild Web Developer and click Uninstall
Install JavaScript Development Tools from the 2020-03 release: In Help > Install New Software... work with https://download.eclipse.org/releases/2020-03 and choose JavaScript Development Tools to install

How to set up an automated testing environment for AngularJS

I have spent hours trying to set up an automated testing environment for my AngularJS applications that I can run from Maven (capturing results in Bamboo)
A Google search reveals frameworks galore, based on Jasmine, Karma and generic JavaScript frameworks.
But for some reason the installation of these never goes as described.
Can anyone just point me to a set of downloads that I can install manually to proper directories, that will just execute my unit tests?
I asked a similar question previously and got down checked and requests to close. If you need to check me down, please leave a reason, as I am besides myself with frustration trying to solve this, and I am sure there many other developers experiencing the same issue
Testing javascript is not a totally mature thing, so there isn't a great diversity of good tools for doing so. Jasmine and Karma are the current best ways of doing that.
Those tools are best managed using bower, which is a nodejs package. So you'll have to install, in this order:
nodejs
npm (node package manager)
bower (using npm)
jasmine and karma using bower
phantomjs, and whatever other dependencies your javascript needs (presumably angular)
Then you can run the tests.
I found this package for maven with some brief googling, but god knows how to set it up:
http://searls.github.io/jasmine-maven-plugin/
There are many tutorials on going through this process. You have to accept that these are currently the best tools for doing this and give it your best shot. If you post more specific issues regarding the 'installation that never goes as described' of jasmine and karma you will get assistance.
you can use for example yeoman or angular-seed. both will require nodejs and optionally ruby. both will set you with phantomjs, jasmine, karma, bower and many more. however i would avoid combining that build with maven. imho it's far from perfect. java tools will never be as good as native js tools for building js project. if you really want to combine the builds then use java only to call nodejs and nothing more

How to make the VJET plugin fully working in eclipse for my node.js project

VJET is almoust working for me, I can get code completion in the same file and for basic Node.js modules (using NodejsTL) but for new modules(my modules) or modules installed with npm an increasing number of errors plagues my "Problems" tab in Eclipse. It is there any way to have clean "builds" and get rid of all warnings and errors?
Vjet currently doesn't understand user defined modules. There are a three solutions to fix this... (1)a type library can be added to support more modules. (2)Vjet can be extended to support npm modules there is a enhancement request open for this. (3)There is a way to disable errors and warnings as well. You can provide disable errors and warnings at the project or workspace level. See preferences -> vjet -> code compliance -> errors and warnings. Thanks for the feedback.
Here is the enhancement request you should vote for to get VJET to understand nodejs user defined modules - https://www.ebayopensource.org/jira/browse/VJET-88

Combine c++ and javascript development in Eclipse

I am new to Eclipse IDE, but now I need it to develop apps for webOS.
Help me please with the next questions:
I have downloaded the Eclipse IDE for JavaScript Web development. How can I find it's version information?
Can I use one instance of Eclipse IDE for JavaScript and C++ development at the same time? (if yes then please write the steps to extend JavaScript IDE to support C++ development) Or I should have two instances installed?
Some parts of documentation are written exactly for Eclipse Galileo C++ development. Are different versions of Eclipse IDE really different? Will I have problems porting settings from Galileo to Helios or Indigo?
Thanks.
Usually Versioninformation can be found under Help->About Eclipse
I do not know about this exact setup but I have Java/C++/PHP in one Eclipse install.
I installed the java version and then Help->Install New Software where I choose -all sites- as source and then searched for the compontent I wanted and installed it.
After installation restart eclipse to load the new plugins and now you should have a new Perspective for the language you installed.
If you can not find the perspective look under Window->Open Perspective->Other.
I do not know although I work with different version. Maybe some names (for example in menus) are changed but I really can't say (maybe a hint that they are not different? But Probably I just did not dive that deep into it).
The menu-paths I gave are under Indigo release.
I'm using Eclipse CDT with Aptana as a plugin which covers both bases for me.

Categories

Resources