Thanks to visit codestin.com
Credit goes to github.com

Skip to content

chore: add explicit "types" to tsconfig files#6758

Open
trentm wants to merge 1 commit into
open-telemetry:mainfrom
trentm:trentm-tsconfig-explicit-types
Open

chore: add explicit "types" to tsconfig files#6758
trentm wants to merge 1 commit into
open-telemetry:mainfrom
trentm:trentm-tsconfig-explicit-types

Conversation

@trentm
Copy link
Copy Markdown
Contributor

@trentm trentm commented May 22, 2026

We use typescript v5 for compilation. However, sometimes external
tooling like an IDE will, by default, use the latest TS version for
editor support (like "squigglies" for lint/problems). This is the
case for VS Code and TS v6.

TS v6 changed the "types" tsconfig setting to default to [].
https://devblogs.microsoft.com/typescript/announcing-typescript-6-0/#types-now-defaults-to-[]
It previously defaulted to "enumerate everything in node_modules/@types".

As (mild) preparation for eventually migrating to TS v6 and
to be nice to developers whose IDE or other tool defaults to using TS
v6, let's explicitly list our "types".

I don't believe there is a downside to this, other than needing
to add "types" entries as usage changes.

We use typescript v5 for compilation. However, sometimes external
tooling like an IDE will, by default, use the latest TS version for
editor support (like "squigglies" for lint/problems). This is the
case for VS Code and TS v6.

TS v6 changed the "types" tsconfig setting to default to `[]`.
  https://devblogs.microsoft.com/typescript/announcing-typescript-6-0/#types-now-defaults-to-[]
It previously defaulted to "enumerate everything in node_modules/@types".

As (mild) preparation for eventually migrating to TS v6 and
to be nice to developers whose IDE or other tool defaults to using TS
v6, let's explicitly list our "types".

I don't believe there is a downside to this, other than needing
to add "types" entries as usage changes.
@trentm trentm self-assigned this May 22, 2026
@trentm trentm requested review from a team as code owners May 22, 2026 23:31
@codecov
Copy link
Copy Markdown

codecov Bot commented May 22, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.95%. Comparing base (4fdbfdd) to head (c403e6d).
⚠️ Report is 52 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6758      +/-   ##
==========================================
+ Coverage   94.78%   94.95%   +0.17%     
==========================================
  Files         374      377       +3     
  Lines       12439    12743     +304     
  Branches     2841     2896      +55     
==========================================
+ Hits        11790    12100     +310     
+ Misses        649      643       -6     

see 25 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 Author

trentm commented May 22, 2026

This is what I'm referring to:

Screenshot 2026-05-22 at 4 15 29 PM

sometimes external
tooling like an IDE will, by default, use the latest TS version

This is, of course, configurable -- at least in VS Code via the @command:typescript.selectTypeScriptVersion command.
A possible position here is to say: developers, configure your tools.
However, I find that pretty tedious. At least personally I have dozens of git clones of this and contrib repo that I work in regularly. I'd need to configure VS Code local settings in each.

Or we could add .vscode/settings.json to the repo... but I don't particularly want to go there.

Copy link
Copy Markdown
Contributor

@overbalance overbalance left a comment

Choose a reason for hiding this comment

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

upgrade to 7 👹

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.

2 participants