Registry / testing / eslint-formatter-sonarqube

eslint-formatter-sonarqube

JSON →
library1.0.0jsnpmunverified

An ESLint custom formatter that outputs lint results in JSON format compatible with SonarQube 7.4+ external analyzer feature. Current stable version is 1.0.0. The tool converts ESLint results into a JSON structure that SonarQube can import as external issues. It is specifically designed for SonarQube 7.4+ and requires no additional dependencies. The formatter is used by passing it as the -f flag to ESLint CLI and outputting to a file referenced in sonar-project.properties.

npm install eslint-formatter-sonarqube
INSTALL
IMPORT
SIG · ESLINT-FORMATTER-S
E
eslint-formatter-sonarqube
testingjavascriptv1.0.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

formatter
require('eslint-formatter-sonarqube')
import formatter from 'eslint-formatter-sonarqube'
This package does not support ESM import; use CommonJS require in your ESLint config or CLI.
CLI usage
eslint -f node_modules/eslint-formatter-sonarqube -o output.json src/
eslint --format sonarqube src/
The formatter must be referenced by its full module path; short name 'sonarqube' is not registered. Use node_modules prefix or relative path.
SonarQube property
sonar.externalIssuesReportPaths=output.json
sonar.issuesReportPaths=output.json
Use 'sonar.externalIssuesReportPaths' (introduced in SonarQube 7.4) not 'sonar.issuesReportPaths'.

Install the formatter, run ESLint with the formatter to produce a SonarQube-compatible report, then configure SonarQube to import the report.

// 1. Install npm install eslint-formatter-sonarqube --save-dev // 2. Run ESLint with formatter npx eslint -f node_modules/eslint-formatter-sonarqube -o sonar-report.json src/ // 3. Add to sonar-project.properties // sonar.externalIssuesReportPaths=sonar-report.json // 4. Run SonarQube scan (requires SonarQube 7.4+) sonar-scanner
Debug
Known issues
breakingWorks only with SonarQube 7.4+ (external analyzer feature). Earlier versions not supported.
fix
Upgrade SonarQube to 7.4+ or use a different formatter.
affects: >=1.0.0
gotchaThe formatter must be passed via full module path (e.g., node_modules/eslint-formatter-sonarqube) not a short name.
fix
Use -f node_modules/eslint-formatter-sonarqube (or relative path) in ESLint CLI.
affects: >=1.0.0
gotchaThe output JSON file path must match the value of sonar.externalIssuesReportPaths exactly.
fix
Ensure the -o path and the property value are identical relative to the project root.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Cannot find module 'eslint-formatter-sonarqube'
The formatter is not installed or the path is incorrect.
fix
Run 'npm install eslint-formatter-sonarqube --save-dev' or use the full path (e.g., node_modules/eslint-formatter-sonarqube).
Invalid formatter 'sonarqube'
Using short name 'sonarqube' instead of module path.
fix
Use -f node_modules/eslint-formatter-sonarqube or -f ./node_modules/eslint-formatter-sonarqube.
sonar.externalIssuesReportPaths: file not found
The output file path does not exist or is incorrect.
fix
Ensure the path in sonar.externalIssuesReportPaths matches the -o path from ESLint, relative to project root.
Upgrade
Version history
1.0.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
2 hits · last 30 days
node
2
Resources
eslint-formatter-sonarqube — npm install eslint-formatter-sonarqube · libregistry