Skip to content

Conversation

@TkDodo
Copy link
Collaborator

@TkDodo TkDodo commented Nov 24, 2025

This ensures .js and .mjs files are type-checked (with jsdoc comments) per default.

We’ll need this more when e.g. writing custom eslint rules, as they have to be .mjs because we don’t have a typescript transform pipeline and eslint can’t natively read ts.

see:

@TkDodo TkDodo marked this pull request as ready for review November 24, 2025 13:20
@TkDodo TkDodo requested review from a team as code owners November 24, 2025 13:20
@TkDodo TkDodo requested a review from a team November 24, 2025 13:20
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Nov 24, 2025
"compilerOptions": {
"allowJs": true
"allowJs": true,
"checkJs": true,
Copy link

Choose a reason for hiding this comment

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

Bug: Enabling checkJs: true causes type-checking failures in tests/js/sentry-test/mocks/ due to missing JSDoc annotations and noImplicitAny: true.
Severity: CRITICAL | Confidence: High

🔍 Detailed Analysis

With checkJs: true enabled and noImplicitAny: true in the base configuration, TypeScript will enforce type annotations on JavaScript files. Unmodified mock files in tests/js/sentry-test/mocks/ will fail type-checking because they use module.exports without JSDoc @type annotations, leading to implicit any types which are forbidden. This will cause the TypeScript build to fail, blocking CI/CD pipelines.

💡 Suggested Fix

Add JSDoc @type annotations to module.exports in .js files within tests/js/sentry-test/mocks/ to satisfy noImplicitAny: true.

🤖 Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.

Location: tsconfig.json#L5

Potential issue: With `checkJs: true` enabled and `noImplicitAny: true` in the base
configuration, TypeScript will enforce type annotations on JavaScript files. Unmodified
mock files in `tests/js/sentry-test/mocks/` will fail type-checking because they use
`module.exports` without JSDoc `@type` annotations, leading to implicit `any` types
which are forbidden. This will cause the TypeScript build to fail, blocking CI/CD
pipelines.

Did we get this right? 👍 / 👎 to inform future reviews.
Reference ID: 3228632

@TkDodo TkDodo merged commit c6ea746 into master Nov 24, 2025
50 checks passed
@TkDodo TkDodo deleted the tkdodo/ref/checkjs branch November 24, 2025 16:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants