Skip to content

chore: enforce consistent type imports#6467

Merged
overbalance merged 5 commits intoopen-telemetry:mainfrom
embrace-io:overbalance/enforce-type-imports
Mar 4, 2026
Merged

chore: enforce consistent type imports#6467
overbalance merged 5 commits intoopen-telemetry:mainfrom
embrace-io:overbalance/enforce-type-imports

Conversation

@overbalance
Copy link
Copy Markdown
Contributor

@overbalance overbalance commented Mar 3, 2026

Summary

  • Add @typescript-eslint/consistent-type-imports rule to eslint.base.js with fixStyle level to enforce import type syntax for type-only imports across the repo
  • Apply automated lint fixes across all ts files, converting regular imports to type imports where appropriate

Test plan

  • npm run lint:fix passes

Copy link
Copy Markdown
Contributor

@trentm trentm left a comment

Choose a reason for hiding this comment

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

One Q.
This looks great though -- from a preliminary look.

Comment thread eslint.base.js Outdated
Comment thread api/src/api/metrics.ts
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 3, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.70%. Comparing base (253fec6) to head (2526d85).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6467   +/-   ##
=======================================
  Coverage   95.70%   95.70%           
=======================================
  Files         364      364           
  Lines       11774    11774           
  Branches     2747     2747           
=======================================
  Hits        11268    11268           
  Misses        506      506           
Files with missing lines Coverage Δ
api/src/api/context.ts 91.66% <ø> (ø)
api/src/api/diag.ts 100.00% <100.00%> (ø)
api/src/api/metrics.ts 88.88% <ø> (ø)
api/src/api/propagation.ts 100.00% <100.00%> (ø)
api/src/api/trace.ts 100.00% <ø> (ø)
api/src/baggage/context-helpers.ts 90.90% <ø> (ø)
api/src/baggage/utils.ts 100.00% <ø> (ø)
api/src/context/NoopContextManager.ts 100.00% <ø> (ø)
api/src/context/context.ts 80.00% <ø> (ø)
api/src/diag/ComponentLogger.ts 94.73% <ø> (ø)
... and 144 more

... and 58 files with indirect coverage changes

🚀 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.

@trentm
Copy link
Copy Markdown
Contributor

trentm commented Mar 3, 2026

Worth changelog entries? I don't have a strong feeling.

@overbalance
Copy link
Copy Markdown
Contributor Author

@trentm Added changelogs to be thorough

@overbalance overbalance marked this pull request as ready for review March 4, 2026 17:27
@overbalance overbalance requested review from a team as code owners March 4, 2026 17:27
@overbalance overbalance enabled auto-merge March 4, 2026 17:28
@overbalance overbalance requested a review from trentm March 4, 2026 17:29
@trentm
Copy link
Copy Markdown
Contributor

trentm commented Mar 4, 2026

Note to self: Some discussion/justification for this change is here: #6371 (comment)

Copy link
Copy Markdown
Contributor

@trentm trentm left a comment

Choose a reason for hiding this comment

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

LGTM. THanks!

@overbalance overbalance added this pull request to the merge queue Mar 4, 2026
Merged via the queue into open-telemetry:main with commit d9730b0 Mar 4, 2026
27 checks passed
@overbalance overbalance deleted the overbalance/enforce-type-imports branch March 4, 2026 19:00
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.

2 participants