Skip to content

feat: map .cjs to JavaScript and .mts/.cts to TypeScript - #111

Open
alerizzo wants to merge 1 commit into
masterfrom
feat/js-ts-module-extensions
Open

alerizzo wants to merge 1 commit into
masterfrom
feat/js-ts-module-extensions

Conversation

@alerizzo

Copy link
Copy Markdown
Contributor

Summary

  • Adds Node's explicit module-format extensions: .cjs to Javascript (next to the already mapped .mjs) and .mts/.cts to TypeScript.
  • Files with these extensions weren't recognised as JavaScript/TypeScript, so no tool for those languages analyzed them in Codacy, and results the Codacy Analysis CLI uploaded for them weren't shown. Found on codacy/analysis-cli-action, whose scripts/count-issues.cjs was invisible to language detection both locally and in Cloud.
  • The language map is duplicated in ragnaros (components/language/.../Language.scala), which gets the same change in a companion PR. The Analysis CLI's copy is generated from /api/v3/languages/tools, so it follows once Cloud serves the new extensions.

Test plan

  • sbt scalafmtCheckAll
  • sbt "++2.13 testOnly *LanguageSpec": new case forPath resolves the Node.js module-format extensions (6/6 passing on JVM and Native)

🤖 Generated with Claude Code

Node's explicit module-format extensions were missing: .cjs (CommonJS)
next to the already mapped .mjs, and their TypeScript counterparts
.mts/.cts. Files with them were not recognised as JavaScript/TypeScript,
so no tool for those languages analyzed them, and results uploaded for
them by the Codacy Analysis CLI were not shown.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity · 0 duplication

Metric Results
Complexity 0
Duplication 0

View in Codacy

AI Reviewer: first review requested successfully. AI can make mistakes. Always validate suggestions.

Run reviewer

TIP This summary will be updated as you push new changes.

@codacy-production codacy-production Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

✅ No blocking issues noticed

No blocking findings. The reviewed changes have no reported logic, security, quality, or requirement-alignment issues.

Test suggestions

  • A .cjs path resolves to JavaScript.
  • A .mts path resolves to TypeScript.
  • A .cts path resolves to TypeScript.

TIP How was this review? Give us feedback

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant