MCPcopy Create free account
hub / github.com/microsoft/typescript-go / NewInferredProject

Function NewInferredProject

internal/project/project.go:101–133  ·  view source on GitHub ↗
(
	currentDirectory string,
	compilerOptions *core.CompilerOptions,
	rootFileNames []string,
	builder *ProjectCollectionBuilder,
	logger *logging.LogTree,
)

Source from the content-addressed store, hash-verified

99}
100
101func NewInferredProject(
102 currentDirectory string,
103 compilerOptions *core.CompilerOptions,
104 rootFileNames []string,
105 builder *ProjectCollectionBuilder,
106 logger *logging.LogTree,
107) *Project {
108 p := NewProject(inferredProjectName, KindInferred, currentDirectory, builder, logger)
109 if compilerOptions == nil {
110 compilerOptions = &core.CompilerOptions{
111 AllowJs: core.TSTrue,
112 Module: core.ModuleKindESNext,
113 ModuleResolution: core.ModuleResolutionKindBundler,
114 Target: core.ScriptTargetLatestStandard,
115 Jsx: core.JsxEmitReactJSX,
116 AllowImportingTsExtensions: core.TSTrue,
117 StrictNullChecks: core.TSTrue,
118 StrictFunctionTypes: core.TSTrue,
119 SourceMap: core.TSTrue,
120 AllowNonTsExtensions: core.TSTrue,
121 ResolveJsonModule: core.TSTrue,
122 }
123 }
124 p.CommandLine = tsoptions.NewParsedCommandLine(
125 compilerOptions,
126 rootFileNames,
127 tspath.ComparePathsOptions{
128 UseCaseSensitiveFileNames: builder.fs.fs.UseCaseSensitiveFileNames(),
129 CurrentDirectory: currentDirectory,
130 },
131 )
132 return p
133}
134
135func NewProject(
136 configFileName string,

Callers 1

Calls 3

NewParsedCommandLineFunction · 0.92
NewProjectFunction · 0.85

Tested by

no test coverage detected