Registry / testing / eslint-config-sonarqube

eslint-config-sonarqube

JSON →
library2.1.3jsnpmunverified

ESLint shareable config for SonarCloud/SonarQube analysis. Version 2.1.3, released as needed. Includes rules for TypeScript, React, Jest, and accessibility. Requires manual installation of all peer dependencies. Differentiator: official SonarSource config that matches SonarQube's built-in analysis; unlike other configs, it enforces Sonar's exact rule set.

npm install eslint-config-sonarqube
INSTALL
IMPORT
SIG · ESLINT-CONFIG-SONA
E
eslint-config-sonarqube
testingjavascriptv2.1.3
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.

config
Put in .eslintrc: { "extends": "sonarqube" }
No explicit import/require – just add to ESLint config via extends
This config is not a module – it's used via ESLint's extends mechanism. No JavaScript/TypeScript import needed.

Installs all peer dependencies and configures ESLint to extend sonarqube config.

# Install all peer deps and config yarn add --dev \ @typescript-eslint/eslint-plugin \ @typescript-eslint/parser \ eslint \ eslint-config-sonarqube \ eslint-plugin-import \ eslint-plugin-jest \ eslint-plugin-jest-dom \ eslint-plugin-jsx-a11y \ eslint-plugin-promise \ eslint-plugin-testing-library \ eslint-plugin-react \ eslint-plugin-react-hooks # Then in .eslintrc.json: { "extends": "sonarqube", "rules": { // optional overrides } }
Debug
Known issues
gotchaAll peer dependencies must be manually installed – not automatically installed by npm/yarn when using older versions or pnpm.
fix
Install all listed peer deps explicitly, or use npm>=7 auto-install (works with npm v7+). For pnpm, add each package to devDependencies.
affects: >=2.0.0
deprecatedThis config is tightly coupled to the rules used in SonarQube analysis. Future SonarQube versions may deprecate or add rules, so keep the config version aligned.
fix
Check CHANGELOG.md for rule changes when upgrading config version.
affects: >=2.0.0
gotchaUsing this config may cause rule conflicts with other ESLint configs if composed incorrectly.
fix
Use ESLint's override pattern or carefully order configs; see documentation for composing configs.
affects: >=2.0.0
Errors
Common errors & fixes
Error: Cannot find module 'eslint-plugin-import'
Missing peer dependency.
fix
Install eslint-plugin-import or add it to devDependencies.
Configuration for rule "react/jsx-no-target-blank" is invalid
Conflicting rule configurations from multiple configs.
fix
Check if another config (e.g., airbnb) sets the same rule and override or reorder configs.
Oops! Something went wrong! :( ESLint: 8.0.0 ESLint config extends: sonarqube - failed to load
eslint-config-sonarqube not installed or version mismatch.
fix
Ensure eslint-config-sonarqube is listed in devDependencies and installed.
Upgrade
Version history
2.1.3latest on npm
Audit
Dependencies
eslintrequiredpeer dependency – required to run ESLint
@typescript-eslint/eslint-pluginrequiredpeer dependency – TypeScript rules
@typescript-eslint/parserrequiredpeer dependency – TypeScript parser
eslint-plugin-importrequiredpeer dependency – import rules
eslint-plugin-jestrequiredpeer dependency – Jest rules
eslint-plugin-jest-domrequiredpeer dependency – jest-dom rules
eslint-plugin-jsx-a11yrequiredpeer dependency – JSX accessibility rules
eslint-plugin-promiserequiredpeer dependency – Promise rules
eslint-plugin-reactrequiredpeer dependency – React rules
eslint-plugin-react-hooksrequiredpeer dependency – React Hooks rules
eslint-plugin-testing-libraryrequiredpeer dependency – testing-library rules
Agent activity
2 hits · last 30 days
node
2
Resources
eslint-config-sonarqube — npm install eslint-config-sonarqube · libregistry