Skip to content

chore: activate more eslint imports and jsdoc rules#7213

Merged
BridgeAR merged 6 commits intomasterfrom
BridgeAR/2026-01-10-more-eslint-rules
Jan 12, 2026
Merged

chore: activate more eslint imports and jsdoc rules#7213
BridgeAR merged 6 commits intomasterfrom
BridgeAR/2026-01-10-more-eslint-rules

Conversation

@BridgeAR
Copy link
Copy Markdown
Member

This sorts the imports (a lot of former code was changed before in that direction) and adds stricter type rules.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jan 11, 2026

Overall package size

Self size: 4.39 MB
Deduped: 5.21 MB
No deduping: 5.21 MB

Dependency sizes | name | version | self size | total size | |------|---------|-----------|------------| | import-in-the-middle | 2.0.0 | 68.46 kB | 797.03 kB | | dc-polyfill | 0.1.10 | 26.73 kB | 26.73 kB |

🤖 This report was automatically generated by heaviest-objects-in-the-universe

@codecov
Copy link
Copy Markdown

codecov Bot commented Jan 11, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.55%. Comparing base (ecce729) to head (0be0526).
⚠️ Report is 4 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #7213   +/-   ##
=======================================
  Coverage   84.55%   84.55%           
=======================================
  Files         532      532           
  Lines       22641    22642    +1     
=======================================
+ Hits        19144    19145    +1     
  Misses       3497     3497           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@pr-commenter
Copy link
Copy Markdown

pr-commenter Bot commented Jan 11, 2026

Benchmarks

Benchmark execution time: 2026-01-11 15:32:28

Comparing candidate commit 0be0526 in PR branch BridgeAR/2026-01-10-more-eslint-rules with baseline commit ecce729 in branch master.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 286 metrics, 34 unstable metrics.

@BridgeAR BridgeAR marked this pull request as ready for review January 11, 2026 15:22
@BridgeAR BridgeAR requested review from a team as code owners January 11, 2026 15:22
@BridgeAR BridgeAR requested review from khanayan123 and removed request for a team January 11, 2026 15:22
Copy link
Copy Markdown
Member

@simon-id simon-id left a comment

Choose a reason for hiding this comment

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

I looked at appsec files and they looked ok, i assume the changes are ok for other files too

Copy link
Copy Markdown
Collaborator

@sabrenner sabrenner left a comment

Choose a reason for hiding this comment

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

lgtm! i just skimmed most of it and mostly just looked at the jsdoc updates, and had a couple questions out of curiosity, although the new types in the jsdocs look correct (the ones my team is codeowner for i had more context on, but some of the other jsdoc changes for other teams look reasonable as well as they seem inferred based on the methods they belong to)

Comment on lines +3 to +21
/**
* @typedef {Record<string, unknown>} JsonObject
*
* @typedef {{ function: { arguments: string } }} ToolCall
* @typedef {{ content?: string, tool_calls?: ToolCall[] }} ChatDelta
*
* @typedef {{
* index: number,
* finish_reason?: string | null,
* text?: string,
* delta?: ChatDelta
* }} StreamChoice
*
* @typedef {JsonObject & { choices: StreamChoice[], usage?: unknown }} StreamChunk
* @typedef {JsonObject & { choices: Array<StreamChoice | undefined>, usage?: unknown }} StreamResponseBody
*
* @typedef {JsonObject & { status?: string }} ResponsesApiResponse
* @typedef {JsonObject & { response?: ResponsesApiResponse }} ResponsesApiChunk
*/
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

just a question out of curiosity - was this the eslint auto-formatter adding these types as inferred from the method? or did either yourself or an llm write it inferred from the actual method? i think this looks correct though!

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

It is inferred by an llm from reading the code

Comment on lines +36 to +41
* @returns {SpanTags}
*/
function getSpanTags (ctx) {
const span = ctx.currentStore?.span
const carrier = ctx.attributes ?? span?.context()._tags ?? {}
return carrier
return /** @type {SpanTags} */ (carrier)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

also just out of curiosity (possibly just a knowledge gap), do we need both the @returns in the jsdoc and a "typecast" of /** @type {SpanTags} */, or is just the @returns ok?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

ah, is it maybe because the span?.context()._tags might not be typed correctly in its return value, so we want to cast in case?

Copy link
Copy Markdown
Member Author

@BridgeAR BridgeAR Jan 12, 2026

Choose a reason for hiding this comment

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

Yes, while that actually looks like a bug to cast it. I'll merge it now, but I think we have to continue working on our types anyway a lot, so this could be looked at again a tad later.

@BridgeAR BridgeAR merged commit d27d8df into master Jan 12, 2026
795 checks passed
@BridgeAR BridgeAR deleted the BridgeAR/2026-01-10-more-eslint-rules branch January 12, 2026 20:39
@dd-octo-sts dd-octo-sts Bot mentioned this pull request Jan 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants