This file provides guidance for Claude Code when working with the SonarJS repository.
SonarJS is a static code analyzer for JavaScript, TypeScript, and CSS, developed by SonarSource. It provides:
- JavaScript and TypeScript rules with advanced pattern matching and control flow analysis
- CSS rules for style analysis
- Integration with SonarQube and SonarCloud
- An ESLint plugin (
eslint-plugin-sonarjs)
SonarJS/
├── packages/ # TypeScript source code
│ ├── jsts/ # JS/TS analyzer (main rules)
│ │ ├── src/rules/ # Rule implementations (S100-S7xxx)
│ │ └── tests/ # Unit tests
│ ├── css/ # CSS analyzer
│ ├── bridge/ # Node.js ↔ SonarQube bridge server
│ ├── shared/ # Shared utilities
│ ├── html/ # HTML/Vue template support
│ └── yaml/ # YAML support
├── sonar-plugin/ # Maven-based Java plugin
│ ├── sonar-javascript-plugin/ # Main plugin artifact
│ ├── javascript-checks/ # Auto-generated Java check classes
│ └── ...
├── its/ # Integration tests
├── tools/ # Build and generation scripts
└── lib/ # Compiled bridge output (build artifact)
npm run bbf # Fast JS/TS build (no tests)
mvn install -DskipTests # Complete build without Java testsSee /build for the full build pipeline reference.
- 2 spaces indentation, LF line endings, single quotes, trailing commas
- Formatting enforced via pre-commit hooks
- Always add
SonarSource/quality-web-squadas a reviewer when creating PRs
generated-meta.tsfiles are auto-generated from RSPEC — do not edit manually- Java check classes in
sonar-plugin/javascript-checks/are auto-generated - Rules use ESLint's visitor pattern
- Keep docs up to date when changing build processes or workflows
- See
.claude/rules.mdfor rule development guidelines - See
.claude/skills/for task-specific skills:/build,/test-rule,/ruling,/new-rule,/rule-options,/rule-implementation,/helpers,/tests,/test-quality-standards