rule-options

Configure and modify SonarJS rule options for SonarQube and gRPC integration.

1.3k|191|Updated May 15, 2012
One-click install
npx skills add https://github.com/SonarSource/SonarJS --skill rule-options
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rule-options
Source: https://github.com/SonarSource/SonarJS/tree/main/.claude/skills/rule-options
Command: npx skills add https://github.com/SonarSource/SonarJS --skill rule-options

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill provides a detailed guide on how to add or modify rule options in SonarJS, enabling precise control over the code quality and security analysis.

Core Features & Use Cases

  • Rule Option Configuration: Detailed instructions on managing fields array, UI visibility, and Java check class configuration.
  • Architecture Overview: Understand the rule options flow through SonarQube and gRPC for different integration paths.
  • Key Files: Understand the purpose of files like rule.ts, meta.ts, config.ts, and generated-meta.ts.
  • Fields Array: Learn about the fields array in config.ts and how it defines options for SonarQube integration.
  • Visibility in SonarQube: Make options visible in SonarQube UI by providing descriptions.
  • Configuration Shapes: Explore object-style and primitive configurations for ESLint and SonarQube.
  • Type Parsing: Understand how gRPC parses string params based on default types.
  • JSON Schema vs fields: Differentiate between JSON Schema and fields for ESLint validation and SQ UI integration.
  • Adding Options to an Existing Rule: Step-by-step process to add options to a rule.
  • Java Check Class: Learn about the configurations() method in Java check classes.

Quick Start

Use the rule-options skill to get started with configuring SonarJS rules and enhancing code quality.

Frequently Asked Questions about rule-options

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

FAQPage Schema
How do I configure SonarJS rule options to be visible in the SonarQube UI?

You make rule options visible in the SonarQube UI by configuring the `fields` array in `config.ts` and providing explicit descriptions for each option to ensure proper UI integration.

What is the difference between JSON Schema and the fields array for SonarJS rule configuration?

JSON Schema handles ESLint validation, whereas the `fields` array in `config.ts` defines options specifically for SonarQube UI integration and visibility.

How does gRPC parse string parameters for SonarJS rule options?

gRPC parses string parameters for rule options based on their default types, automatically converting strings into object-style or primitive configuration shapes.

How do I add options to an existing SonarJS rule using Java check classes?

You add options to an existing rule by updating the `fields` array in `config.ts` and implementing the `configurations()` method within your Java check class.