diff --git a/internal/core/parsedoptions.go b/internal/core/parsedoptions.go index 1bf31f74c2..b999e44a74 100644 --- a/internal/core/parsedoptions.go +++ b/internal/core/parsedoptions.go @@ -3,6 +3,7 @@ package core type ParsedOptions struct { CompilerOptions *CompilerOptions `json:"compilerOptions"` WatchOptions *WatchOptions `json:"watchOptions"` + TypeAcquisition *TypeAcquisition `json:"typeAcquisition"` FileNames []string `json:"fileNames"` ProjectReferences []ProjectReference `json:"projectReferences"` diff --git a/internal/core/typeacquisition.go b/internal/core/typeacquisition.go new file mode 100644 index 0000000000..5a8b0e16db --- /dev/null +++ b/internal/core/typeacquisition.go @@ -0,0 +1,8 @@ +package core + +type TypeAcquisition struct { + Enable Tristate `json:"enable,omitzero"` + Include []string `json:"include,omitzero"` + Exclude []string `json:"exclude,omitzero"` + DisableFilenameBasedTypeAcquisition Tristate `json:"disableFilenameBasedTypeAcquisition,omitzero"` +} diff --git a/internal/execute/tsc_test.go b/internal/execute/tsc_test.go index 488240a582..a5ab773ba7 100644 --- a/internal/execute/tsc_test.go +++ b/internal/execute/tsc_test.go @@ -252,3 +252,30 @@ func TestExtends(t *testing.T) { c.verify(t, "extends") } } + +func TestTypeAcquisition(t *testing.T) { + t.Parallel() + if !bundled.Embedded { + // Without embedding, we'd need to read all of the lib files out from disk into the MapFS. + // Just skip this for now. + t.Skip("bundled files are not embedded") + } + (&tscInput{ + subScenario: "parse tsconfig with typeAcquisition", + sys: newTestSys(FileMap{"/home/src/workspaces/project/tsconfig.json": `{ + "compilerOptions": { + "composite": true, + "noEmit": true, + }, + "typeAcquisition": { + "enable": true, + "include": ["0.d.ts", "1.d.ts"], + "exclude": ["0.js", "1.js"], + "disableFilenameBasedTypeAcquisition": true, + }, +}`}, + "/home/src/workspaces/project", + ), + commandLineArgs: []string{}, + }).verify(t, "typeAcquisition") +} diff --git a/internal/tsoptions/declstypeacquisition.go b/internal/tsoptions/declstypeacquisition.go new file mode 100644 index 0000000000..fe7ceb66c7 --- /dev/null +++ b/internal/tsoptions/declstypeacquisition.go @@ -0,0 +1,29 @@ +package tsoptions + +var typeAcquisitionDeclaration = &CommandLineOption{ + Name: "typeAcquisition", + Kind: CommandLineOptionTypeObject, + ElementOptions: commandLineOptionsToMap(typeAcquisitionDecls), +} + +// Do not delete this without updating the website's tsconfig generation. +var typeAcquisitionDecls = []*CommandLineOption{ + { + Name: "enable", + Kind: CommandLineOptionTypeBoolean, + DefaultValueDescription: false, + }, + { + Name: "include", + Kind: CommandLineOptionTypeList, + }, + { + Name: "exclude", + Kind: CommandLineOptionTypeList, + }, + { + Name: "disableFilenameBasedTypeAcquisition", + Kind: CommandLineOptionTypeBoolean, + DefaultValueDescription: false, + }, +} diff --git a/internal/tsoptions/parsinghelpers.go b/internal/tsoptions/parsinghelpers.go index f1739b297b..e33dd4cfd2 100644 --- a/internal/tsoptions/parsinghelpers.go +++ b/internal/tsoptions/parsinghelpers.go @@ -109,6 +109,9 @@ func parseJsonToStringKey(json any) *collections.OrderedMap[string, any] { if v, ok := m.Get("excludes"); ok { result.Set("excludes", v) } + if v, ok := m.Get("typeAcquisition"); ok { + result.Set("typeAcquisition", v) + } } return result } @@ -133,6 +136,14 @@ func (o *watchOptionsParser) ParseOption(key string, value any) []*ast.Diagnosti return ParseWatchOptions(key, value, o.WatchOptions) } +type typeAcquisitionParser struct { + *core.TypeAcquisition +} + +func (o *typeAcquisitionParser) ParseOption(key string, value any) []*ast.Diagnostic { + return ParseTypeAcquisition(key, value, o.TypeAcquisition) +} + func ParseCompilerOptions(key string, value any, allOptions *core.CompilerOptions) []*ast.Diagnostic { if value == nil { return nil @@ -436,6 +447,26 @@ func ParseWatchOptions(key string, value any, allOptions *core.WatchOptions) []* return nil } +func ParseTypeAcquisition(key string, value any, allOptions *core.TypeAcquisition) []*ast.Diagnostic { + if value == nil { + return nil + } + if allOptions == nil { + return nil + } + switch key { + case "enable": + allOptions.Enable = parseTristate(value) + case "include": + allOptions.Include = parseStringArray(value) + case "exclude": + allOptions.Exclude = parseStringArray(value) + case "disableFilenameBasedTypeAcquisition": + allOptions.DisableFilenameBasedTypeAcquisition = parseTristate(value) + } + return nil +} + // mergeCompilerOptions merges the source compiler options into the target compiler options. // Fields in the source options will overwrite the corresponding fields in the target options. func mergeCompilerOptions(targetOptions, sourceOptions *core.CompilerOptions) *core.CompilerOptions { diff --git a/internal/tsoptions/tsconfigparsing.go b/internal/tsoptions/tsconfigparsing.go index 1430c2a45e..99a3897865 100644 --- a/internal/tsoptions/tsconfigparsing.go +++ b/internal/tsoptions/tsconfigparsing.go @@ -57,6 +57,8 @@ var tsconfigRootOptionsMap = &CommandLineOption{ Kind: CommandLineOptionTypeObject, ElementOptions: commandLineOptionsToMap([]*CommandLineOption{ compilerOptionsDeclaration, + // watchOptionsDeclaration, + typeAcquisitionDeclaration, extendsOptionDeclaration, { Name: "references", @@ -107,8 +109,8 @@ type ExtendedConfigCacheEntry struct { type parsedTsconfig struct { raw any options *core.CompilerOptions - // watchOptions *compiler.WatchOptions - // typeAcquisition *compiler.TypeAcquisition + // watchOptions *core.WatchOptions + typeAcquisition *core.TypeAcquisition // Note that the case of the config path has not yet been normalized, as no files have been imported into the project yet extendedConfigPath any } @@ -119,8 +121,8 @@ func parseOwnConfigOfJsonSourceFile( basePath string, configFileName string, ) (*parsedTsconfig, []*ast.Diagnostic) { - options := getDefaultCompilerOptions(configFileName) - // var typeAcquisition *compiler.TypeAcquisition + compilerOptions := getDefaultCompilerOptions(configFileName) + typeAcquisition := getDefaultTypeAcquisition(configFileName) // var watchOptions *compiler.WatchOptions var extendedConfigPath any var rootCompilerOptions []*ast.PropertyName @@ -139,7 +141,14 @@ func parseOwnConfigOfJsonSourceFile( } if parentOption != nil && parentOption.Name != "undefined" && value != nil { if option != nil && option.Name != "" { - propertySetErrors = append(propertySetErrors, ParseCompilerOptions(option.Name, value, options)...) + var parseDiagnostics []*ast.Diagnostic + switch parentOption.Name { + case "compilerOptions": + parseDiagnostics = ParseCompilerOptions(option.Name, value, compilerOptions) + case "typeAcquisition": + parseDiagnostics = ParseTypeAcquisition(option.Name, value, typeAcquisition) + } + propertySetErrors = append(propertySetErrors, parseDiagnostics...) } else if keyText != "" { if parentOption.ElementOptions != nil { // !!! TODO: support suggestion @@ -178,9 +187,9 @@ func parseOwnConfigOfJsonSourceFile( // } return &parsedTsconfig{ raw: json, - options: options, + options: compilerOptions, // watchOptions: watchOptions, - // typeAcquisition: typeAcquisition, + typeAcquisition: typeAcquisition, extendedConfigPath: extendedConfigPath, }, errors } @@ -479,19 +488,19 @@ type tsConfigOptions struct { notDefined string } -func commandLineOptionsToMap(options []*CommandLineOption) map[string]*CommandLineOption { +func commandLineOptionsToMap(compilerOptions []*CommandLineOption) map[string]*CommandLineOption { result := make(map[string]*CommandLineOption) - for i := range options { - result[(options[i]).Name] = options[i] + for i := range compilerOptions { + result[(compilerOptions[i]).Name] = compilerOptions[i] } return result } var commandLineCompilerOptionsMap map[string]*CommandLineOption = commandLineOptionsToMap(OptionsDeclarations) -func convertMapToOptions[O optionParser](options *collections.OrderedMap[string, any], result O) O { +func convertMapToOptions[O optionParser](compilerOptions *collections.OrderedMap[string, any], result O) O { // this assumes any `key`, `value` pair in `options` will have `value` already be the correct type. this function should no error handling - for key, value := range options.Entries() { + for key, value := range compilerOptions.Entries() { result.ParseOption(key, value) } return result @@ -758,6 +767,14 @@ func getDefaultCompilerOptions(configFileName string) *core.CompilerOptions { return options } +func getDefaultTypeAcquisition(configFileName string) *core.TypeAcquisition { + options := &core.TypeAcquisition{} + if configFileName != "" && tspath.GetBaseFileName(configFileName) == "jsconfig.json" { + options.Enable = core.TSTrue + } + return options +} + func convertCompilerOptionsFromJsonWorker(jsonOptions any, basePath string, configFileName string) (*core.CompilerOptions, []*ast.Diagnostic) { options := getDefaultCompilerOptions(configFileName) _, errors := convertOptionsFromJson(commandLineCompilerOptionsMap, jsonOptions, basePath, &compilerOptionsParser{options}) @@ -767,6 +784,12 @@ func convertCompilerOptionsFromJsonWorker(jsonOptions any, basePath string, conf return options, errors } +func convertTypeAcquisitionFromJsonWorker(jsonOptions any, basePath string, configFileName string) (*core.TypeAcquisition, []*ast.Diagnostic) { + options := getDefaultTypeAcquisition(configFileName) + _, errors := convertOptionsFromJson(typeAcquisitionDeclaration.ElementOptions, jsonOptions, basePath, &typeAcquisitionParser{options}) + return options, errors +} + func parseOwnConfigOfJson( json *collections.OrderedMap[string, any], host ParseConfigHost, @@ -778,8 +801,8 @@ func parseOwnConfigOfJson( errors = append(errors, ast.NewCompilerDiagnostic(diagnostics.Unknown_option_excludes_Did_you_mean_exclude)) } options, err := convertCompilerOptionsFromJsonWorker(json.GetOrZero("compilerOptions"), basePath, configFileName) - errors = append(errors, err...) - // typeAcquisition := convertTypeAcquisitionFromJsonWorker(json.typeAcquisition, basePath, errors, configFileName) + typeAcquisition, err2 := convertTypeAcquisitionFromJsonWorker(json.GetOrZero("typeAcquisition"), basePath, configFileName) + errors = append(append(errors, err...), err2...) // watchOptions := convertWatchOptionsFromJsonWorker(json.watchOptions, basePath, errors) // json.compileOnSave = convertCompileOnSaveOptionFromJson(json, basePath, errors) var extendedConfigPath []string @@ -790,6 +813,7 @@ func parseOwnConfigOfJson( parsedConfig := &parsedTsconfig{ raw: json, options: options, + typeAcquisition: typeAcquisition, extendedConfigPath: extendedConfigPath, } return parsedConfig, errors @@ -1176,7 +1200,9 @@ func parseJsonConfigFileContentWorker( return &ParsedCommandLine{ ParsedConfig: &core.ParsedOptions{ - CompilerOptions: parsedConfig.options, + CompilerOptions: parsedConfig.options, + TypeAcquisition: parsedConfig.typeAcquisition, + // WatchOptions: nil, FileNames: getFileNames(basePathForFileNames), ProjectReferences: getProjectReferences(basePathForFileNames), }, @@ -1321,43 +1347,43 @@ func substituteStringArrayWithConfigDirTemplate(list []string, basePath string) } } -func handleOptionConfigDirTemplateSubstitution(options *core.CompilerOptions, basePath string) { - if options == nil { +func handleOptionConfigDirTemplateSubstitution(compilerOptions *core.CompilerOptions, basePath string) { + if compilerOptions == nil { return } // !!! don't hardcode this; use options declarations? - for v := range options.Paths.Values() { + for v := range compilerOptions.Paths.Values() { substituteStringArrayWithConfigDirTemplate(v, basePath) } - substituteStringArrayWithConfigDirTemplate(options.RootDirs, basePath) - substituteStringArrayWithConfigDirTemplate(options.TypeRoots, basePath) + substituteStringArrayWithConfigDirTemplate(compilerOptions.RootDirs, basePath) + substituteStringArrayWithConfigDirTemplate(compilerOptions.TypeRoots, basePath) - if startsWithConfigDirTemplate(options.GenerateCpuProfile) { - options.GenerateCpuProfile = getSubstitutedPathWithConfigDirTemplate(options.GenerateCpuProfile, basePath) + if startsWithConfigDirTemplate(compilerOptions.GenerateCpuProfile) { + compilerOptions.GenerateCpuProfile = getSubstitutedPathWithConfigDirTemplate(compilerOptions.GenerateCpuProfile, basePath) } - if startsWithConfigDirTemplate(options.GenerateTrace) { - options.GenerateTrace = getSubstitutedPathWithConfigDirTemplate(options.GenerateTrace, basePath) + if startsWithConfigDirTemplate(compilerOptions.GenerateTrace) { + compilerOptions.GenerateTrace = getSubstitutedPathWithConfigDirTemplate(compilerOptions.GenerateTrace, basePath) } - if startsWithConfigDirTemplate(options.OutFile) { - options.OutFile = getSubstitutedPathWithConfigDirTemplate(options.OutFile, basePath) + if startsWithConfigDirTemplate(compilerOptions.OutFile) { + compilerOptions.OutFile = getSubstitutedPathWithConfigDirTemplate(compilerOptions.OutFile, basePath) } - if startsWithConfigDirTemplate(options.OutDir) { - options.OutDir = getSubstitutedPathWithConfigDirTemplate(options.OutDir, basePath) + if startsWithConfigDirTemplate(compilerOptions.OutDir) { + compilerOptions.OutDir = getSubstitutedPathWithConfigDirTemplate(compilerOptions.OutDir, basePath) } - if startsWithConfigDirTemplate(options.RootDir) { - options.RootDir = getSubstitutedPathWithConfigDirTemplate(options.RootDir, basePath) + if startsWithConfigDirTemplate(compilerOptions.RootDir) { + compilerOptions.RootDir = getSubstitutedPathWithConfigDirTemplate(compilerOptions.RootDir, basePath) } - if startsWithConfigDirTemplate(options.TsBuildInfoFile) { - options.TsBuildInfoFile = getSubstitutedPathWithConfigDirTemplate(options.TsBuildInfoFile, basePath) + if startsWithConfigDirTemplate(compilerOptions.TsBuildInfoFile) { + compilerOptions.TsBuildInfoFile = getSubstitutedPathWithConfigDirTemplate(compilerOptions.TsBuildInfoFile, basePath) } - if startsWithConfigDirTemplate(options.BaseUrl) { - options.BaseUrl = getSubstitutedPathWithConfigDirTemplate(options.BaseUrl, basePath) + if startsWithConfigDirTemplate(compilerOptions.BaseUrl) { + compilerOptions.BaseUrl = getSubstitutedPathWithConfigDirTemplate(compilerOptions.BaseUrl, basePath) } - if startsWithConfigDirTemplate(options.DeclarationDir) { - options.DeclarationDir = getSubstitutedPathWithConfigDirTemplate(options.DeclarationDir, basePath) + if startsWithConfigDirTemplate(compilerOptions.DeclarationDir) { + compilerOptions.DeclarationDir = getSubstitutedPathWithConfigDirTemplate(compilerOptions.DeclarationDir, basePath) } } @@ -1517,8 +1543,8 @@ func getFileNamesFromConfigSpecs( return files } -func GetSupportedExtensions(options *core.CompilerOptions, extraFileExtensions []fileExtensionInfo) [][]string { - needJSExtensions := options.GetAllowJS() +func GetSupportedExtensions(compilerOptions *core.CompilerOptions, extraFileExtensions []fileExtensionInfo) [][]string { + needJSExtensions := compilerOptions.GetAllowJS() if len(extraFileExtensions) == 0 { if needJSExtensions { return tspath.AllSupportedExtensions @@ -1543,8 +1569,8 @@ func GetSupportedExtensions(options *core.CompilerOptions, extraFileExtensions [ return extensions } -func GetSupportedExtensionsWithJsonIfResolveJsonModule(options *core.CompilerOptions, supportedExtensions [][]string) [][]string { - if options == nil || !options.GetResolveJsonModule() { +func GetSupportedExtensionsWithJsonIfResolveJsonModule(compilerOptions *core.CompilerOptions, supportedExtensions [][]string) [][]string { + if compilerOptions == nil || !compilerOptions.GetResolveJsonModule() { return supportedExtensions } if core.Same(supportedExtensions, tspath.AllSupportedExtensions) { diff --git a/internal/tsoptions/tsconfigparsing_test.go b/internal/tsoptions/tsconfigparsing_test.go index d56808228b..14b5bb0d12 100644 --- a/internal/tsoptions/tsconfigparsing_test.go +++ b/internal/tsoptions/tsconfigparsing_test.go @@ -155,11 +155,13 @@ func TestParseConfigFileTextToJson(t *testing.T) { } } -var parseJsonConfigFileTests = []struct { +type parseJsonConfigTestCase struct { title string noSubmoduleBaseline bool input []testConfig -}{ +} + +var parseJsonConfigFileTests = []parseJsonConfigTestCase{ { title: "ignore dotted files and folders", input: []testConfig{{ @@ -552,53 +554,57 @@ func TestParseJsonConfigFileContent(t *testing.T) { for _, rec := range parseJsonConfigFileTests { t.Run(rec.title+" with json api", func(t *testing.T) { t.Parallel() - baselineParseConfigWith(t, rec.title+" with json api.js", rec.noSubmoduleBaseline, rec.input, func(config testConfig, host tsoptions.ParseConfigHost, basePath string) *tsoptions.ParsedCommandLine { - configFileName := tspath.GetNormalizedAbsolutePath(config.configFileName, basePath) - path := tspath.ToPath(config.configFileName, basePath, host.FS().UseCaseSensitiveFileNames()) - parsed, _ := tsoptions.ParseConfigFileTextToJson(configFileName, path, config.jsonText) - return tsoptions.ParseJsonConfigFileContent( - parsed, - host, - basePath, - nil, - configFileName, - /*resolutionStack*/ nil, - /*extraFileExtensions*/ nil, - /*extendedConfigCache*/ nil, - ) - }) + baselineParseConfigWith(t, rec.title+" with json api.js", rec.noSubmoduleBaseline, rec.input, getParsedWithJsonApi) }) } } +func getParsedWithJsonApi(config testConfig, host tsoptions.ParseConfigHost, basePath string) *tsoptions.ParsedCommandLine { + configFileName := tspath.GetNormalizedAbsolutePath(config.configFileName, basePath) + path := tspath.ToPath(config.configFileName, basePath, host.FS().UseCaseSensitiveFileNames()) + parsed, _ := tsoptions.ParseConfigFileTextToJson(configFileName, path, config.jsonText) + return tsoptions.ParseJsonConfigFileContent( + parsed, + host, + basePath, + nil, + configFileName, + /*resolutionStack*/ nil, + /*extraFileExtensions*/ nil, + /*extendedConfigCache*/ nil, + ) +} + func TestParseJsonSourceFileConfigFileContent(t *testing.T) { t.Parallel() repo.SkipIfNoTypeScriptSubmodule(t) for _, rec := range parseJsonConfigFileTests { t.Run(rec.title+" with jsonSourceFile api", func(t *testing.T) { t.Parallel() - baselineParseConfigWith(t, rec.title+" with jsonSourceFile api.js", rec.noSubmoduleBaseline, rec.input, func(config testConfig, host tsoptions.ParseConfigHost, basePath string) *tsoptions.ParsedCommandLine { - configFileName := tspath.GetNormalizedAbsolutePath(config.configFileName, basePath) - path := tspath.ToPath(config.configFileName, basePath, host.FS().UseCaseSensitiveFileNames()) - parsed := parser.ParseJSONText(configFileName, path, config.jsonText) - tsConfigSourceFile := &tsoptions.TsConfigSourceFile{ - SourceFile: parsed, - } - return tsoptions.ParseJsonSourceFileConfigFileContent( - tsConfigSourceFile, - host, - host.GetCurrentDirectory(), - nil, - configFileName, - /*resolutionStack*/ nil, - /*extraFileExtensions*/ nil, - /*extendedConfigCache*/ nil, - ) - }) + baselineParseConfigWith(t, rec.title+" with jsonSourceFile api.js", rec.noSubmoduleBaseline, rec.input, getParsedWithJsonSourceFileApi) }) } } +func getParsedWithJsonSourceFileApi(config testConfig, host tsoptions.ParseConfigHost, basePath string) *tsoptions.ParsedCommandLine { + configFileName := tspath.GetNormalizedAbsolutePath(config.configFileName, basePath) + path := tspath.ToPath(config.configFileName, basePath, host.FS().UseCaseSensitiveFileNames()) + parsed := parser.ParseJSONText(configFileName, path, config.jsonText) + tsConfigSourceFile := &tsoptions.TsConfigSourceFile{ + SourceFile: parsed, + } + return tsoptions.ParseJsonSourceFileConfigFileContent( + tsConfigSourceFile, + host, + host.GetCurrentDirectory(), + nil, + configFileName, + /*resolutionStack*/ nil, + /*extraFileExtensions*/ nil, + /*extendedConfigCache*/ nil, + ) +} + func baselineParseConfigWith(t *testing.T, baselineFileName string, noSubmoduleBaseline bool, input []testConfig, getParsed func(config testConfig, host tsoptions.ParseConfigHost, basePath string) *tsoptions.ParsedCommandLine) { noSubmoduleBaseline = true var baselineContent strings.Builder @@ -629,6 +635,12 @@ func baselineParseConfigWith(t *testing.T, baselineFileName string, noSubmoduleB enc.SetEscapeHTML(false) assert.NilError(t, enc.Encode(parsedConfigFileContent.CompilerOptions())) baselineContent.WriteString("\n") + + if parsedConfigFileContent.ParsedConfig.TypeAcquisition != nil { + baselineContent.WriteString("TypeAcquisition::\n") + assert.NilError(t, enc.Encode(parsedConfigFileContent.ParsedConfig.TypeAcquisition)) + baselineContent.WriteString("\n") + } } baselineContent.WriteString("FileNames::\n") baselineContent.WriteString(strings.Join(parsedConfigFileContent.ParsedConfig.FileNames, ",") + "\n") @@ -663,6 +675,103 @@ func jsonToReadableText(input any) (string, error) { return buf.String(), nil } +func TestParseTypeAcquisition(t *testing.T) { + t.Parallel() + // repo.SkipIfNoTypeScriptSubmodule(t) + cases := []struct { + title string + configName string + config string + }{ + { + title: "Convert correctly format tsconfig.json to typeAcquisition ", + config: `{ + "typeAcquisition": { + "enable": true, + "include": ["0.d.ts", "1.d.ts"], + "exclude": ["0.js", "1.js"], + }, +}`, + configName: "tsconfig.json", + }, + { + title: "Convert incorrect format tsconfig.json to typeAcquisition ", + config: `{ + "typeAcquisition": { + "enableAutoDiscovy": true, + } +}`, configName: "tsconfig.json", + }, + { + title: "Convert default tsconfig.json to typeAcquisition ", + config: `{}`, configName: "tsconfig.json", + }, + { + title: "Convert tsconfig.json with only enable property to typeAcquisition ", + config: `{ + "typeAcquisition": { + "enable": true, + }, +}`, configName: "tsconfig.json", + }, + + // jsconfig.json + { + title: "Convert jsconfig.json to typeAcquisition ", + config: `{ + "typeAcquisition": { + "enable": false, + "include": ["0.d.ts"], + "exclude": ["0.js"], + }, +}`, + configName: "jsconfig.json", + }, + {title: "Convert default jsconfig.json to typeAcquisition ", config: `{}`, configName: "jsconfig.json"}, + { + title: "Convert incorrect format jsconfig.json to typeAcquisition ", + config: `{ + "typeAcquisition": { + "enableAutoDiscovy": true, + }, +}`, + configName: "jsconfig.json", + }, + { + title: "Convert jsconfig.json with only enable property to typeAcquisition ", + config: `{ + "typeAcquisition": { + "enable": false, + }, +}`, + configName: "jsconfig.json", + }, + } + for _, test := range cases { + withJsonApiName := test.title + " with json api" + input := []testConfig{ + { + jsonText: test.config, + configFileName: test.configName, + basePath: "/apath", + allFileList: map[string]string{ + "/apath/a.ts": "", + "/apath/b.ts": "", + }, + }, + } + t.Run(withJsonApiName, func(t *testing.T) { + t.Parallel() + baselineParseConfigWith(t, withJsonApiName+".js", true, input, getParsedWithJsonApi) + }) + withJsonSourceFileApiName := test.title + " with jsonSourceFile api" + t.Run(withJsonSourceFileApiName, func(t *testing.T) { + t.Parallel() + baselineParseConfigWith(t, withJsonSourceFileApiName+".js", true, input, getParsedWithJsonSourceFileApi) + }) + } +} + func printFS(output io.Writer, files vfs.FS, root string) error { return files.WalkDir(root, func(path string, d fs.DirEntry, err error) error { if err != nil { diff --git a/testdata/baselines/reference/config/tsconfigParsing/Convert correctly format tsconfig.json to typeAcquisition with json api.js b/testdata/baselines/reference/config/tsconfigParsing/Convert correctly format tsconfig.json to typeAcquisition with json api.js new file mode 100644 index 0000000000..17808909fc --- /dev/null +++ b/testdata/baselines/reference/config/tsconfigParsing/Convert correctly format tsconfig.json to typeAcquisition with json api.js @@ -0,0 +1,40 @@ +Fs:: +//// [/apath/a.ts] + + +//// [/apath/b.ts] + + +//// [/apath/tsconfig.json] +{ + "typeAcquisition": { + "enable": true, + "include": ["0.d.ts", "1.d.ts"], + "exclude": ["0.js", "1.js"], + }, +} + + +configFileName:: tsconfig.json +CompilerOptions:: +{ + "configFilePath": "/apath/tsconfig.json" +} + +TypeAcquisition:: +{ + "enable": true, + "include": [ + "0.d.ts", + "1.d.ts" + ], + "exclude": [ + "0.js", + "1.js" + ] +} + +FileNames:: +/apath/a.ts,/apath/b.ts +Errors:: + diff --git a/testdata/baselines/reference/config/tsconfigParsing/Convert correctly format tsconfig.json to typeAcquisition with jsonSourceFile api.js b/testdata/baselines/reference/config/tsconfigParsing/Convert correctly format tsconfig.json to typeAcquisition with jsonSourceFile api.js new file mode 100644 index 0000000000..17808909fc --- /dev/null +++ b/testdata/baselines/reference/config/tsconfigParsing/Convert correctly format tsconfig.json to typeAcquisition with jsonSourceFile api.js @@ -0,0 +1,40 @@ +Fs:: +//// [/apath/a.ts] + + +//// [/apath/b.ts] + + +//// [/apath/tsconfig.json] +{ + "typeAcquisition": { + "enable": true, + "include": ["0.d.ts", "1.d.ts"], + "exclude": ["0.js", "1.js"], + }, +} + + +configFileName:: tsconfig.json +CompilerOptions:: +{ + "configFilePath": "/apath/tsconfig.json" +} + +TypeAcquisition:: +{ + "enable": true, + "include": [ + "0.d.ts", + "1.d.ts" + ], + "exclude": [ + "0.js", + "1.js" + ] +} + +FileNames:: +/apath/a.ts,/apath/b.ts +Errors:: + diff --git a/testdata/baselines/reference/config/tsconfigParsing/Convert default jsconfig.json to typeAcquisition with json api.js b/testdata/baselines/reference/config/tsconfigParsing/Convert default jsconfig.json to typeAcquisition with json api.js new file mode 100644 index 0000000000..c581225222 --- /dev/null +++ b/testdata/baselines/reference/config/tsconfigParsing/Convert default jsconfig.json to typeAcquisition with json api.js @@ -0,0 +1,31 @@ +Fs:: +//// [/apath/a.ts] + + +//// [/apath/b.ts] + + +//// [/apath/jsconfig.json] +{} + + +configFileName:: jsconfig.json +CompilerOptions:: +{ + "allowJs": true, + "allowSyntheticDefaultImports": true, + "noEmit": true, + "skipLibCheck": true, + "maxNodeModuleJsDepth": 2, + "configFilePath": "/apath/jsconfig.json" +} + +TypeAcquisition:: +{ + "enable": true +} + +FileNames:: +/apath/a.ts,/apath/b.ts +Errors:: + diff --git a/testdata/baselines/reference/config/tsconfigParsing/Convert default jsconfig.json to typeAcquisition with jsonSourceFile api.js b/testdata/baselines/reference/config/tsconfigParsing/Convert default jsconfig.json to typeAcquisition with jsonSourceFile api.js new file mode 100644 index 0000000000..c581225222 --- /dev/null +++ b/testdata/baselines/reference/config/tsconfigParsing/Convert default jsconfig.json to typeAcquisition with jsonSourceFile api.js @@ -0,0 +1,31 @@ +Fs:: +//// [/apath/a.ts] + + +//// [/apath/b.ts] + + +//// [/apath/jsconfig.json] +{} + + +configFileName:: jsconfig.json +CompilerOptions:: +{ + "allowJs": true, + "allowSyntheticDefaultImports": true, + "noEmit": true, + "skipLibCheck": true, + "maxNodeModuleJsDepth": 2, + "configFilePath": "/apath/jsconfig.json" +} + +TypeAcquisition:: +{ + "enable": true +} + +FileNames:: +/apath/a.ts,/apath/b.ts +Errors:: + diff --git a/testdata/baselines/reference/config/tsconfigParsing/Convert default tsconfig.json to typeAcquisition with json api.js b/testdata/baselines/reference/config/tsconfigParsing/Convert default tsconfig.json to typeAcquisition with json api.js new file mode 100644 index 0000000000..109db21695 --- /dev/null +++ b/testdata/baselines/reference/config/tsconfigParsing/Convert default tsconfig.json to typeAcquisition with json api.js @@ -0,0 +1,24 @@ +Fs:: +//// [/apath/a.ts] + + +//// [/apath/b.ts] + + +//// [/apath/tsconfig.json] +{} + + +configFileName:: tsconfig.json +CompilerOptions:: +{ + "configFilePath": "/apath/tsconfig.json" +} + +TypeAcquisition:: +{} + +FileNames:: +/apath/a.ts,/apath/b.ts +Errors:: + diff --git a/testdata/baselines/reference/config/tsconfigParsing/Convert default tsconfig.json to typeAcquisition with jsonSourceFile api.js b/testdata/baselines/reference/config/tsconfigParsing/Convert default tsconfig.json to typeAcquisition with jsonSourceFile api.js new file mode 100644 index 0000000000..109db21695 --- /dev/null +++ b/testdata/baselines/reference/config/tsconfigParsing/Convert default tsconfig.json to typeAcquisition with jsonSourceFile api.js @@ -0,0 +1,24 @@ +Fs:: +//// [/apath/a.ts] + + +//// [/apath/b.ts] + + +//// [/apath/tsconfig.json] +{} + + +configFileName:: tsconfig.json +CompilerOptions:: +{ + "configFilePath": "/apath/tsconfig.json" +} + +TypeAcquisition:: +{} + +FileNames:: +/apath/a.ts,/apath/b.ts +Errors:: + diff --git a/testdata/baselines/reference/config/tsconfigParsing/Convert incorrect format jsconfig.json to typeAcquisition with json api.js b/testdata/baselines/reference/config/tsconfigParsing/Convert incorrect format jsconfig.json to typeAcquisition with json api.js new file mode 100644 index 0000000000..e80ae60595 --- /dev/null +++ b/testdata/baselines/reference/config/tsconfigParsing/Convert incorrect format jsconfig.json to typeAcquisition with json api.js @@ -0,0 +1,35 @@ +Fs:: +//// [/apath/a.ts] + + +//// [/apath/b.ts] + + +//// [/apath/jsconfig.json] +{ + "typeAcquisition": { + "enableAutoDiscovy": true, + }, +} + + +configFileName:: jsconfig.json +CompilerOptions:: +{ + "allowJs": true, + "allowSyntheticDefaultImports": true, + "noEmit": true, + "skipLibCheck": true, + "maxNodeModuleJsDepth": 2, + "configFilePath": "/apath/jsconfig.json" +} + +TypeAcquisition:: +{ + "enable": true +} + +FileNames:: +/apath/a.ts,/apath/b.ts +Errors:: +error TS5023: Unknown compiler option 'enableAutoDiscovy'. diff --git a/testdata/baselines/reference/config/tsconfigParsing/Convert incorrect format jsconfig.json to typeAcquisition with jsonSourceFile api.js b/testdata/baselines/reference/config/tsconfigParsing/Convert incorrect format jsconfig.json to typeAcquisition with jsonSourceFile api.js new file mode 100644 index 0000000000..be38d7de0b --- /dev/null +++ b/testdata/baselines/reference/config/tsconfigParsing/Convert incorrect format jsconfig.json to typeAcquisition with jsonSourceFile api.js @@ -0,0 +1,39 @@ +Fs:: +//// [/apath/a.ts] + + +//// [/apath/b.ts] + + +//// [/apath/jsconfig.json] +{ + "typeAcquisition": { + "enableAutoDiscovy": true, + }, +} + + +configFileName:: jsconfig.json +CompilerOptions:: +{ + "allowJs": true, + "allowSyntheticDefaultImports": true, + "noEmit": true, + "skipLibCheck": true, + "maxNodeModuleJsDepth": 2, + "configFilePath": "/apath/jsconfig.json" +} + +TypeAcquisition:: +{ + "enable": true +} + +FileNames:: +/apath/a.ts,/apath/b.ts +Errors:: +jsconfig.json:3:3 - error TS5023: Unknown compiler option 'enableAutoDiscovy'. + +3 "enableAutoDiscovy": true, +   ~~~~~~~~~~~~~~~~~~~ + diff --git a/testdata/baselines/reference/config/tsconfigParsing/Convert incorrect format tsconfig.json to typeAcquisition with json api.js b/testdata/baselines/reference/config/tsconfigParsing/Convert incorrect format tsconfig.json to typeAcquisition with json api.js new file mode 100644 index 0000000000..335110d695 --- /dev/null +++ b/testdata/baselines/reference/config/tsconfigParsing/Convert incorrect format tsconfig.json to typeAcquisition with json api.js @@ -0,0 +1,28 @@ +Fs:: +//// [/apath/a.ts] + + +//// [/apath/b.ts] + + +//// [/apath/tsconfig.json] +{ + "typeAcquisition": { + "enableAutoDiscovy": true, + } +} + + +configFileName:: tsconfig.json +CompilerOptions:: +{ + "configFilePath": "/apath/tsconfig.json" +} + +TypeAcquisition:: +{} + +FileNames:: +/apath/a.ts,/apath/b.ts +Errors:: +error TS5023: Unknown compiler option 'enableAutoDiscovy'. diff --git a/testdata/baselines/reference/config/tsconfigParsing/Convert incorrect format tsconfig.json to typeAcquisition with jsonSourceFile api.js b/testdata/baselines/reference/config/tsconfigParsing/Convert incorrect format tsconfig.json to typeAcquisition with jsonSourceFile api.js new file mode 100644 index 0000000000..39f13e3c99 --- /dev/null +++ b/testdata/baselines/reference/config/tsconfigParsing/Convert incorrect format tsconfig.json to typeAcquisition with jsonSourceFile api.js @@ -0,0 +1,32 @@ +Fs:: +//// [/apath/a.ts] + + +//// [/apath/b.ts] + + +//// [/apath/tsconfig.json] +{ + "typeAcquisition": { + "enableAutoDiscovy": true, + } +} + + +configFileName:: tsconfig.json +CompilerOptions:: +{ + "configFilePath": "/apath/tsconfig.json" +} + +TypeAcquisition:: +{} + +FileNames:: +/apath/a.ts,/apath/b.ts +Errors:: +tsconfig.json:3:3 - error TS5023: Unknown compiler option 'enableAutoDiscovy'. + +3 "enableAutoDiscovy": true, +   ~~~~~~~~~~~~~~~~~~~ + diff --git a/testdata/baselines/reference/config/tsconfigParsing/Convert jsconfig.json to typeAcquisition with json api.js b/testdata/baselines/reference/config/tsconfigParsing/Convert jsconfig.json to typeAcquisition with json api.js new file mode 100644 index 0000000000..635e793804 --- /dev/null +++ b/testdata/baselines/reference/config/tsconfigParsing/Convert jsconfig.json to typeAcquisition with json api.js @@ -0,0 +1,43 @@ +Fs:: +//// [/apath/a.ts] + + +//// [/apath/b.ts] + + +//// [/apath/jsconfig.json] +{ + "typeAcquisition": { + "enable": false, + "include": ["0.d.ts"], + "exclude": ["0.js"], + }, +} + + +configFileName:: jsconfig.json +CompilerOptions:: +{ + "allowJs": true, + "allowSyntheticDefaultImports": true, + "noEmit": true, + "skipLibCheck": true, + "maxNodeModuleJsDepth": 2, + "configFilePath": "/apath/jsconfig.json" +} + +TypeAcquisition:: +{ + "enable": false, + "include": [ + "0.d.ts" + ], + "exclude": [ + "0.js" + ] +} + +FileNames:: +/apath/a.ts,/apath/b.ts +Errors:: + diff --git a/testdata/baselines/reference/config/tsconfigParsing/Convert jsconfig.json to typeAcquisition with jsonSourceFile api.js b/testdata/baselines/reference/config/tsconfigParsing/Convert jsconfig.json to typeAcquisition with jsonSourceFile api.js new file mode 100644 index 0000000000..635e793804 --- /dev/null +++ b/testdata/baselines/reference/config/tsconfigParsing/Convert jsconfig.json to typeAcquisition with jsonSourceFile api.js @@ -0,0 +1,43 @@ +Fs:: +//// [/apath/a.ts] + + +//// [/apath/b.ts] + + +//// [/apath/jsconfig.json] +{ + "typeAcquisition": { + "enable": false, + "include": ["0.d.ts"], + "exclude": ["0.js"], + }, +} + + +configFileName:: jsconfig.json +CompilerOptions:: +{ + "allowJs": true, + "allowSyntheticDefaultImports": true, + "noEmit": true, + "skipLibCheck": true, + "maxNodeModuleJsDepth": 2, + "configFilePath": "/apath/jsconfig.json" +} + +TypeAcquisition:: +{ + "enable": false, + "include": [ + "0.d.ts" + ], + "exclude": [ + "0.js" + ] +} + +FileNames:: +/apath/a.ts,/apath/b.ts +Errors:: + diff --git a/testdata/baselines/reference/config/tsconfigParsing/Convert jsconfig.json with only enable property to typeAcquisition with json api.js b/testdata/baselines/reference/config/tsconfigParsing/Convert jsconfig.json with only enable property to typeAcquisition with json api.js new file mode 100644 index 0000000000..af7e57f335 --- /dev/null +++ b/testdata/baselines/reference/config/tsconfigParsing/Convert jsconfig.json with only enable property to typeAcquisition with json api.js @@ -0,0 +1,35 @@ +Fs:: +//// [/apath/a.ts] + + +//// [/apath/b.ts] + + +//// [/apath/jsconfig.json] +{ + "typeAcquisition": { + "enable": false, + }, +} + + +configFileName:: jsconfig.json +CompilerOptions:: +{ + "allowJs": true, + "allowSyntheticDefaultImports": true, + "noEmit": true, + "skipLibCheck": true, + "maxNodeModuleJsDepth": 2, + "configFilePath": "/apath/jsconfig.json" +} + +TypeAcquisition:: +{ + "enable": false +} + +FileNames:: +/apath/a.ts,/apath/b.ts +Errors:: + diff --git a/testdata/baselines/reference/config/tsconfigParsing/Convert jsconfig.json with only enable property to typeAcquisition with jsonSourceFile api.js b/testdata/baselines/reference/config/tsconfigParsing/Convert jsconfig.json with only enable property to typeAcquisition with jsonSourceFile api.js new file mode 100644 index 0000000000..af7e57f335 --- /dev/null +++ b/testdata/baselines/reference/config/tsconfigParsing/Convert jsconfig.json with only enable property to typeAcquisition with jsonSourceFile api.js @@ -0,0 +1,35 @@ +Fs:: +//// [/apath/a.ts] + + +//// [/apath/b.ts] + + +//// [/apath/jsconfig.json] +{ + "typeAcquisition": { + "enable": false, + }, +} + + +configFileName:: jsconfig.json +CompilerOptions:: +{ + "allowJs": true, + "allowSyntheticDefaultImports": true, + "noEmit": true, + "skipLibCheck": true, + "maxNodeModuleJsDepth": 2, + "configFilePath": "/apath/jsconfig.json" +} + +TypeAcquisition:: +{ + "enable": false +} + +FileNames:: +/apath/a.ts,/apath/b.ts +Errors:: + diff --git a/testdata/baselines/reference/config/tsconfigParsing/Convert tsconfig.json with only enable property to typeAcquisition with json api.js b/testdata/baselines/reference/config/tsconfigParsing/Convert tsconfig.json with only enable property to typeAcquisition with json api.js new file mode 100644 index 0000000000..0a4d718a53 --- /dev/null +++ b/testdata/baselines/reference/config/tsconfigParsing/Convert tsconfig.json with only enable property to typeAcquisition with json api.js @@ -0,0 +1,30 @@ +Fs:: +//// [/apath/a.ts] + + +//// [/apath/b.ts] + + +//// [/apath/tsconfig.json] +{ + "typeAcquisition": { + "enable": true, + }, +} + + +configFileName:: tsconfig.json +CompilerOptions:: +{ + "configFilePath": "/apath/tsconfig.json" +} + +TypeAcquisition:: +{ + "enable": true +} + +FileNames:: +/apath/a.ts,/apath/b.ts +Errors:: + diff --git a/testdata/baselines/reference/config/tsconfigParsing/Convert tsconfig.json with only enable property to typeAcquisition with jsonSourceFile api.js b/testdata/baselines/reference/config/tsconfigParsing/Convert tsconfig.json with only enable property to typeAcquisition with jsonSourceFile api.js new file mode 100644 index 0000000000..0a4d718a53 --- /dev/null +++ b/testdata/baselines/reference/config/tsconfigParsing/Convert tsconfig.json with only enable property to typeAcquisition with jsonSourceFile api.js @@ -0,0 +1,30 @@ +Fs:: +//// [/apath/a.ts] + + +//// [/apath/b.ts] + + +//// [/apath/tsconfig.json] +{ + "typeAcquisition": { + "enable": true, + }, +} + + +configFileName:: tsconfig.json +CompilerOptions:: +{ + "configFilePath": "/apath/tsconfig.json" +} + +TypeAcquisition:: +{ + "enable": true +} + +FileNames:: +/apath/a.ts,/apath/b.ts +Errors:: + diff --git a/testdata/baselines/reference/config/tsconfigParsing/allow dotted files and folders when explicitly requested with json api.js b/testdata/baselines/reference/config/tsconfigParsing/allow dotted files and folders when explicitly requested with json api.js index 41df8cba3c..175532f3b1 100644 --- a/testdata/baselines/reference/config/tsconfigParsing/allow dotted files and folders when explicitly requested with json api.js +++ b/testdata/baselines/reference/config/tsconfigParsing/allow dotted files and folders when explicitly requested with json api.js @@ -23,6 +23,9 @@ CompilerOptions:: "configFilePath": "/apath/tsconfig.json" } +TypeAcquisition:: +{} + FileNames:: /apath/.git/a.ts,/apath/.b.ts,/apath/..c.ts Errors:: diff --git a/testdata/baselines/reference/config/tsconfigParsing/allow dotted files and folders when explicitly requested with jsonSourceFile api.js b/testdata/baselines/reference/config/tsconfigParsing/allow dotted files and folders when explicitly requested with jsonSourceFile api.js index 41df8cba3c..175532f3b1 100644 --- a/testdata/baselines/reference/config/tsconfigParsing/allow dotted files and folders when explicitly requested with jsonSourceFile api.js +++ b/testdata/baselines/reference/config/tsconfigParsing/allow dotted files and folders when explicitly requested with jsonSourceFile api.js @@ -23,6 +23,9 @@ CompilerOptions:: "configFilePath": "/apath/tsconfig.json" } +TypeAcquisition:: +{} + FileNames:: /apath/.git/a.ts,/apath/.b.ts,/apath/..c.ts Errors:: diff --git a/testdata/baselines/reference/config/tsconfigParsing/does not generate errors for empty files list when one or more references are provided with json api.js b/testdata/baselines/reference/config/tsconfigParsing/does not generate errors for empty files list when one or more references are provided with json api.js index 5643e1f3a2..5c81324807 100644 --- a/testdata/baselines/reference/config/tsconfigParsing/does not generate errors for empty files list when one or more references are provided with json api.js +++ b/testdata/baselines/reference/config/tsconfigParsing/does not generate errors for empty files list when one or more references are provided with json api.js @@ -15,6 +15,9 @@ CompilerOptions:: "configFilePath": "/apath/tsconfig.json" } +TypeAcquisition:: +{} + FileNames:: Errors:: diff --git a/testdata/baselines/reference/config/tsconfigParsing/does not generate errors for empty files list when one or more references are provided with jsonSourceFile api.js b/testdata/baselines/reference/config/tsconfigParsing/does not generate errors for empty files list when one or more references are provided with jsonSourceFile api.js index 5643e1f3a2..5c81324807 100644 --- a/testdata/baselines/reference/config/tsconfigParsing/does not generate errors for empty files list when one or more references are provided with jsonSourceFile api.js +++ b/testdata/baselines/reference/config/tsconfigParsing/does not generate errors for empty files list when one or more references are provided with jsonSourceFile api.js @@ -15,6 +15,9 @@ CompilerOptions:: "configFilePath": "/apath/tsconfig.json" } +TypeAcquisition:: +{} + FileNames:: Errors:: diff --git a/testdata/baselines/reference/config/tsconfigParsing/exclude declarationDir unless overridden with json api.js b/testdata/baselines/reference/config/tsconfigParsing/exclude declarationDir unless overridden with json api.js index 2225a78419..0cdf80c939 100644 --- a/testdata/baselines/reference/config/tsconfigParsing/exclude declarationDir unless overridden with json api.js +++ b/testdata/baselines/reference/config/tsconfigParsing/exclude declarationDir unless overridden with json api.js @@ -20,6 +20,9 @@ CompilerOptions:: "configFilePath": "/tsconfig.json" } +TypeAcquisition:: +{} + FileNames:: /a.ts Errors:: @@ -48,6 +51,9 @@ CompilerOptions:: "configFilePath": "/tsconfig.json" } +TypeAcquisition:: +{} + FileNames:: /a.ts,/declarations/a.d.ts Errors:: diff --git a/testdata/baselines/reference/config/tsconfigParsing/exclude declarationDir unless overridden with jsonSourceFile api.js b/testdata/baselines/reference/config/tsconfigParsing/exclude declarationDir unless overridden with jsonSourceFile api.js index 2225a78419..0cdf80c939 100644 --- a/testdata/baselines/reference/config/tsconfigParsing/exclude declarationDir unless overridden with jsonSourceFile api.js +++ b/testdata/baselines/reference/config/tsconfigParsing/exclude declarationDir unless overridden with jsonSourceFile api.js @@ -20,6 +20,9 @@ CompilerOptions:: "configFilePath": "/tsconfig.json" } +TypeAcquisition:: +{} + FileNames:: /a.ts Errors:: @@ -48,6 +51,9 @@ CompilerOptions:: "configFilePath": "/tsconfig.json" } +TypeAcquisition:: +{} + FileNames:: /a.ts,/declarations/a.d.ts Errors:: diff --git a/testdata/baselines/reference/config/tsconfigParsing/exclude outDir unless overridden with json api.js b/testdata/baselines/reference/config/tsconfigParsing/exclude outDir unless overridden with json api.js index baed91368e..081a9b534c 100644 --- a/testdata/baselines/reference/config/tsconfigParsing/exclude outDir unless overridden with json api.js +++ b/testdata/baselines/reference/config/tsconfigParsing/exclude outDir unless overridden with json api.js @@ -20,6 +20,9 @@ CompilerOptions:: "configFilePath": "/tsconfig.json" } +TypeAcquisition:: +{} + FileNames:: /b.ts Errors:: @@ -48,6 +51,9 @@ CompilerOptions:: "configFilePath": "/tsconfig.json" } +TypeAcquisition:: +{} + FileNames:: /b.ts,/bin/a.ts Errors:: diff --git a/testdata/baselines/reference/config/tsconfigParsing/exclude outDir unless overridden with jsonSourceFile api.js b/testdata/baselines/reference/config/tsconfigParsing/exclude outDir unless overridden with jsonSourceFile api.js index baed91368e..081a9b534c 100644 --- a/testdata/baselines/reference/config/tsconfigParsing/exclude outDir unless overridden with jsonSourceFile api.js +++ b/testdata/baselines/reference/config/tsconfigParsing/exclude outDir unless overridden with jsonSourceFile api.js @@ -20,6 +20,9 @@ CompilerOptions:: "configFilePath": "/tsconfig.json" } +TypeAcquisition:: +{} + FileNames:: /b.ts Errors:: @@ -48,6 +51,9 @@ CompilerOptions:: "configFilePath": "/tsconfig.json" } +TypeAcquisition:: +{} + FileNames:: /b.ts,/bin/a.ts Errors:: diff --git a/testdata/baselines/reference/config/tsconfigParsing/generates errors for directory with no .ts files with json api.js b/testdata/baselines/reference/config/tsconfigParsing/generates errors for directory with no .ts files with json api.js index 8408f57e39..24ce2d8786 100644 --- a/testdata/baselines/reference/config/tsconfigParsing/generates errors for directory with no .ts files with json api.js +++ b/testdata/baselines/reference/config/tsconfigParsing/generates errors for directory with no .ts files with json api.js @@ -13,6 +13,9 @@ CompilerOptions:: "configFilePath": "/apath/tsconfig.json" } +TypeAcquisition:: +{} + FileNames:: Errors:: diff --git a/testdata/baselines/reference/config/tsconfigParsing/generates errors for directory with no .ts files with jsonSourceFile api.js b/testdata/baselines/reference/config/tsconfigParsing/generates errors for directory with no .ts files with jsonSourceFile api.js index 8408f57e39..24ce2d8786 100644 --- a/testdata/baselines/reference/config/tsconfigParsing/generates errors for directory with no .ts files with jsonSourceFile api.js +++ b/testdata/baselines/reference/config/tsconfigParsing/generates errors for directory with no .ts files with jsonSourceFile api.js @@ -13,6 +13,9 @@ CompilerOptions:: "configFilePath": "/apath/tsconfig.json" } +TypeAcquisition:: +{} + FileNames:: Errors:: diff --git a/testdata/baselines/reference/config/tsconfigParsing/generates errors for empty directory with json api.js b/testdata/baselines/reference/config/tsconfigParsing/generates errors for empty directory with json api.js index e8591c1021..a00540cbe5 100644 --- a/testdata/baselines/reference/config/tsconfigParsing/generates errors for empty directory with json api.js +++ b/testdata/baselines/reference/config/tsconfigParsing/generates errors for empty directory with json api.js @@ -14,6 +14,9 @@ CompilerOptions:: "configFilePath": "/apath/tsconfig.json" } +TypeAcquisition:: +{} + FileNames:: Errors:: diff --git a/testdata/baselines/reference/config/tsconfigParsing/generates errors for empty directory with jsonSourceFile api.js b/testdata/baselines/reference/config/tsconfigParsing/generates errors for empty directory with jsonSourceFile api.js index e8591c1021..a00540cbe5 100644 --- a/testdata/baselines/reference/config/tsconfigParsing/generates errors for empty directory with jsonSourceFile api.js +++ b/testdata/baselines/reference/config/tsconfigParsing/generates errors for empty directory with jsonSourceFile api.js @@ -14,6 +14,9 @@ CompilerOptions:: "configFilePath": "/apath/tsconfig.json" } +TypeAcquisition:: +{} + FileNames:: Errors:: diff --git a/testdata/baselines/reference/config/tsconfigParsing/generates errors for empty files list when no references are provided with json api.js b/testdata/baselines/reference/config/tsconfigParsing/generates errors for empty files list when no references are provided with json api.js index ece28dd2f8..cc50404d52 100644 --- a/testdata/baselines/reference/config/tsconfigParsing/generates errors for empty files list when no references are provided with json api.js +++ b/testdata/baselines/reference/config/tsconfigParsing/generates errors for empty files list when no references are provided with json api.js @@ -15,6 +15,9 @@ CompilerOptions:: "configFilePath": "/apath/tsconfig.json" } +TypeAcquisition:: +{} + FileNames:: Errors:: diff --git a/testdata/baselines/reference/config/tsconfigParsing/generates errors for empty files list when no references are provided with jsonSourceFile api.js b/testdata/baselines/reference/config/tsconfigParsing/generates errors for empty files list when no references are provided with jsonSourceFile api.js index 84739c3f58..fe6c9af767 100644 --- a/testdata/baselines/reference/config/tsconfigParsing/generates errors for empty files list when no references are provided with jsonSourceFile api.js +++ b/testdata/baselines/reference/config/tsconfigParsing/generates errors for empty files list when no references are provided with jsonSourceFile api.js @@ -15,6 +15,9 @@ CompilerOptions:: "configFilePath": "/apath/tsconfig.json" } +TypeAcquisition:: +{} + FileNames:: Errors:: diff --git a/testdata/baselines/reference/config/tsconfigParsing/generates errors for empty files list with json api.js b/testdata/baselines/reference/config/tsconfigParsing/generates errors for empty files list with json api.js index ecb617a24f..054c795ee1 100644 --- a/testdata/baselines/reference/config/tsconfigParsing/generates errors for empty files list with json api.js +++ b/testdata/baselines/reference/config/tsconfigParsing/generates errors for empty files list with json api.js @@ -14,6 +14,9 @@ CompilerOptions:: "configFilePath": "/apath/tsconfig.json" } +TypeAcquisition:: +{} + FileNames:: Errors:: diff --git a/testdata/baselines/reference/config/tsconfigParsing/generates errors for empty files list with jsonSourceFile api.js b/testdata/baselines/reference/config/tsconfigParsing/generates errors for empty files list with jsonSourceFile api.js index feb107fbe8..c675f9bff7 100644 --- a/testdata/baselines/reference/config/tsconfigParsing/generates errors for empty files list with jsonSourceFile api.js +++ b/testdata/baselines/reference/config/tsconfigParsing/generates errors for empty files list with jsonSourceFile api.js @@ -14,6 +14,9 @@ CompilerOptions:: "configFilePath": "/apath/tsconfig.json" } +TypeAcquisition:: +{} + FileNames:: Errors:: diff --git a/testdata/baselines/reference/config/tsconfigParsing/generates errors for empty include with json api.js b/testdata/baselines/reference/config/tsconfigParsing/generates errors for empty include with json api.js index de9832d3fe..c4ac0f0e00 100644 --- a/testdata/baselines/reference/config/tsconfigParsing/generates errors for empty include with json api.js +++ b/testdata/baselines/reference/config/tsconfigParsing/generates errors for empty include with json api.js @@ -14,6 +14,9 @@ CompilerOptions:: "configFilePath": "/apath/tsconfig.json" } +TypeAcquisition:: +{} + FileNames:: Errors:: diff --git a/testdata/baselines/reference/config/tsconfigParsing/generates errors for empty include with jsonSourceFile api.js b/testdata/baselines/reference/config/tsconfigParsing/generates errors for empty include with jsonSourceFile api.js index de9832d3fe..c4ac0f0e00 100644 --- a/testdata/baselines/reference/config/tsconfigParsing/generates errors for empty include with jsonSourceFile api.js +++ b/testdata/baselines/reference/config/tsconfigParsing/generates errors for empty include with jsonSourceFile api.js @@ -14,6 +14,9 @@ CompilerOptions:: "configFilePath": "/apath/tsconfig.json" } +TypeAcquisition:: +{} + FileNames:: Errors:: diff --git a/testdata/baselines/reference/config/tsconfigParsing/generates errors for includes with outDir with json api.js b/testdata/baselines/reference/config/tsconfigParsing/generates errors for includes with outDir with json api.js index 4b0bf403e5..9abb987e34 100644 --- a/testdata/baselines/reference/config/tsconfigParsing/generates errors for includes with outDir with json api.js +++ b/testdata/baselines/reference/config/tsconfigParsing/generates errors for includes with outDir with json api.js @@ -18,6 +18,9 @@ CompilerOptions:: "configFilePath": "/apath/tsconfig.json" } +TypeAcquisition:: +{} + FileNames:: Errors:: diff --git a/testdata/baselines/reference/config/tsconfigParsing/generates errors for includes with outDir with jsonSourceFile api.js b/testdata/baselines/reference/config/tsconfigParsing/generates errors for includes with outDir with jsonSourceFile api.js index 4b0bf403e5..9abb987e34 100644 --- a/testdata/baselines/reference/config/tsconfigParsing/generates errors for includes with outDir with jsonSourceFile api.js +++ b/testdata/baselines/reference/config/tsconfigParsing/generates errors for includes with outDir with jsonSourceFile api.js @@ -18,6 +18,9 @@ CompilerOptions:: "configFilePath": "/apath/tsconfig.json" } +TypeAcquisition:: +{} + FileNames:: Errors:: diff --git a/testdata/baselines/reference/config/tsconfigParsing/generates errors when commandline option is in tsconfig with json api.js b/testdata/baselines/reference/config/tsconfigParsing/generates errors when commandline option is in tsconfig with json api.js index f9a5a14a70..ed31c0f6f6 100644 --- a/testdata/baselines/reference/config/tsconfigParsing/generates errors when commandline option is in tsconfig with json api.js +++ b/testdata/baselines/reference/config/tsconfigParsing/generates errors when commandline option is in tsconfig with json api.js @@ -16,6 +16,9 @@ CompilerOptions:: "configFilePath": "/apath/tsconfig.json" } +TypeAcquisition:: +{} + FileNames:: /apath/a.ts Errors:: diff --git a/testdata/baselines/reference/config/tsconfigParsing/generates errors when commandline option is in tsconfig with jsonSourceFile api.js b/testdata/baselines/reference/config/tsconfigParsing/generates errors when commandline option is in tsconfig with jsonSourceFile api.js index 6a347322a0..128b6d4244 100644 --- a/testdata/baselines/reference/config/tsconfigParsing/generates errors when commandline option is in tsconfig with jsonSourceFile api.js +++ b/testdata/baselines/reference/config/tsconfigParsing/generates errors when commandline option is in tsconfig with jsonSourceFile api.js @@ -16,6 +16,9 @@ CompilerOptions:: "configFilePath": "/apath/tsconfig.json" } +TypeAcquisition:: +{} + FileNames:: /apath/a.ts Errors:: diff --git a/testdata/baselines/reference/config/tsconfigParsing/generates errors when files is not string with json api.js b/testdata/baselines/reference/config/tsconfigParsing/generates errors when files is not string with json api.js index 6696e9779c..48d23ad2ab 100644 --- a/testdata/baselines/reference/config/tsconfigParsing/generates errors when files is not string with json api.js +++ b/testdata/baselines/reference/config/tsconfigParsing/generates errors when files is not string with json api.js @@ -21,6 +21,9 @@ CompilerOptions:: "configFilePath": "/apath/tsconfig.json" } +TypeAcquisition:: +{} + FileNames:: Errors:: diff --git a/testdata/baselines/reference/config/tsconfigParsing/generates errors when files is not string with jsonSourceFile api.js b/testdata/baselines/reference/config/tsconfigParsing/generates errors when files is not string with jsonSourceFile api.js index 45aa4d54c0..d805194c9d 100644 --- a/testdata/baselines/reference/config/tsconfigParsing/generates errors when files is not string with jsonSourceFile api.js +++ b/testdata/baselines/reference/config/tsconfigParsing/generates errors when files is not string with jsonSourceFile api.js @@ -21,6 +21,9 @@ CompilerOptions:: "configFilePath": "/apath/tsconfig.json" } +TypeAcquisition:: +{} + FileNames:: Errors:: diff --git a/testdata/baselines/reference/config/tsconfigParsing/generates errors when include is not string with json api.js b/testdata/baselines/reference/config/tsconfigParsing/generates errors when include is not string with json api.js index 2d40d4b246..eee35e977e 100644 --- a/testdata/baselines/reference/config/tsconfigParsing/generates errors when include is not string with json api.js +++ b/testdata/baselines/reference/config/tsconfigParsing/generates errors when include is not string with json api.js @@ -18,6 +18,9 @@ CompilerOptions:: "configFilePath": "/apath/tsconfig.json" } +TypeAcquisition:: +{} + FileNames:: Errors:: diff --git a/testdata/baselines/reference/config/tsconfigParsing/generates errors when include is not string with jsonSourceFile api.js b/testdata/baselines/reference/config/tsconfigParsing/generates errors when include is not string with jsonSourceFile api.js index 5b34594c8a..f80a642fe6 100644 --- a/testdata/baselines/reference/config/tsconfigParsing/generates errors when include is not string with jsonSourceFile api.js +++ b/testdata/baselines/reference/config/tsconfigParsing/generates errors when include is not string with jsonSourceFile api.js @@ -18,6 +18,9 @@ CompilerOptions:: "configFilePath": "/apath/tsconfig.json" } +TypeAcquisition:: +{} + FileNames:: Errors:: diff --git a/testdata/baselines/reference/config/tsconfigParsing/handles empty types array with json api.js b/testdata/baselines/reference/config/tsconfigParsing/handles empty types array with json api.js index 7e43406ec5..3b89474f7b 100644 --- a/testdata/baselines/reference/config/tsconfigParsing/handles empty types array with json api.js +++ b/testdata/baselines/reference/config/tsconfigParsing/handles empty types array with json api.js @@ -17,6 +17,9 @@ CompilerOptions:: "configFilePath": "/tsconfig.json" } +TypeAcquisition:: +{} + FileNames:: /app.ts Errors:: diff --git a/testdata/baselines/reference/config/tsconfigParsing/handles empty types array with jsonSourceFile api.js b/testdata/baselines/reference/config/tsconfigParsing/handles empty types array with jsonSourceFile api.js index 7e43406ec5..3b89474f7b 100644 --- a/testdata/baselines/reference/config/tsconfigParsing/handles empty types array with jsonSourceFile api.js +++ b/testdata/baselines/reference/config/tsconfigParsing/handles empty types array with jsonSourceFile api.js @@ -17,6 +17,9 @@ CompilerOptions:: "configFilePath": "/tsconfig.json" } +TypeAcquisition:: +{} + FileNames:: /app.ts Errors:: diff --git a/testdata/baselines/reference/config/tsconfigParsing/ignore dotted files and folders with json api.js b/testdata/baselines/reference/config/tsconfigParsing/ignore dotted files and folders with json api.js index 936f910926..222f1cf119 100644 --- a/testdata/baselines/reference/config/tsconfigParsing/ignore dotted files and folders with json api.js +++ b/testdata/baselines/reference/config/tsconfigParsing/ignore dotted files and folders with json api.js @@ -21,6 +21,9 @@ CompilerOptions:: "configFilePath": "/apath/tsconfig.json" } +TypeAcquisition:: +{} + FileNames:: /apath/test.ts Errors:: diff --git a/testdata/baselines/reference/config/tsconfigParsing/ignore dotted files and folders with jsonSourceFile api.js b/testdata/baselines/reference/config/tsconfigParsing/ignore dotted files and folders with jsonSourceFile api.js index 936f910926..222f1cf119 100644 --- a/testdata/baselines/reference/config/tsconfigParsing/ignore dotted files and folders with jsonSourceFile api.js +++ b/testdata/baselines/reference/config/tsconfigParsing/ignore dotted files and folders with jsonSourceFile api.js @@ -21,6 +21,9 @@ CompilerOptions:: "configFilePath": "/apath/tsconfig.json" } +TypeAcquisition:: +{} + FileNames:: /apath/test.ts Errors:: diff --git a/testdata/baselines/reference/config/tsconfigParsing/implicitly exclude common package folders with json api.js b/testdata/baselines/reference/config/tsconfigParsing/implicitly exclude common package folders with json api.js index 7cd2733552..0346b2cb8c 100644 --- a/testdata/baselines/reference/config/tsconfigParsing/implicitly exclude common package folders with json api.js +++ b/testdata/baselines/reference/config/tsconfigParsing/implicitly exclude common package folders with json api.js @@ -24,6 +24,9 @@ CompilerOptions:: "configFilePath": "/tsconfig.json" } +TypeAcquisition:: +{} + FileNames:: /d.ts,/folder/e.ts Errors:: diff --git a/testdata/baselines/reference/config/tsconfigParsing/implicitly exclude common package folders with jsonSourceFile api.js b/testdata/baselines/reference/config/tsconfigParsing/implicitly exclude common package folders with jsonSourceFile api.js index 7cd2733552..0346b2cb8c 100644 --- a/testdata/baselines/reference/config/tsconfigParsing/implicitly exclude common package folders with jsonSourceFile api.js +++ b/testdata/baselines/reference/config/tsconfigParsing/implicitly exclude common package folders with jsonSourceFile api.js @@ -24,6 +24,9 @@ CompilerOptions:: "configFilePath": "/tsconfig.json" } +TypeAcquisition:: +{} + FileNames:: /d.ts,/folder/e.ts Errors:: diff --git a/testdata/baselines/reference/config/tsconfigParsing/parses tsconfig with compilerOptions, files, include, and exclude with json api.js b/testdata/baselines/reference/config/tsconfigParsing/parses tsconfig with compilerOptions, files, include, and exclude with json api.js index 1928ba5e87..55907663a5 100644 --- a/testdata/baselines/reference/config/tsconfigParsing/parses tsconfig with compilerOptions, files, include, and exclude with json api.js +++ b/testdata/baselines/reference/config/tsconfigParsing/parses tsconfig with compilerOptions, files, include, and exclude with json api.js @@ -53,6 +53,9 @@ CompilerOptions:: "pathsBasePath": "/apath" } +TypeAcquisition:: +{} + FileNames:: /apath/src/index.ts,/apath/src/app.ts Errors:: diff --git a/testdata/baselines/reference/config/tsconfigParsing/parses tsconfig with compilerOptions, files, include, and exclude with jsonSourceFile api.js b/testdata/baselines/reference/config/tsconfigParsing/parses tsconfig with compilerOptions, files, include, and exclude with jsonSourceFile api.js index 1928ba5e87..55907663a5 100644 --- a/testdata/baselines/reference/config/tsconfigParsing/parses tsconfig with compilerOptions, files, include, and exclude with jsonSourceFile api.js +++ b/testdata/baselines/reference/config/tsconfigParsing/parses tsconfig with compilerOptions, files, include, and exclude with jsonSourceFile api.js @@ -53,6 +53,9 @@ CompilerOptions:: "pathsBasePath": "/apath" } +TypeAcquisition:: +{} + FileNames:: /apath/src/index.ts,/apath/src/app.ts Errors:: diff --git a/testdata/baselines/reference/config/tsconfigParsing/parses tsconfig with extends and configDir with json api.js b/testdata/baselines/reference/config/tsconfigParsing/parses tsconfig with extends and configDir with json api.js index 49b0c53e1d..63df2cbe6a 100644 --- a/testdata/baselines/reference/config/tsconfigParsing/parses tsconfig with extends and configDir with json api.js +++ b/testdata/baselines/reference/config/tsconfigParsing/parses tsconfig with extends and configDir with json api.js @@ -41,6 +41,9 @@ CompilerOptions:: "configFilePath": "/tsconfig.json" } +TypeAcquisition:: +{} + FileNames:: /src/app.ts,/src/index.ts Errors:: diff --git a/testdata/baselines/reference/config/tsconfigParsing/parses tsconfig with extends and configDir with jsonSourceFile api.js b/testdata/baselines/reference/config/tsconfigParsing/parses tsconfig with extends and configDir with jsonSourceFile api.js index 49b0c53e1d..63df2cbe6a 100644 --- a/testdata/baselines/reference/config/tsconfigParsing/parses tsconfig with extends and configDir with jsonSourceFile api.js +++ b/testdata/baselines/reference/config/tsconfigParsing/parses tsconfig with extends and configDir with jsonSourceFile api.js @@ -41,6 +41,9 @@ CompilerOptions:: "configFilePath": "/tsconfig.json" } +TypeAcquisition:: +{} + FileNames:: /src/app.ts,/src/index.ts Errors:: diff --git a/testdata/baselines/reference/config/tsconfigParsing/parses tsconfig with extends, files, include and other options with json api.js b/testdata/baselines/reference/config/tsconfigParsing/parses tsconfig with extends, files, include and other options with json api.js index 93bb9a4fef..f75da7b5d4 100644 --- a/testdata/baselines/reference/config/tsconfigParsing/parses tsconfig with extends, files, include and other options with json api.js +++ b/testdata/baselines/reference/config/tsconfigParsing/parses tsconfig with extends, files, include and other options with json api.js @@ -46,6 +46,9 @@ CompilerOptions:: "configFilePath": "/tsconfig.json" } +TypeAcquisition:: +{} + FileNames:: /src/index.ts,/src/app.ts Errors:: diff --git a/testdata/baselines/reference/config/tsconfigParsing/parses tsconfig with extends, files, include and other options with jsonSourceFile api.js b/testdata/baselines/reference/config/tsconfigParsing/parses tsconfig with extends, files, include and other options with jsonSourceFile api.js index 93bb9a4fef..f75da7b5d4 100644 --- a/testdata/baselines/reference/config/tsconfigParsing/parses tsconfig with extends, files, include and other options with jsonSourceFile api.js +++ b/testdata/baselines/reference/config/tsconfigParsing/parses tsconfig with extends, files, include and other options with jsonSourceFile api.js @@ -46,6 +46,9 @@ CompilerOptions:: "configFilePath": "/tsconfig.json" } +TypeAcquisition:: +{} + FileNames:: /src/index.ts,/src/app.ts Errors:: diff --git a/testdata/baselines/reference/config/tsconfigParsing/reports error for an unknown option with json api.js b/testdata/baselines/reference/config/tsconfigParsing/reports error for an unknown option with json api.js index 0b74274927..e57fd5ae6a 100644 --- a/testdata/baselines/reference/config/tsconfigParsing/reports error for an unknown option with json api.js +++ b/testdata/baselines/reference/config/tsconfigParsing/reports error for an unknown option with json api.js @@ -16,6 +16,9 @@ CompilerOptions:: "configFilePath": "/tsconfig.json" } +TypeAcquisition:: +{} + FileNames:: /app.ts Errors:: diff --git a/testdata/baselines/reference/config/tsconfigParsing/reports error for an unknown option with jsonSourceFile api.js b/testdata/baselines/reference/config/tsconfigParsing/reports error for an unknown option with jsonSourceFile api.js index 94bf89ec37..be69bd287a 100644 --- a/testdata/baselines/reference/config/tsconfigParsing/reports error for an unknown option with jsonSourceFile api.js +++ b/testdata/baselines/reference/config/tsconfigParsing/reports error for an unknown option with jsonSourceFile api.js @@ -16,6 +16,9 @@ CompilerOptions:: "configFilePath": "/tsconfig.json" } +TypeAcquisition:: +{} + FileNames:: /app.ts Errors:: diff --git a/testdata/baselines/reference/config/tsconfigParsing/reports errors for wrong type option and invalid enum value with json api.js b/testdata/baselines/reference/config/tsconfigParsing/reports errors for wrong type option and invalid enum value with json api.js index 78f5175eef..0e039cbeea 100644 --- a/testdata/baselines/reference/config/tsconfigParsing/reports errors for wrong type option and invalid enum value with json api.js +++ b/testdata/baselines/reference/config/tsconfigParsing/reports errors for wrong type option and invalid enum value with json api.js @@ -18,6 +18,9 @@ CompilerOptions:: "configFilePath": "/tsconfig.json" } +TypeAcquisition:: +{} + FileNames:: /app.ts Errors:: diff --git a/testdata/baselines/reference/config/tsconfigParsing/reports errors for wrong type option and invalid enum value with jsonSourceFile api.js b/testdata/baselines/reference/config/tsconfigParsing/reports errors for wrong type option and invalid enum value with jsonSourceFile api.js index 9fabe67865..fd64261aae 100644 --- a/testdata/baselines/reference/config/tsconfigParsing/reports errors for wrong type option and invalid enum value with jsonSourceFile api.js +++ b/testdata/baselines/reference/config/tsconfigParsing/reports errors for wrong type option and invalid enum value with jsonSourceFile api.js @@ -18,6 +18,9 @@ CompilerOptions:: "configFilePath": "/tsconfig.json" } +TypeAcquisition:: +{} + FileNames:: /app.ts Errors:: diff --git a/testdata/baselines/reference/config/tsconfigParsing/returns error when tsconfig have excludes with json api.js b/testdata/baselines/reference/config/tsconfigParsing/returns error when tsconfig have excludes with json api.js index 20d1945437..c2d147f9da 100644 --- a/testdata/baselines/reference/config/tsconfigParsing/returns error when tsconfig have excludes with json api.js +++ b/testdata/baselines/reference/config/tsconfigParsing/returns error when tsconfig have excludes with json api.js @@ -25,6 +25,9 @@ CompilerOptions:: "configFilePath": "/apath/tsconfig.json" } +TypeAcquisition:: +{} + FileNames:: /apath/foge.ts,/apath/test.ts Errors:: diff --git a/testdata/baselines/reference/config/tsconfigParsing/returns error when tsconfig have excludes with jsonSourceFile api.js b/testdata/baselines/reference/config/tsconfigParsing/returns error when tsconfig have excludes with jsonSourceFile api.js index bf6a9b12ab..b9dd2e7c2b 100644 --- a/testdata/baselines/reference/config/tsconfigParsing/returns error when tsconfig have excludes with jsonSourceFile api.js +++ b/testdata/baselines/reference/config/tsconfigParsing/returns error when tsconfig have excludes with jsonSourceFile api.js @@ -25,6 +25,9 @@ CompilerOptions:: "configFilePath": "/apath/tsconfig.json" } +TypeAcquisition:: +{} + FileNames:: /apath/foge.ts,/apath/test.ts Errors:: diff --git a/testdata/baselines/reference/config/tsconfigParsing/with outDir from base tsconfig with json api.js b/testdata/baselines/reference/config/tsconfigParsing/with outDir from base tsconfig with json api.js index 212351d785..5a9e498fdc 100644 --- a/testdata/baselines/reference/config/tsconfigParsing/with outDir from base tsconfig with json api.js +++ b/testdata/baselines/reference/config/tsconfigParsing/with outDir from base tsconfig with json api.js @@ -25,6 +25,9 @@ CompilerOptions:: "configFilePath": "/tsconfig.json" } +TypeAcquisition:: +{} + FileNames:: /b.ts Errors:: @@ -57,6 +60,9 @@ CompilerOptions:: "configFilePath": "/tsconfig.json" } +TypeAcquisition:: +{} + FileNames:: /b.ts Errors:: diff --git a/testdata/baselines/reference/config/tsconfigParsing/with outDir from base tsconfig with jsonSourceFile api.js b/testdata/baselines/reference/config/tsconfigParsing/with outDir from base tsconfig with jsonSourceFile api.js index 212351d785..5a9e498fdc 100644 --- a/testdata/baselines/reference/config/tsconfigParsing/with outDir from base tsconfig with jsonSourceFile api.js +++ b/testdata/baselines/reference/config/tsconfigParsing/with outDir from base tsconfig with jsonSourceFile api.js @@ -25,6 +25,9 @@ CompilerOptions:: "configFilePath": "/tsconfig.json" } +TypeAcquisition:: +{} + FileNames:: /b.ts Errors:: @@ -57,6 +60,9 @@ CompilerOptions:: "configFilePath": "/tsconfig.json" } +TypeAcquisition:: +{} + FileNames:: /b.ts Errors:: diff --git a/testdata/baselines/reference/tsc/commandLine/Parse---lib-option-with-file-name.js b/testdata/baselines/reference/tsc/commandLine/Parse---lib-option-with-file-name.js index a33a57739b..7bac418a03 100644 --- a/testdata/baselines/reference/tsc/commandLine/Parse---lib-option-with-file-name.js +++ b/testdata/baselines/reference/tsc/commandLine/Parse---lib-option-with-file-name.js @@ -23,6 +23,7 @@ ParsedCommandLine::{ "excludeDirectories": null, "excludeFiles": null }, + "typeAcquisition": null, "fileNames": [ "first.ts" ], diff --git a/testdata/baselines/reference/tsc/commandLine/Parse--p-with-path-to-tsconfig-file.js b/testdata/baselines/reference/tsc/commandLine/Parse--p-with-path-to-tsconfig-file.js index ad84b305d7..6b0b1cfb56 100644 --- a/testdata/baselines/reference/tsc/commandLine/Parse--p-with-path-to-tsconfig-file.js +++ b/testdata/baselines/reference/tsc/commandLine/Parse--p-with-path-to-tsconfig-file.js @@ -23,6 +23,7 @@ ParsedCommandLine::{ "excludeDirectories": null, "excludeFiles": null }, + "typeAcquisition": null, "fileNames": [], "projectReferences": null }, diff --git a/testdata/baselines/reference/tsc/commandLine/Parse--p-with-path-to-tsconfig-folder.js b/testdata/baselines/reference/tsc/commandLine/Parse--p-with-path-to-tsconfig-folder.js index aa896a4fb8..989c52f54b 100644 --- a/testdata/baselines/reference/tsc/commandLine/Parse--p-with-path-to-tsconfig-folder.js +++ b/testdata/baselines/reference/tsc/commandLine/Parse--p-with-path-to-tsconfig-folder.js @@ -23,6 +23,7 @@ ParsedCommandLine::{ "excludeDirectories": null, "excludeFiles": null }, + "typeAcquisition": null, "fileNames": [], "projectReferences": null }, diff --git a/testdata/baselines/reference/tsc/commandLine/Parse--p.js b/testdata/baselines/reference/tsc/commandLine/Parse--p.js index bdefc1c62f..fbb2710c6e 100644 --- a/testdata/baselines/reference/tsc/commandLine/Parse--p.js +++ b/testdata/baselines/reference/tsc/commandLine/Parse--p.js @@ -23,6 +23,7 @@ ParsedCommandLine::{ "excludeDirectories": null, "excludeFiles": null }, + "typeAcquisition": null, "fileNames": [], "projectReferences": null }, diff --git a/testdata/baselines/reference/tsc/commandLine/Parse-enum-type-options.js b/testdata/baselines/reference/tsc/commandLine/Parse-enum-type-options.js index 1039907290..4cb17c49cd 100644 --- a/testdata/baselines/reference/tsc/commandLine/Parse-enum-type-options.js +++ b/testdata/baselines/reference/tsc/commandLine/Parse-enum-type-options.js @@ -24,6 +24,7 @@ ParsedCommandLine::{ "excludeDirectories": null, "excludeFiles": null }, + "typeAcquisition": null, "fileNames": [ "first.ts" ], diff --git a/testdata/baselines/reference/tsc/commandLine/Parse-watch-interval-option-without-tsconfig.json.js b/testdata/baselines/reference/tsc/commandLine/Parse-watch-interval-option-without-tsconfig.json.js index 041ee2b860..a931b06328 100644 --- a/testdata/baselines/reference/tsc/commandLine/Parse-watch-interval-option-without-tsconfig.json.js +++ b/testdata/baselines/reference/tsc/commandLine/Parse-watch-interval-option-without-tsconfig.json.js @@ -19,6 +19,7 @@ ParsedCommandLine::{ "excludeDirectories": null, "excludeFiles": null }, + "typeAcquisition": null, "fileNames": [], "projectReferences": null }, diff --git a/testdata/baselines/reference/tsc/commandLine/Parse-watch-interval-option.js b/testdata/baselines/reference/tsc/commandLine/Parse-watch-interval-option.js index bf9762f6cb..edac2bb8e7 100644 --- a/testdata/baselines/reference/tsc/commandLine/Parse-watch-interval-option.js +++ b/testdata/baselines/reference/tsc/commandLine/Parse-watch-interval-option.js @@ -23,6 +23,7 @@ ParsedCommandLine::{ "excludeDirectories": null, "excludeFiles": null }, + "typeAcquisition": null, "fileNames": [], "projectReferences": null }, diff --git a/testdata/baselines/reference/tsc/commandLine/Project-is-empty-string.js b/testdata/baselines/reference/tsc/commandLine/Project-is-empty-string.js index 26db908904..4124c4aa4c 100644 --- a/testdata/baselines/reference/tsc/commandLine/Project-is-empty-string.js +++ b/testdata/baselines/reference/tsc/commandLine/Project-is-empty-string.js @@ -21,6 +21,7 @@ ParsedCommandLine::{ "excludeDirectories": null, "excludeFiles": null }, + "typeAcquisition": null, "fileNames": [], "projectReferences": null }, diff --git a/testdata/baselines/reference/tsc/commandLine/does-not-add-color-when-NO_COLOR-is-set.js b/testdata/baselines/reference/tsc/commandLine/does-not-add-color-when-NO_COLOR-is-set.js index ebe8d8a5ad..c6afeb36f5 100644 --- a/testdata/baselines/reference/tsc/commandLine/does-not-add-color-when-NO_COLOR-is-set.js +++ b/testdata/baselines/reference/tsc/commandLine/does-not-add-color-when-NO_COLOR-is-set.js @@ -17,6 +17,7 @@ ParsedCommandLine::{ "excludeDirectories": null, "excludeFiles": null }, + "typeAcquisition": null, "fileNames": [], "projectReferences": null }, diff --git a/testdata/baselines/reference/tsc/commandLine/help-all.js b/testdata/baselines/reference/tsc/commandLine/help-all.js index 95cca0f837..fb8a975db6 100644 --- a/testdata/baselines/reference/tsc/commandLine/help-all.js +++ b/testdata/baselines/reference/tsc/commandLine/help-all.js @@ -20,6 +20,7 @@ ParsedCommandLine::{ "excludeDirectories": null, "excludeFiles": null }, + "typeAcquisition": null, "fileNames": [], "projectReferences": null }, diff --git a/testdata/baselines/reference/tsc/commandLine/help.js b/testdata/baselines/reference/tsc/commandLine/help.js index 0b87eb1217..7ec7cc0e97 100644 --- a/testdata/baselines/reference/tsc/commandLine/help.js +++ b/testdata/baselines/reference/tsc/commandLine/help.js @@ -19,6 +19,7 @@ ParsedCommandLine::{ "excludeDirectories": null, "excludeFiles": null }, + "typeAcquisition": null, "fileNames": [], "projectReferences": null }, diff --git a/testdata/baselines/reference/tsc/commandLine/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped-when-host-cannot-provide-terminal-width.js b/testdata/baselines/reference/tsc/commandLine/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped-when-host-cannot-provide-terminal-width.js index ebe8d8a5ad..c6afeb36f5 100644 --- a/testdata/baselines/reference/tsc/commandLine/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped-when-host-cannot-provide-terminal-width.js +++ b/testdata/baselines/reference/tsc/commandLine/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped-when-host-cannot-provide-terminal-width.js @@ -17,6 +17,7 @@ ParsedCommandLine::{ "excludeDirectories": null, "excludeFiles": null }, + "typeAcquisition": null, "fileNames": [], "projectReferences": null }, diff --git a/testdata/baselines/reference/tsc/commandLine/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped.js b/testdata/baselines/reference/tsc/commandLine/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped.js index ebe8d8a5ad..c6afeb36f5 100644 --- a/testdata/baselines/reference/tsc/commandLine/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped.js +++ b/testdata/baselines/reference/tsc/commandLine/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped.js @@ -17,6 +17,7 @@ ParsedCommandLine::{ "excludeDirectories": null, "excludeFiles": null }, + "typeAcquisition": null, "fileNames": [], "projectReferences": null }, diff --git a/testdata/baselines/reference/tsc/commandLine/when-build-not-first-argument.js b/testdata/baselines/reference/tsc/commandLine/when-build-not-first-argument.js index 594072b06c..3bbb252b1f 100644 --- a/testdata/baselines/reference/tsc/commandLine/when-build-not-first-argument.js +++ b/testdata/baselines/reference/tsc/commandLine/when-build-not-first-argument.js @@ -17,6 +17,7 @@ ParsedCommandLine::{ "excludeDirectories": null, "excludeFiles": null }, + "typeAcquisition": null, "fileNames": [], "projectReferences": null }, diff --git a/testdata/baselines/reference/tsc/typeAcquisition/parse-tsconfig-with-typeAcquisition.js b/testdata/baselines/reference/tsc/typeAcquisition/parse-tsconfig-with-typeAcquisition.js new file mode 100644 index 0000000000..b7786490e1 --- /dev/null +++ b/testdata/baselines/reference/tsc/typeAcquisition/parse-tsconfig-with-typeAcquisition.js @@ -0,0 +1,29 @@ + +currentDirectory::/home/src/workspaces/project +useCaseSensitiveFileNames::true +Input:: +//// [/home/src/workspaces/project/tsconfig.json] new file +{ + "compilerOptions": { + "composite": true, + "noEmit": true, + }, + "typeAcquisition": { + "enable": true, + "include": ["0.d.ts", "1.d.ts"], + "exclude": ["0.js", "1.js"], + "disableFilenameBasedTypeAcquisition": true, + }, +} + +ExitStatus:: 2 + +CompilerOptions::{} +Output:: +error TS18003: No inputs were found in config file '/home/src/workspaces/project/tsconfig.json'. Specified 'include' paths were '["**/*"]' and 'exclude' paths were '[]'. + + +Found 1 error. + +//// [/home/src/workspaces/project/tsconfig.json] no change +