Contribute to help us improve!
Are there edge cases or problems that we didn't consider? Is there a technical pitfall that we should add? Did we miss a comma in a sentence?
If you have any input for us, we would love to hear from you and appreciate every contribution. Our goal is to learn from projects for projects such that nobody has to reinvent the wheel.
Let's collect our experiences together to make room to explore the novel!
To contribute click on Contribute to this page on the toolbar.
Importing your ESLint reports into SonarQube
This guide covers the import of ESLint reports into SonarQube instances in CI environments, as this is the recommended way of using ESLint and SonarQube for devon4node projects. The prerequisites for this process are a CI environment, preferably a Production Line instance, and the ESLint CLI, which is already included when generating a new devon4node project.
Configuring the ESLint analysis
You can configure the ESLint analysis parameters in the .eslintrc.js
file inside the top-level directory of your project. If you created your node project using the devon4node application schematic, this file will already exist. If you want to make further adjustments to it, have a look at the ESLint documentation.
The ESLint analysis script lint
is already configured in the scripts
part of your package.json
. Simply add -f json > report.json
, so that the output of the analysis is saved in a .json file. Additional information to customization options for the ESLint CLI can be found here.
To run the analysis, execute the script with npm run lint
inside the base directory of your project.
Configuring SonarQube
If you haven’t already generated your CICD-related files, follow the tutorial on the devon4node schematic of our CICDGEN project, as you will need a Jenkinsfile configured in your project to proceed.
Inside the script for the SonarQube code analysis in your Jenkinsfile, add the parameter -Dsonar.eslint.reportPaths=report.json
. Now, whenever a SonarQube analysis is triggered by your CI environment, the generated report will be loaded into your SonarQube instance.
To avoid duplicated issues, you can associate an empty TypeScript quality profile with your project in its server configurations.