Peakiq Blog
15 December 2025

While linters like ESLint and formatters like Prettier are great, they only scratch the surface. SonarQube brings:
It's not about replacing your current tools — it's about supercharging them.
Let’s get practical — no fluff.
brew install sonar
sonar start
Visit: http://localhost:9000
Login with: admin / admin
You now have a running SonarQube server on your machine.
This is the CLI tool that connects your code to SonarQube:
brew install sonar-scanner
At the root of your React/React Native project, create:
touch sonar-project.properties
Add:
sonar.projectKey=my-awesome-app
sonar.projectName=My Awesome App
sonar.sources=src
sonar.exclusions=**/__tests__/**,**/*.test.js,**/*.spec.tsx
sonar.language=js
sonar.sourceEncoding=UTF-8
sonar.javascript.lcov.reportPaths=coverage/lcov.info
Build and test your app (especially if you use Jest):
npm run test -- --coverage
Then:
sonar-scanner
Boom — your dashboard will now light up with real-time code insights.
With modern React Native apps, we often deal with:
src/)So tweak the config:
sonar.sources=src
sonar.exclusions=android/**,ios/**,**/*.test.tsx
Use TypeScript + strict mode (tsconfig.json) to boost type safety — Sonar will respect it.
Want Sonar to show you what you’re not testing?
jest --coveragelcov.infosonar-project.propertiesYou’ll get heatmaps of untested components, perfect for spotting weak points.
Use tools like:
npm install husky lint-staged --save-dev
To automatically lint & format before every commit:
"lint-staged": {
"**/*.tsx": ["eslint --fix", "prettier --write"]
}
This way, your Sonar dashboard is always clean before merging code.
If you’re using GitHub Actions, Bitrise, or even Fastlane for React Native, integrate like this:
- name: SonarQube Scan
run: |
sonar-scanner \
-Dsonar.projectKey=my-awesome-app \
-Dsonar.sources=src \
-Dsonar.login=${{ secrets.SONAR_TOKEN }}
Store your token securely via SONAR_TOKEN.
Codebases grow fast. React projects sprawl. React Native multiplies platforms. Without active quality gates, you’re inviting chaos.
SonarQube doesn’t just point fingers — it creates a shared understanding of quality across your team.
And in 2025, that’s not just helpful — it’s essential.