eslint-plugin-sonarjs

Scan JavaScript and TypeScript code for code smells and bug patterns.

Updated May 23, 2026
One-click install
npx skills add https://github.com/matthewharwood/dean-n-dean --skill eslint-plugin-sonarjs
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: eslint-plugin-sonarjs
Source: https://github.com/matthewharwood/dean-n-dean/tree/main/.agents/skills/eslint-plugin-sonarjs
Command: npx skills add https://github.com/matthewharwood/dean-n-dean --skill eslint-plugin-sonarjs

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It helps teams find hidden code smells and bug-prone patterns (like excessive complexity, dead branches, and risky nesting) before they land, using a fast local lint pass instead of a SonarQube server.

Core Features & Use Cases

  • Local second-opinion linting: Runs eslint-plugin-sonarjs as a targeted code-smell scan layered on top of Biome and Stylelint.
  • Zero-warning enforcement: Fails the check on any finding using --max-warnings 0, supporting a strict “gate-first” workflow.
  • Config and workflow ownership: Owns the per-app apps/<name>/eslint.sonar.config.mjs, the calibrated rule policy, and the PR workflow that runs check:sonar.

Quick Start

Run the workspace task that executes the sonarjs-enabled ESLint pass for the app you’re working on.

Frequently Asked Questions about eslint-plugin-sonarjs

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I catch JavaScript and TypeScript code smells without running a SonarQube server?

You can catch code smells locally by running eslint-plugin-sonarjs as a targeted scan to identify excessive complexity, dead branches, and bug patterns without needing a SonarQube server.

How do I configure a flat ESLint config to enforce zero warnings for code smells?

Configure a flat ESLint config that loads only `sonarjs.configs.recommended` and run the scan with `--max-warnings 0` to strictly fail the check on any code smell finding.

Can I use eslint-plugin-sonarjs alongside Biome and Stylelint in my workflow?

Yes, eslint-plugin-sonarjs works alongside Biome and Stylelint as a targeted second-opinion linting layer to catch code smells and risky nesting patterns within your existing workflow.

Why does my CI check fail when diagnosing `bun run check:sonar` failures?

Your CI check fails because the PR workflow runs the `check:sonar` script with `--max-warnings 0`, strictly failing the pipeline whenever any sonarjs code smell finding is detected.

What is cognitive complexity detection and when do I need it for static analysis?

Cognitive complexity detection is a static analysis technique measuring code readability, needed during app authoring and CI validation to enforce maintainability standards and catch bug-prone patterns.

Are there limitations to using local static analysis instead of a full SonarQube server?

Local eslint-plugin-sonarjs static analysis is limited to recommended rules for JavaScript and TypeScript, lacking the deeper server-side analytics, historical tracking, and project-level dashboards of a full SonarQube instance.