Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposal: Types as Configuration #58025

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Accept baselines
  • Loading branch information
weswigham committed Apr 1, 2024
commit 50ab917acd6e628a960df4af38d3a2fff2b765d6
1 change: 1 addition & 0 deletions src/compiler/commandLineParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2117,6 +2117,7 @@ export function getParsedCommandLineOfConfigFile(
return parsedResult;
}

/** @internal */
export function loadConfigFromDefaultType(
configFileName: string,
): { configText: string, errors: Diagnostic[] } | undefined {
Expand Down
4 changes: 0 additions & 4 deletions tests/baselines/reference/api/typescript.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9291,10 +9291,6 @@ declare namespace ts {
* Reads the config file, reports errors if any and exits if the config file cannot be found
*/
function getParsedCommandLineOfConfigFile(configFileName: string, optionsToExtend: CompilerOptions | undefined, host: ParseConfigFileHost, extendedConfigCache?: Map<string, ExtendedConfigCacheEntry>, watchOptionsToExtend?: WatchOptions, extraFileExtensions?: readonly FileExtensionInfo[]): ParsedCommandLine | undefined;
function loadConfigFromDefaultType(configFileName: string, _optionsToExtend: CompilerOptions | undefined, _host: ParseConfigFileHost, _extendedConfigCache?: Map<string, ExtendedConfigCacheEntry>, _watchOptionsToExtend?: WatchOptions, _extraFileExtensions?: readonly FileExtensionInfo[]): {
configText: string;
errors: Diagnostic[];
} | undefined;
/**
* Read tsconfig.json file
* @param fileName The path to the config file
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ Info seq [hh:mm:ss:mss] request:
}
Info seq [hh:mm:ss:mss] Search path: /user/users/projects/myproject
Info seq [hh:mm:ss:mss] For info: /user/users/projects/myproject/index.ts :: No config files found.
Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /user/users/projects/myproject/tsconfig.d.ts 2000 undefined WatchType: Config file for the inferred project root
Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /user/users/projects/myproject/tsconfig.ts 2000 undefined WatchType: Config file for the inferred project root
Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /user/users/projects/myproject/tsconfig.js 2000 undefined WatchType: Config file for the inferred project root
Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /user/users/projects/myproject/tsconfig.json 2000 undefined WatchType: Config file for the inferred project root
Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /user/users/projects/myproject/jsconfig.json 2000 undefined WatchType: Config file for the inferred project root
Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /dev/null/inferredProject1*
Expand Down Expand Up @@ -116,8 +119,14 @@ After request
PolledWatches::
/user/users/projects/myproject/jsconfig.json: *new*
{"pollingInterval":2000}
/user/users/projects/myproject/tsconfig.d.ts: *new*
{"pollingInterval":2000}
/user/users/projects/myproject/tsconfig.js: *new*
{"pollingInterval":2000}
/user/users/projects/myproject/tsconfig.json: *new*
{"pollingInterval":2000}
/user/users/projects/myproject/tsconfig.ts: *new*
{"pollingInterval":2000}
/user/users/projects/node_modules/@types: *new*
{"pollingInterval":500}

Expand Down Expand Up @@ -238,8 +247,14 @@ After request
PolledWatches::
/user/users/projects/myproject/jsconfig.json:
{"pollingInterval":2000}
/user/users/projects/myproject/tsconfig.d.ts:
{"pollingInterval":2000}
/user/users/projects/myproject/tsconfig.js:
{"pollingInterval":2000}
/user/users/projects/myproject/tsconfig.json:
{"pollingInterval":2000}
/user/users/projects/myproject/tsconfig.ts:
{"pollingInterval":2000}
/user/users/projects/node_modules: *new*
{"pollingInterval":500}
/user/users/projects/node_modules/@types:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,14 @@ Info seq [hh:mm:ss:mss] request:
}
Info seq [hh:mm:ss:mss] Search path: /user/users/projects/myproject/some
Info seq [hh:mm:ss:mss] For info: /user/users/projects/myproject/some/index.ts :: No config files found.
Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /user/users/projects/myproject/some/tsconfig.d.ts 2000 undefined WatchType: Config file for the inferred project root
Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /user/users/projects/myproject/some/tsconfig.ts 2000 undefined WatchType: Config file for the inferred project root
Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /user/users/projects/myproject/some/tsconfig.js 2000 undefined WatchType: Config file for the inferred project root
Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /user/users/projects/myproject/some/tsconfig.json 2000 undefined WatchType: Config file for the inferred project root
Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /user/users/projects/myproject/some/jsconfig.json 2000 undefined WatchType: Config file for the inferred project root
Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /user/users/projects/myproject/tsconfig.d.ts 2000 undefined WatchType: Config file for the inferred project root
Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /user/users/projects/myproject/tsconfig.ts 2000 undefined WatchType: Config file for the inferred project root
Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /user/users/projects/myproject/tsconfig.js 2000 undefined WatchType: Config file for the inferred project root
Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /user/users/projects/myproject/tsconfig.json 2000 undefined WatchType: Config file for the inferred project root
Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /user/users/projects/myproject/jsconfig.json 2000 undefined WatchType: Config file for the inferred project root
Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /dev/null/inferredProject1*
Expand Down Expand Up @@ -142,10 +148,22 @@ PolledWatches::
{"pollingInterval":500}
/user/users/projects/myproject/some/node_modules/@types: *new*
{"pollingInterval":500}
/user/users/projects/myproject/some/tsconfig.d.ts: *new*
{"pollingInterval":2000}
/user/users/projects/myproject/some/tsconfig.js: *new*
{"pollingInterval":2000}
/user/users/projects/myproject/some/tsconfig.json: *new*
{"pollingInterval":2000}
/user/users/projects/myproject/some/tsconfig.ts: *new*
{"pollingInterval":2000}
/user/users/projects/myproject/tsconfig.d.ts: *new*
{"pollingInterval":2000}
/user/users/projects/myproject/tsconfig.js: *new*
{"pollingInterval":2000}
/user/users/projects/myproject/tsconfig.json: *new*
{"pollingInterval":2000}
/user/users/projects/myproject/tsconfig.ts: *new*
{"pollingInterval":2000}
/user/users/projects/node_modules/@types: *new*
{"pollingInterval":500}

Expand Down Expand Up @@ -273,10 +291,22 @@ PolledWatches::
{"pollingInterval":500}
/user/users/projects/myproject/some/node_modules/@types:
{"pollingInterval":500}
/user/users/projects/myproject/some/tsconfig.d.ts:
{"pollingInterval":2000}
/user/users/projects/myproject/some/tsconfig.js:
{"pollingInterval":2000}
/user/users/projects/myproject/some/tsconfig.json:
{"pollingInterval":2000}
/user/users/projects/myproject/some/tsconfig.ts:
{"pollingInterval":2000}
/user/users/projects/myproject/tsconfig.d.ts:
{"pollingInterval":2000}
/user/users/projects/myproject/tsconfig.js:
{"pollingInterval":2000}
/user/users/projects/myproject/tsconfig.json:
{"pollingInterval":2000}
/user/users/projects/myproject/tsconfig.ts:
{"pollingInterval":2000}
/user/users/projects/node_modules: *new*
{"pollingInterval":500}
/user/users/projects/node_modules/@types:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ Info seq [hh:mm:ss:mss] request:
}
Info seq [hh:mm:ss:mss] Search path: /users/username/projects/project
Info seq [hh:mm:ss:mss] For info: /users/username/projects/project/foo.ts :: No config files found.
Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /users/username/projects/project/tsconfig.d.ts 2000 undefined WatchType: Config file for the inferred project root
Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /users/username/projects/project/tsconfig.ts 2000 undefined WatchType: Config file for the inferred project root
Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /users/username/projects/project/tsconfig.js 2000 undefined WatchType: Config file for the inferred project root
Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /users/username/projects/project/tsconfig.json 2000 undefined WatchType: Config file for the inferred project root
Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /users/username/projects/project/jsconfig.json 2000 undefined WatchType: Config file for the inferred project root
Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /dev/null/inferredProject1*
Expand Down Expand Up @@ -86,8 +89,14 @@ PolledWatches::
{"pollingInterval":500}
/users/username/projects/project/node_modules/@types: *new*
{"pollingInterval":500}
/users/username/projects/project/tsconfig.d.ts: *new*
{"pollingInterval":2000}
/users/username/projects/project/tsconfig.js: *new*
{"pollingInterval":2000}
/users/username/projects/project/tsconfig.json: *new*
{"pollingInterval":2000}
/users/username/projects/project/tsconfig.ts: *new*
{"pollingInterval":2000}

FsWatches::
/users/username/projects: *new*
Expand All @@ -110,6 +119,18 @@ Info seq [hh:mm:ss:mss] getSemanticDiagnostics:: /users/username/projects/proje
Info seq [hh:mm:ss:mss] foo.ts(1,17): error TS2792: Cannot find module 'bar'. Did you mean to set the 'moduleResolution' option to 'nodenext', or to add aliases to the 'paths' option?

Info seq [hh:mm:ss:mss] fileExists:: [
{
"key": "/users/username/projects/project/tsconfig.d.ts",
"count": 2
},
{
"key": "/users/username/projects/project/tsconfig.ts",
"count": 2
},
{
"key": "/users/username/projects/project/tsconfig.js",
"count": 2
},
{
"key": "/users/username/projects/project/tsconfig.json",
"count": 2
Expand All @@ -118,6 +139,18 @@ Info seq [hh:mm:ss:mss] fileExists:: [
"key": "/users/username/projects/project/jsconfig.json",
"count": 2
},
{
"key": "/users/username/projects/tsconfig.d.ts",
"count": 1
},
{
"key": "/users/username/projects/tsconfig.ts",
"count": 1
},
{
"key": "/users/username/projects/tsconfig.js",
"count": 1
},
{
"key": "/users/username/projects/tsconfig.json",
"count": 1
Expand All @@ -126,6 +159,18 @@ Info seq [hh:mm:ss:mss] fileExists:: [
"key": "/users/username/projects/jsconfig.json",
"count": 1
},
{
"key": "/users/username/tsconfig.d.ts",
"count": 1
},
{
"key": "/users/username/tsconfig.ts",
"count": 1
},
{
"key": "/users/username/tsconfig.js",
"count": 1
},
{
"key": "/users/username/tsconfig.json",
"count": 1
Expand All @@ -134,6 +179,18 @@ Info seq [hh:mm:ss:mss] fileExists:: [
"key": "/users/username/jsconfig.json",
"count": 1
},
{
"key": "/users/tsconfig.d.ts",
"count": 1
},
{
"key": "/users/tsconfig.ts",
"count": 1
},
{
"key": "/users/tsconfig.js",
"count": 1
},
{
"key": "/users/tsconfig.json",
"count": 1
Expand All @@ -142,6 +199,18 @@ Info seq [hh:mm:ss:mss] fileExists:: [
"key": "/users/jsconfig.json",
"count": 1
},
{
"key": "/tsconfig.d.ts",
"count": 1
},
{
"key": "/tsconfig.ts",
"count": 1
},
{
"key": "/tsconfig.js",
"count": 1
},
{
"key": "/tsconfig.json",
"count": 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,18 @@ ScriptInfos::
/a/b/tsconfig.json

Info seq [hh:mm:ss:mss] fileExists:: [
{
"key": "/a/b/models/tsconfig.d.ts",
"count": 1
},
{
"key": "/a/b/models/tsconfig.ts",
"count": 1
},
{
"key": "/a/b/models/tsconfig.js",
"count": 1
},
{
"key": "/a/b/models/tsconfig.json",
"count": 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@ Info seq [hh:mm:ss:mss] request:
}
Info seq [hh:mm:ss:mss] Search path: e:/myproject/src
Info seq [hh:mm:ss:mss] For info: e:/myproject/src/app.js :: No config files found.
Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: e:/myproject/src/tsconfig.d.ts 2000 undefined WatchType: Config file for the inferred project root
Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: e:/myproject/src/tsconfig.ts 2000 undefined WatchType: Config file for the inferred project root
Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: e:/myproject/src/tsconfig.js 2000 undefined WatchType: Config file for the inferred project root
Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: e:/myproject/src/tsconfig.json 2000 undefined WatchType: Config file for the inferred project root
Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: e:/myproject/src/jsconfig.json 2000 undefined WatchType: Config file for the inferred project root
Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /dev/null/inferredProject1*
Expand Down Expand Up @@ -162,8 +165,14 @@ e:/myproject/src/node_modules: *new*
{"pollingInterval":500}
e:/myproject/src/node_modules/@types: *new*
{"pollingInterval":500}
e:/myproject/src/tsconfig.d.ts: *new*
{"pollingInterval":2000}
e:/myproject/src/tsconfig.js: *new*
{"pollingInterval":2000}
e:/myproject/src/tsconfig.json: *new*
{"pollingInterval":2000}
e:/myproject/src/tsconfig.ts: *new*
{"pollingInterval":2000}

FsWatches::
c:/a/lib/lib.d.ts: *new*
Expand Down Expand Up @@ -364,8 +373,14 @@ e:/myproject/src/node_modules:
{"pollingInterval":500}
e:/myproject/src/node_modules/@types:
{"pollingInterval":500}
e:/myproject/src/tsconfig.d.ts:
{"pollingInterval":2000}
e:/myproject/src/tsconfig.js:
{"pollingInterval":2000}
e:/myproject/src/tsconfig.json:
{"pollingInterval":2000}
e:/myproject/src/tsconfig.ts:
{"pollingInterval":2000}

FsWatches::
c:/a/lib/lib.d.ts:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -263,8 +263,14 @@ Info seq [hh:mm:ss:mss] Before ensureProjectForOpenFiles:
Info seq [hh:mm:ss:mss] Open files:
Info seq [hh:mm:ss:mss] FileName: /a/b/projects/project/src/file1.ts ProjectRootPath: /a/b/projects/project
Info seq [hh:mm:ss:mss] Projects:
Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /a/b/projects/project/src/tsconfig.d.ts 2000 undefined WatchType: Config file for the inferred project root
Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /a/b/projects/project/src/tsconfig.ts 2000 undefined WatchType: Config file for the inferred project root
Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /a/b/projects/project/src/tsconfig.js 2000 undefined WatchType: Config file for the inferred project root
Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /a/b/projects/project/src/tsconfig.json 2000 undefined WatchType: Config file for the inferred project root
Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /a/b/projects/project/src/jsconfig.json 2000 undefined WatchType: Config file for the inferred project root
Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /a/b/projects/project/tsconfig.d.ts 2000 undefined WatchType: Config file for the inferred project root
Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /a/b/projects/project/tsconfig.ts 2000 undefined WatchType: Config file for the inferred project root
Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /a/b/projects/project/tsconfig.js 2000 undefined WatchType: Config file for the inferred project root
Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /a/b/projects/project/tsconfig.json 2000 undefined WatchType: Config file for the inferred project root
Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /a/b/projects/project/jsconfig.json 2000 undefined WatchType: Config file for the inferred project root
Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /dev/null/inferredProject1*
Expand Down Expand Up @@ -316,10 +322,22 @@ PolledWatches::
{"pollingInterval":500}
/a/b/projects/project/src/jsconfig.json: *new*
{"pollingInterval":2000}
/a/b/projects/project/src/tsconfig.d.ts: *new*
{"pollingInterval":2000}
/a/b/projects/project/src/tsconfig.js: *new*
{"pollingInterval":2000}
/a/b/projects/project/src/tsconfig.json: *new*
{"pollingInterval":2000}
/a/b/projects/project/src/tsconfig.ts: *new*
{"pollingInterval":2000}
/a/b/projects/project/tsconfig.d.ts: *new*
{"pollingInterval":2000}
/a/b/projects/project/tsconfig.js: *new*
{"pollingInterval":2000}
/a/b/projects/project/tsconfig.json: *new*
{"pollingInterval":2000}
/a/b/projects/project/tsconfig.ts: *new*
{"pollingInterval":2000}

FsWatches::
/a/lib/lib.d.ts:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -263,8 +263,14 @@ Info seq [hh:mm:ss:mss] Before ensureProjectForOpenFiles:
Info seq [hh:mm:ss:mss] Open files:
Info seq [hh:mm:ss:mss] FileName: /a/b/projects/project/src/file1.ts ProjectRootPath: /a/b/projects/project
Info seq [hh:mm:ss:mss] Projects:
Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /a/b/projects/project/src/tsconfig.d.ts 2000 undefined WatchType: Config file for the inferred project root
Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /a/b/projects/project/src/tsconfig.ts 2000 undefined WatchType: Config file for the inferred project root
Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /a/b/projects/project/src/tsconfig.js 2000 undefined WatchType: Config file for the inferred project root
Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /a/b/projects/project/src/tsconfig.json 2000 undefined WatchType: Config file for the inferred project root
Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /a/b/projects/project/src/jsconfig.json 2000 undefined WatchType: Config file for the inferred project root
Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /a/b/projects/project/tsconfig.d.ts 2000 undefined WatchType: Config file for the inferred project root
Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /a/b/projects/project/tsconfig.ts 2000 undefined WatchType: Config file for the inferred project root
Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /a/b/projects/project/tsconfig.js 2000 undefined WatchType: Config file for the inferred project root
Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /a/b/projects/project/tsconfig.json 2000 undefined WatchType: Config file for the inferred project root
Info seq [hh:mm:ss:mss] FileWatcher:: Added:: WatchInfo: /a/b/projects/project/jsconfig.json 2000 undefined WatchType: Config file for the inferred project root
Info seq [hh:mm:ss:mss] Starting updateGraphWorker: Project: /dev/null/inferredProject1*
Expand Down Expand Up @@ -320,10 +326,22 @@ PolledWatches::
{"pollingInterval":2000}
/a/b/projects/project/src/node_modules/@types: *new*
{"pollingInterval":500}
/a/b/projects/project/src/tsconfig.d.ts: *new*
{"pollingInterval":2000}
/a/b/projects/project/src/tsconfig.js: *new*
{"pollingInterval":2000}
/a/b/projects/project/src/tsconfig.json: *new*
{"pollingInterval":2000}
/a/b/projects/project/src/tsconfig.ts: *new*
{"pollingInterval":2000}
/a/b/projects/project/tsconfig.d.ts: *new*
{"pollingInterval":2000}
/a/b/projects/project/tsconfig.js: *new*
{"pollingInterval":2000}
/a/b/projects/project/tsconfig.json: *new*
{"pollingInterval":2000}
/a/b/projects/project/tsconfig.ts: *new*
{"pollingInterval":2000}

FsWatches::
/a/lib/lib.d.ts:
Expand Down
Loading
Loading