Qodana 2021.2 Help

Qodana for JS

official project

Qodana JS is based on WebStorm and provides static analysis for JavaScript or TypeScript projects.

Try it now

Analyze a project locally

To start, pull the image from Docker Hub (only necessary to get the latest version):

docker pull jetbrains/qodana-js

For a basic JavaScript project, which does not have dependencies, no preliminary steps are required.

In case a project has external npm dependencies, add the following step before you run the analysis:

docker run --rm -v <source-directory>:/usr/src/app -w /usr/src/app node:lts npm install

You can use any Node version your project requires or use yarn or other package managers to install the project dependencies.

The project dependencies are now stored in <source-directory>/node_modules. This folder could be preserved between builds to speed them up.

Start local analysis with cache mounted and with source-directory pointing to the root of your project, and it would automatically look for node_modules in /data/project/node_modules:

docker run --rm -it -p 8080:8080 \ -v <source-directory>/:/data/project/ \ -v <output-directory>/:/data/results/ \ jetbrains/qodana-js --show-report

This command will run the analysis on your source code and start the web server to provide a convenient view of the results. Open http://localhost:8080 in your browser to examine the found problems and performed checks. Here you can also reconfigure the analysis. See the User interface overview for details. When done, you can stop the web server by pressing Ctrl-C in the Docker console.

Next steps

Last modified: 18 October 2021