{"enrichment":{"faq":[{"a":"sonarjs integrates SonarJS-derived rules into ESLint by installing eslint-plugin-sonarjs and extending your ESLint config. Add `\"plugin:sonarjs/recommended\"` to your `.eslintrc` extends array, then enable specific rules under the `sonarjs/` namespace. This gives you cognitive complexity checks, bug-prone pattern detection, and code smell warnings alongside standard ESLint rules in your local developer loop.","q":"How do I add sonarjs rules to eslint?"},{"a":"sonarjs measures cognitive complexity\u2014how hard code is to understand\u2014using rules like `sonarjs/cognitive-complexity`. This counts nested conditionals, loops, and other branching constructs. sonarjs flags functions exceeding your threshold (often 15), helping you refactor complex JavaScript or TypeScript before it becomes unmaintainable. You can configure thresholds per rule in your ESLint config.","q":"What is sonarjs cognitive complexity and how do I measure it?"},{"a":"Yes. sonarjs works in .NET repositories that ship JavaScript or TypeScript frontends. Install eslint-plugin-sonarjs in your frontend folder, configure ESLint to scan your JS/TS source, and run it in your CI pipeline or local workflow. For deeper analysis, you can also integrate SonarQube or SonarCloud at the repository level to gate on sonarjs findings alongside .NET code quality.","q":"Can sonarjs be used in a .NET project with frontend assets?"},{"a":"sonarjs detects frontend code smells like unused variables, unreachable code, and overly complex conditionals. Bug-prone patterns include misused `this` binding, incorrect Promise handling, and suspicious comparisons. These rules surface maintainability issues and potential runtime errors that basic linting misses, helping you catch defects early in JavaScript or TypeScript.","q":"What code smells and bug-prone patterns does sonarjs detect?"},{"a":"sonarjs offers a lightweight local option: eslint-plugin-sonarjs runs in your developer loop and CI without extra infrastructure. SonarQube or SonarCloud provide centralized, server-side analysis across multiple languages and richer reporting. For frontend-only checks and fast feedback, use sonarjs; for whole-repository gates and historical tracking, add SonarQube or SonarCloud alongside it.","q":"Should I use sonarjs eslint plugin or SonarQube for my .NET repo?"},{"a":"sonarjs extends your existing ESLint config by adding the plugin and rules. Install `eslint-plugin-sonarjs`, add it to your plugins array, and extend `plugin:sonarjs/recommended` or enable individual rules. Then run ESLint as usual\u2014sonarjs rules fire alongside your other linting rules. No separate tool or configuration file needed; it integrates directly into your ESLint workflow.","q":"How do I configure sonarjs in my existing ESLint setup?"}],"shadow_tags":["code-quality-gate","maintainability-scoring","complexity-analysis","frontend-linting","bug-detection","dotnet-integration"],"summary_rewrite":"sonarjs integrates SonarJS-derived rules into ESLint for .NET repositories shipping JavaScript or TypeScript frontends. It surfaces cognitive complexity limits, bug-prone patterns, and maintainability issues beyond baseline linting, supporting both local developer workflows via eslint-plugin-sonarjs and server-side SonarQube or SonarCloud gates."},"files":[{"bytes":6504,"path":"catalog/Tools/SonarJS/skills/sonarjs/SKILL.md","sha256":"d28c2c3323c765f35283a283e1b50234e034d89435c02ebaeb0fbb123a2cd00f","url":"https://skillfed.io/files/managedcode/dotnet-skills/sonarjs/f64c0233/SKILL.md"}],"id":"managedcode/dotnet-skills/sonarjs","links":{"html":"https://skillfed.io/managedcode/dotnet-skills/sonarjs","md":"https://skillfed.io/managedcode/dotnet-skills/sonarjs.md","repo":"https://github.com/managedcode/dotnet-skills"},"meta":{"agents_supported":[],"first_seen":"2026-07-28","forks":35,"language":"C#","last_updated":"2026-07-25","license":"MIT","name":"sonarjs","publisher":"managedcode","stars":463},"relations":{"similar":[{"id":"managedcode/dotnet-skills/quality-ci"},{"id":"managedcode/dotnet-skills/eslint"},{"id":"managedcode/dotnet-skills/metalint"},{"id":"giuseppe-trisciuoglio/developer-kit/sonarqube-mcp"},{"id":"managedcode/dotnet-skills/biome"},{"id":"managedcode/dotnet-skills/htmlhint"},{"id":"managedcode/dotnet-skills/webhint"},{"id":"managedcode/dotnet-skills/stylelint"},{"id":"managedcode/dotnet-skills/dotnet"},{"id":"managedcode/dotnet-skills/chous"}]},"slug":{"owner":"managedcode","repo":"dotnet-skills","skill":"sonarjs"},"version":"f64c0233"}
