ワンクリックで
build
// Build pipeline for SonarJS. Use when asked to build the project, regenerate metadata, understand the build pipeline, or run npm build scripts.
// Build pipeline for SonarJS. Use when asked to build the project, regenerate metadata, understand the build pipeline, or run npm build scripts.
Use before a SonarJS release or when the Peach Main Analysis workflow on SonarSource/peachee-js shows failed jobs or suspicious project issue-count drops that need triage. Classify failed Peach jobs and flag likely project-configuration regressions using docs/peach-main-analysis.md.
Use before a SonarJS release or when the Peach Main Analysis workflow on SonarSource/peachee-js shows failed jobs or suspicious project issue-count drops that need triage. Classify failed Peach jobs and flag likely project-configuration regressions using docs/peach-main-analysis.md.
Provides guidance on implementing and fixing SonarJS rules. Use also when tracing false positives, working with rule configuration, or understanding native vs external rule implementations.
Add or modify rule options in SonarJS, including the fields array, SonarQube UI visibility, and Java check class configuration. Use when working on rule configurations.
Provides test quality standards and best practices. Use when writing test cases, creating unit tests, implementing tests, or refining/reviewing test code. Essential for test generation and test refinement phases.
Provides JavaScript/TypeScript helper functions and utilities for SonarJS rule implementation. Use when implementing rule fixes, searching for existing utilities, or needing to check available helper functions.
| name | build |
| description | Build pipeline for SonarJS. Use when asked to build the project, regenerate metadata, understand the build pipeline, or run npm build scripts. |
npm ci # Install dependencies
npx tsc -b packages # Quickest way to spot compilation errors (no output generated)
npm run bbf # Fast JS/TS build (no tests): clear lib + generate-meta + compile
npm run generate-meta # Regenerate generated-meta.ts files from RSPEC JSON
npm run generate-java-rule-classes # Regenerate Java check classes
mvn install -DskipTests # Full Maven build without tests
mvn clean install # Full clean build with tests
| Goal | Command |
|---|---|
| After editing rule TS code | npm run bbf |
After modifying config.ts or meta.ts | npm run generate-meta && npm run bbf |
After modifying fields array | npm run generate-meta && npm run generate-java-rule-classes |
| Full plugin build | mvn install -DskipTests |
npm run bbf (bridge:build:fast)bbf
├── rimraf lib/*
├── npm run generate-meta # RSPEC JSON → generated-meta.ts per rule
└── npm run bridge:compile # tsgo TypeScript compilation
npm run generate-metaReads RSPEC metadata from:
sonar-plugin/javascript-checks/src/main/resources/org/sonar/l10n/javascript/rules/javascript/
Writes to (gitignored):
packages/analysis/src/jsts/rules/SXXXX/generated-meta.ts
sonar-plugin/javascript-checks/src/main/resources/, runs generate-java-rule-classesnpm run bbf (which includes generate-meta)Remote RSPEC repo
↓ (rspec-maven-plugin, gitignored)
resources/rule-data/
↓ (npm run deploy-rule-data, committed)
sonar-plugin/javascript-checks/src/main/resources/…/javascript/*.json
↓ (npm run generate-meta, gitignored)
packages/analysis/src/jsts/rules/SXXXX/generated-meta.ts
Key: The sonar-plugin/javascript-checks/src/main/resources/…/javascript/ directory is committed (526 files). It is the source of truth for generate-meta.
| Path | Status |
|---|---|
resources/rule-data/ | Gitignored (fresh RSPEC download) |
sonar-plugin/javascript-checks/src/main/resources/…/javascript/*.json | Committed |
packages/analysis/src/jsts/rules/*/generated-meta.ts | Gitignored |
lib/ | Gitignored |
mvn clean install -P coverage-report # With JaCoCo coverage
SONARSOURCE_QA=true mvn clean install # With integration tests (qa profile)
npm run bridge:test or npm run ruling — they take too long; if needed, run specific unit tests with npx tsx --test $test_filegenerated-meta.ts files are auto-generated; do not edit manuallysonar-plugin/javascript-checks/ are auto-generated; CSS check classes are also auto-generatedGITHUB_TOKEN env var with read access to SonarSource/rspec for Maven builds