Skip to content

Conversation

@jakebailey
Copy link
Member

We've had two ways to include things from /.lib; @libFiles: react.d.ts and /// <reference path="/.lib/react.d.ts" />. We use the former 93 times, and the latter 220 times.

I think it'd be best to get rid of this special option and just use plain references, now that we don't use @libFiles: lib.d.ts after #63056.

Only sucky thing is that it changes positions and therefore a lot of baselines change.

Copilot AI review requested due to automatic review settings January 28, 2026 20:14
@github-project-automation github-project-automation bot moved this to Not started in PR Backlog Jan 28, 2026
@typescript-bot typescript-bot added Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug labels Jan 28, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR removes the @libFiles compiler test runner option in favor of using standard /// <reference path="/.lib/..." /> directives. This consolidates the two methods previously available for including library files from /tests/lib, standardizing on the reference directive approach which was already more widely used (220 times vs 93 times for @libFiles).

Changes:

  • Removed libFiles option from test harness infrastructure
  • Updated test baselines to reflect new reference directive positioning
  • Modified baseline output to preserve full test paths instead of removing prefixes

Reviewed changes

Copilot reviewed 300 out of 497 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/harness/harnessIO.ts Removed libFiles option from test harness and updated file output formatting
tests/baselines/reference/*.errors.txt Updated error line numbers due to added reference directives
tests/baselines/reference/*.types Updated type baseline line numbers
tests/baselines/reference/*.symbols Updated symbol baseline line numbers
tests/baselines/reference/*.js Added /// <reference path="/.lib/..." /> directives to compiled output


function fileOutput(file: documents.TextDocument, harnessSettings: TestCaseParser.CompilerSettings): string {
const fileName = harnessSettings.fullEmitPaths ? Utils.removeTestPathPrefixes(file.file) : ts.getBaseFileName(file.file);
return "//// [" + fileName + "]\r\n" + Utils.removeTestPathPrefixes(file.text);
Copy link
Member Author

@jakebailey jakebailey Jan 28, 2026

Choose a reason for hiding this comment

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

This was mistakenly changing paths in emitted reference directives, leaving them in a confusingly broken state. See the first commit for examples.


//// [jsxDeclarationsWithEsModuleInteropNoCrash.d.ts]
/// <reference path="..react16.d.ts" preserve="true" />
/// <reference path="../.lib/react16.d.ts" preserve="true" />
Copy link
Member Author

Choose a reason for hiding this comment

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

This was broken before due to an overzealous replacement.

@github-project-automation github-project-automation bot moved this from Not started to Needs merge in PR Backlog Jan 28, 2026
@jakebailey jakebailey enabled auto-merge January 28, 2026 20:34
@jakebailey jakebailey added this pull request to the merge queue Jan 28, 2026
Merged via the queue into microsoft:main with commit c1592ad Jan 28, 2026
33 checks passed
@jakebailey jakebailey deleted the remove-libFiles branch January 28, 2026 21:05
@github-project-automation github-project-automation bot moved this from Needs merge to Done in PR Backlog Jan 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants