From 57f2fbde95cb814e4a073765f47a4ac02bb68786 Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Tue, 7 Feb 2017 21:54:56 -0800 Subject: [PATCH 01/24] Make sure all options have descriptions --- src/compiler/commandLineParser.ts | 66 +++++++++++++++-------- src/compiler/diagnosticMessages.json | 81 ++++++++++++++++++++++++++++ 2 files changed, 125 insertions(+), 22 deletions(-) diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts index 4ee76d7b81..74640a318e 100644 --- a/src/compiler/commandLineParser.ts +++ b/src/compiler/commandLineParser.ts @@ -12,6 +12,7 @@ namespace ts { { name: "charset", type: "string", + description: Diagnostics.The_character_set_of_the_input_files }, compileOnSaveCommandLineOption, { @@ -25,19 +26,23 @@ namespace ts { type: "string", isFilePath: true, paramType: Diagnostics.DIRECTORY, + description: Diagnostics.Output_directory_for_generated_declaration_files }, { name: "diagnostics", type: "boolean", + description: Diagnostics.Show_diagnostic_information }, { name: "extendedDiagnostics", type: "boolean", - experimental: true + experimental: true, + description: Diagnostics.Show_extended_diagnostic_information }, { name: "emitBOM", - type: "boolean" + type: "boolean", + description:Diagnostics.Emit_a_UTF_8_Byte_Order_Mark_BOM_in_the_beginning_of_output_files }, { name: "help", @@ -58,10 +63,12 @@ namespace ts { { name: "inlineSourceMap", type: "boolean", + description: Diagnostics.Emit_a_single_file_with_source_maps_instead_of_having_a_separate_file }, { name: "inlineSources", type: "boolean", + description:Diagnostics.Emit_the_source_alongside_the_sourcemaps_within_a_single_file_requires_inlineSourceMap_or_sourceMap_to_be_set }, { name: "jsx", @@ -86,17 +93,19 @@ namespace ts { { name: "listFiles", type: "boolean", + description: Diagnostics.Print_names_of_files_part_of_the_compilation }, { name: "locale", type: "string", + description: Diagnostics.The_locale_to_use_to_show_error_messages_e_g_en_us }, { name: "mapRoot", type: "string", isFilePath: true, - description: Diagnostics.Specify_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations, paramType: Diagnostics.LOCATION, + description: Diagnostics.Specify_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations, }, { name: "module", @@ -110,8 +119,8 @@ namespace ts { "es6": ModuleKind.ES2015, "es2015": ModuleKind.ES2015, }), - description: Diagnostics.Specify_module_code_generation_Colon_commonjs_amd_system_umd_or_es2015, paramType: Diagnostics.KIND, + description: Diagnostics.Specify_module_code_generation_Colon_commonjs_amd_system_umd_or_es2015, }, { name: "newLine", @@ -119,8 +128,8 @@ namespace ts { "crlf": NewLineKind.CarriageReturnLineFeed, "lf": NewLineKind.LineFeed }), - description: Diagnostics.Specify_the_end_of_line_sequence_to_be_used_when_emitting_files_Colon_CRLF_dos_or_LF_unix, paramType: Diagnostics.NEWLINE, + description: Diagnostics.Specify_the_end_of_line_sequence_to_be_used_when_emitting_files_Colon_CRLF_dos_or_LF_unix, }, { name: "noEmit", @@ -129,7 +138,8 @@ namespace ts { }, { name: "noEmitHelpers", - type: "boolean" + type: "boolean", + description: Diagnostics.Do_not_generate_custom_helper_functions_like_extends_in_compiled_output }, { name: "noEmitOnError", @@ -138,7 +148,8 @@ namespace ts { }, { name: "noErrorTruncation", - type: "boolean" + type: "boolean", + description: Diagnostics.Do_not_truncation_error_messages }, { name: "noImplicitAny", @@ -163,14 +174,17 @@ namespace ts { { name: "noLib", type: "boolean", + description: Diagnostics.Do_not_include_the_default_library_file_lib_d_ts }, { name: "noResolve", type: "boolean", + description:Diagnostics.Do_not_add_triple_slash_references_or_module_import_targets_to_the_list_of_compiled_files }, { name: "skipDefaultLibCheck", type: "boolean", + description: Diagnostics.Skip_type_checking_of_default_library_declaration_files }, { name: "skipLibCheck", @@ -183,20 +197,21 @@ namespace ts { isFilePath: false, // This is intentionally broken to support compatability with existing tsconfig files // for correct behaviour, please use outFile paramType: Diagnostics.FILE, + description: Diagnostics.Concatenate_and_emit_output_to_single_file, }, { name: "outFile", type: "string", isFilePath: true, - description: Diagnostics.Concatenate_and_emit_output_to_single_file, paramType: Diagnostics.FILE, + description: Diagnostics.Concatenate_and_emit_output_to_single_file, }, { name: "outDir", type: "string", isFilePath: true, - description: Diagnostics.Redirect_output_structure_to_the_directory, paramType: Diagnostics.DIRECTORY, + description: Diagnostics.Redirect_output_structure_to_the_directory, }, { name: "preserveConstEnums", @@ -205,16 +220,16 @@ namespace ts { }, { name: "pretty", - description: Diagnostics.Stylize_errors_and_messages_using_color_and_context_experimental, - type: "boolean" + type: "boolean", + description: Diagnostics.Stylize_errors_and_messages_using_color_and_context_experimental }, { name: "project", shortName: "p", type: "string", isFilePath: true, + paramType: Diagnostics.FILE_OR_DIRECTORY, description: Diagnostics.Compile_the_project_given_the_path_to_its_configuration_file_or_to_a_folder_with_a_tsconfig_json, - paramType: Diagnostics.FILE_OR_DIRECTORY }, { name: "removeComments", @@ -231,6 +246,7 @@ namespace ts { { name: "isolatedModules", type: "boolean", + description: Diagnostics.Unconditionally_emit_imports_for_unresolved_files }, { name: "sourceMap", @@ -241,14 +257,14 @@ namespace ts { name: "sourceRoot", type: "string", isFilePath: true, - description: Diagnostics.Specify_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations, paramType: Diagnostics.LOCATION, + description: Diagnostics.Specify_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations, }, { name: "suppressExcessPropertyErrors", type: "boolean", + experimental: true, description: Diagnostics.Suppress_excess_property_checks_for_object_literals, - experimental: true }, { name: "suppressImplicitAnyIndexErrors", @@ -258,8 +274,8 @@ namespace ts { { name: "stripInternal", type: "boolean", + experimental: true, description: Diagnostics.Do_not_emit_declarations_for_code_that_has_an_internal_annotation, - experimental: true }, { name: "target", @@ -273,8 +289,8 @@ namespace ts { "es2017": ScriptTarget.ES2017, "esnext": ScriptTarget.ESNext, }), - description: Diagnostics.Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_or_ESNEXT, paramType: Diagnostics.VERSION, + description: Diagnostics.Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_or_ESNEXT, }, { name: "version", @@ -305,8 +321,8 @@ namespace ts { "node": ModuleResolutionKind.NodeJs, "classic": ModuleResolutionKind.Classic, }), - description: Diagnostics.Specify_module_resolution_strategy_Colon_node_Node_js_or_classic_TypeScript_pre_1_6, paramType: Diagnostics.STRATEGY, + description: Diagnostics.Specify_module_resolution_strategy_Colon_node_Node_js_or_classic_TypeScript_pre_1_6, }, { name: "allowUnusedLabels", @@ -344,7 +360,9 @@ namespace ts { // use type = object to copy the value as-is name: "paths", type: "object", - isTSConfigOnly: true + isTSConfigOnly: true, + description: Diagnostics.List_of_path_mapping_entries_for_module_names_to_locations_relative_to_the_baseUrl + }, { // this option can only be specified in tsconfig.json @@ -356,7 +374,8 @@ namespace ts { name: "rootDirs", type: "string", isFilePath: true - } + }, + description: Diagnostics.List_of_root_folders_whose_combined_content_represent_the_structure_of_the_project_at_runtime }, { name: "typeRoots", @@ -365,7 +384,8 @@ namespace ts { name: "typeRoots", type: "string", isFilePath: true - } + }, + description: Diagnostics.List_of_folders_to_include_type_definitions_from }, { name: "types", @@ -403,7 +423,8 @@ namespace ts { }, { name: "listEmittedFiles", - type: "boolean" + type: "boolean", + description: Diagnostics.Print_names_of_generated_files_part_of_the_compilation }, { name: "lib", @@ -443,7 +464,8 @@ namespace ts { }, { name: "disableSizeLimit", - type: "boolean" + type: "boolean", + description: Diagnostics.Disable_size_limitation_on_JavaScript_project }, { name: "strictNullChecks", diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 93953a3b90..cae9ad0a3a 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -2997,6 +2997,87 @@ "category": "Message", "code": 6148 }, + "Show diagnostic information.": { + "category": "Message", + "code": 6149 + }, + "Show extended diagnostic information.": { + "category": "Message", + "code": 6150 + }, + "Emit a single file with source maps instead of having a separate file.": { + "category": "Message", + "code": 6151 + }, + "Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set.": { + "category": "Message", + "code": 6152 + }, + "Unconditionally emit imports for unresolved files.": { + "category": "Message", + "code": 6153 + }, + "Print names of generated files part of the compilation.": { + "category": "Message", + "code": 6154 + }, + "Print names of files part of the compilation.": { + "category": "Message", + "code": 6155 + }, + "The locale to use to show error messages, e.g. 'en-us'.": { + "category": "Message", + "code": 6156 + }, + "Do not generate custom helper functions like __extends in compiled output.": { + "category": "Message", + "code": 6157 + }, + "Do not include the default library file (lib.d.ts).": { + "category": "Message", + "code": 6158 + }, + "Do not add triple-slash references or module import targets to the list of compiled files.": { + "category": "Message", + "code": 6159 + }, + "Skip type checking of default library declaration files.": { + "category": "Message", + "code": 6160 + }, + "List of folders to include type definitions from.": { + "category": "Message", + "code": 6161 + }, + "Disable size limitation on JavaScript project.": { + "category": "Message", + "code": 6162 + }, + "The character set of the input files.": { + "category": "Message", + "code": 6163 + }, + "Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files.": { + "category": "Message", + "code": 6164 + }, + "Do not truncation error messages.": { + "category": "Message", + "code": 6165 + }, + "Output directory for generated declaration files.": { + "category": "Message", + "code": 6166 + }, + "List of path mapping entries for module names to locations relative to the 'baseUrl'.": { + "category": "Message", + "code": 6167 + }, + "List of root folders whose combined content represent the structure of the project at runtime.": { + "category": "Message", + "code": 6168 + }, + "Variable '{0}' implicitly has an '{1}' type.": { "category": "Error", "code": 7005 From 34597198720500ab600042ad227bb3ec052f3e71 Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Tue, 7 Feb 2017 23:10:43 -0800 Subject: [PATCH 02/24] Manually order options --- src/compiler/commandLineParser.ts | 584 +++++++++++++++--------------- src/compiler/tsc.ts | 2 +- 2 files changed, 301 insertions(+), 285 deletions(-) diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts index 74640a318e..26f6014987 100644 --- a/src/compiler/commandLineParser.ts +++ b/src/compiler/commandLineParser.ts @@ -9,41 +9,7 @@ namespace ts { export const compileOnSaveCommandLineOption: CommandLineOption = { name: "compileOnSave", type: "boolean" }; /* @internal */ export const optionDeclarations: CommandLineOption[] = [ - { - name: "charset", - type: "string", - description: Diagnostics.The_character_set_of_the_input_files - }, - compileOnSaveCommandLineOption, - { - name: "declaration", - shortName: "d", - type: "boolean", - description: Diagnostics.Generates_corresponding_d_ts_file, - }, - { - name: "declarationDir", - type: "string", - isFilePath: true, - paramType: Diagnostics.DIRECTORY, - description: Diagnostics.Output_directory_for_generated_declaration_files - }, - { - name: "diagnostics", - type: "boolean", - description: Diagnostics.Show_diagnostic_information - }, - { - name: "extendedDiagnostics", - type: "boolean", - experimental: true, - description: Diagnostics.Show_extended_diagnostic_information - }, - { - name: "emitBOM", - type: "boolean", - description:Diagnostics.Emit_a_UTF_8_Byte_Order_Mark_BOM_in_the_beginning_of_output_files - }, + // Basic options { name: "help", shortName: "h", @@ -55,57 +21,39 @@ namespace ts { shortName: "?", type: "boolean" }, + { + name: "version", + shortName: "v", + type: "boolean", + description: Diagnostics.Print_the_compiler_s_version, + }, { name: "init", type: "boolean", description: Diagnostics.Initializes_a_TypeScript_project_and_creates_a_tsconfig_json_file, }, { - name: "inlineSourceMap", - type: "boolean", - description: Diagnostics.Emit_a_single_file_with_source_maps_instead_of_having_a_separate_file - }, - { - name: "inlineSources", - type: "boolean", - description:Diagnostics.Emit_the_source_alongside_the_sourcemaps_within_a_single_file_requires_inlineSourceMap_or_sourceMap_to_be_set - }, - { - name: "jsx", - type: createMapFromTemplate({ - "preserve": JsxEmit.Preserve, - "react-native": JsxEmit.ReactNative, - "react": JsxEmit.React - }), - paramType: Diagnostics.KIND, - description: Diagnostics.Specify_JSX_code_generation_Colon_preserve_react_native_or_react, - }, - { - name: "reactNamespace", - type: "string", - description: Diagnostics.Specify_the_object_invoked_for_createElement_and_spread_when_targeting_react_JSX_emit - }, - { - name: "jsxFactory", - type: "string", - description: Diagnostics.Specify_the_JSX_factory_function_to_use_when_targeting_react_JSX_emit_e_g_React_createElement_or_h - }, - { - name: "listFiles", - type: "boolean", - description: Diagnostics.Print_names_of_files_part_of_the_compilation - }, - { - name: "locale", - type: "string", - description: Diagnostics.The_locale_to_use_to_show_error_messages_e_g_en_us - }, - { - name: "mapRoot", + name: "project", + shortName: "p", type: "string", isFilePath: true, - paramType: Diagnostics.LOCATION, - description: Diagnostics.Specify_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations, + paramType: Diagnostics.FILE_OR_DIRECTORY, + description: Diagnostics.Compile_the_project_given_the_path_to_its_configuration_file_or_to_a_folder_with_a_tsconfig_json, + }, + { + name: "target", + shortName: "t", + type: createMapFromTemplate({ + "es3": ScriptTarget.ES3, + "es5": ScriptTarget.ES5, + "es6": ScriptTarget.ES2015, + "es2015": ScriptTarget.ES2015, + "es2016": ScriptTarget.ES2016, + "es2017": ScriptTarget.ES2017, + "esnext": ScriptTarget.ESNext, + }), + paramType: Diagnostics.VERSION, + description: Diagnostics.Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_or_ESNEXT, }, { name: "module", @@ -123,73 +71,66 @@ namespace ts { description: Diagnostics.Specify_module_code_generation_Colon_commonjs_amd_system_umd_or_es2015, }, { - name: "newLine", + name: "lib", + type: "list", + element: { + name: "lib", + type: createMapFromTemplate({ + // JavaScript only + "es5": "lib.es5.d.ts", + "es6": "lib.es2015.d.ts", + "es2015": "lib.es2015.d.ts", + "es7": "lib.es2016.d.ts", + "es2016": "lib.es2016.d.ts", + "es2017": "lib.es2017.d.ts", + // Host only + "dom": "lib.dom.d.ts", + "dom.iterable": "lib.dom.iterable.d.ts", + "webworker": "lib.webworker.d.ts", + "scripthost": "lib.scripthost.d.ts", + // ES2015 Or ESNext By-feature options + "es2015.core": "lib.es2015.core.d.ts", + "es2015.collection": "lib.es2015.collection.d.ts", + "es2015.generator": "lib.es2015.generator.d.ts", + "es2015.iterable": "lib.es2015.iterable.d.ts", + "es2015.promise": "lib.es2015.promise.d.ts", + "es2015.proxy": "lib.es2015.proxy.d.ts", + "es2015.reflect": "lib.es2015.reflect.d.ts", + "es2015.symbol": "lib.es2015.symbol.d.ts", + "es2015.symbol.wellknown": "lib.es2015.symbol.wellknown.d.ts", + "es2016.array.include": "lib.es2016.array.include.d.ts", + "es2017.object": "lib.es2017.object.d.ts", + "es2017.sharedmemory": "lib.es2017.sharedmemory.d.ts", + "es2017.string": "lib.es2017.string.d.ts", + }), + }, + description: Diagnostics.Specify_library_files_to_be_included_in_the_compilation_Colon + }, + { + name: "allowJs", + type: "boolean", + description: Diagnostics.Allow_javascript_files_to_be_compiled + }, + { + name: "jsx", type: createMapFromTemplate({ - "crlf": NewLineKind.CarriageReturnLineFeed, - "lf": NewLineKind.LineFeed + "preserve": JsxEmit.Preserve, + "react-native": JsxEmit.ReactNative, + "react": JsxEmit.React }), - paramType: Diagnostics.NEWLINE, - description: Diagnostics.Specify_the_end_of_line_sequence_to_be_used_when_emitting_files_Colon_CRLF_dos_or_LF_unix, + paramType: Diagnostics.KIND, + description: Diagnostics.Specify_JSX_code_generation_Colon_preserve_react_native_or_react, }, { - name: "noEmit", + name: "declaration", + shortName: "d", type: "boolean", - description: Diagnostics.Do_not_emit_outputs, + description: Diagnostics.Generates_corresponding_d_ts_file, }, { - name: "noEmitHelpers", + name: "sourceMap", type: "boolean", - description: Diagnostics.Do_not_generate_custom_helper_functions_like_extends_in_compiled_output - }, - { - name: "noEmitOnError", - type: "boolean", - description: Diagnostics.Do_not_emit_outputs_if_any_errors_were_reported, - }, - { - name: "noErrorTruncation", - type: "boolean", - description: Diagnostics.Do_not_truncation_error_messages - }, - { - name: "noImplicitAny", - type: "boolean", - description: Diagnostics.Raise_error_on_expressions_and_declarations_with_an_implied_any_type, - }, - { - name: "noImplicitThis", - type: "boolean", - description: Diagnostics.Raise_error_on_this_expressions_with_an_implied_any_type, - }, - { - name: "noUnusedLocals", - type: "boolean", - description: Diagnostics.Report_errors_on_unused_locals, - }, - { - name: "noUnusedParameters", - type: "boolean", - description: Diagnostics.Report_errors_on_unused_parameters, - }, - { - name: "noLib", - type: "boolean", - description: Diagnostics.Do_not_include_the_default_library_file_lib_d_ts - }, - { - name: "noResolve", - type: "boolean", - description:Diagnostics.Do_not_add_triple_slash_references_or_module_import_targets_to_the_list_of_compiled_files - }, - { - name: "skipDefaultLibCheck", - type: "boolean", - description: Diagnostics.Skip_type_checking_of_default_library_declaration_files - }, - { - name: "skipLibCheck", - type: "boolean", - description: Diagnostics.Skip_type_checking_of_declaration_files, + description: Diagnostics.Generates_corresponding_map_file, }, { name: "out", @@ -213,29 +154,6 @@ namespace ts { paramType: Diagnostics.DIRECTORY, description: Diagnostics.Redirect_output_structure_to_the_directory, }, - { - name: "preserveConstEnums", - type: "boolean", - description: Diagnostics.Do_not_erase_const_enum_declarations_in_generated_code - }, - { - name: "pretty", - type: "boolean", - description: Diagnostics.Stylize_errors_and_messages_using_color_and_context_experimental - }, - { - name: "project", - shortName: "p", - type: "string", - isFilePath: true, - paramType: Diagnostics.FILE_OR_DIRECTORY, - description: Diagnostics.Compile_the_project_given_the_path_to_its_configuration_file_or_to_a_folder_with_a_tsconfig_json, - }, - { - name: "removeComments", - type: "boolean", - description: Diagnostics.Do_not_emit_comments_to_output, - }, { name: "rootDir", type: "string", @@ -243,22 +161,116 @@ namespace ts { paramType: Diagnostics.LOCATION, description: Diagnostics.Specify_the_root_directory_of_input_files_Use_to_control_the_output_directory_structure_with_outDir, }, + { + name: "declarationDir", + type: "string", + isFilePath: true, + paramType: Diagnostics.DIRECTORY, + description: Diagnostics.Output_directory_for_generated_declaration_files + }, + { + name: "removeComments", + type: "boolean", + description: Diagnostics.Do_not_emit_comments_to_output, + }, + { + name: "noEmit", + type: "boolean", + description: Diagnostics.Do_not_emit_outputs, + }, + { + name: "noEmitHelpers", + type: "boolean", + description: Diagnostics.Do_not_generate_custom_helper_functions_like_extends_in_compiled_output + }, + { + name: "noEmitOnError", + type: "boolean", + description: Diagnostics.Do_not_emit_outputs_if_any_errors_were_reported, + }, + { + name: "importHelpers", + type: "boolean", + description: Diagnostics.Import_emit_helpers_from_tslib + }, + { + name: "skipLibCheck", + type: "boolean", + description: Diagnostics.Skip_type_checking_of_declaration_files, + }, + { + name: "preserveConstEnums", + type: "boolean", + description: Diagnostics.Do_not_erase_const_enum_declarations_in_generated_code + }, { name: "isolatedModules", type: "boolean", description: Diagnostics.Unconditionally_emit_imports_for_unresolved_files }, { - name: "sourceMap", + name: "pretty", type: "boolean", - description: Diagnostics.Generates_corresponding_map_file, + description: Diagnostics.Stylize_errors_and_messages_using_color_and_context_experimental }, { - name: "sourceRoot", - type: "string", - isFilePath: true, - paramType: Diagnostics.LOCATION, - description: Diagnostics.Specify_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations, + name: "watch", + shortName: "w", + type: "boolean", + description: Diagnostics.Watch_input_files, + }, + + // Strict Checks + { + name: "noImplicitAny", + type: "boolean", + description: Diagnostics.Raise_error_on_expressions_and_declarations_with_an_implied_any_type, + }, + { + name: "strictNullChecks", + type: "boolean", + description: Diagnostics.Enable_strict_null_checks + }, + { + name: "noImplicitThis", + type: "boolean", + description: Diagnostics.Raise_error_on_this_expressions_with_an_implied_any_type, + }, + { + name: "noUnusedLocals", + type: "boolean", + description: Diagnostics.Report_errors_on_unused_locals, + }, + { + name: "noUnusedParameters", + type: "boolean", + description: Diagnostics.Report_errors_on_unused_parameters, + }, + { + name: "alwaysStrict", + type: "boolean", + description: Diagnostics.Parse_in_strict_mode_and_emit_use_strict_for_each_source_file + }, + { + name: "noImplicitReturns", + type: "boolean", + description: Diagnostics.Report_error_when_not_all_code_paths_in_function_return_a_value + }, + { + name: "noFallthroughCasesInSwitch", + type: "boolean", + description: Diagnostics.Report_errors_for_fallthrough_cases_in_switch_statement + }, + + { + name: "allowUnusedLabels", + type: "boolean", + description: Diagnostics.Do_not_report_errors_on_unused_labels + }, + { + name: "allowUnreachableCode", + type: "boolean", + description: Diagnostics.Do_not_report_errors_on_unreachable_code }, { name: "suppressExcessPropertyErrors", @@ -272,49 +284,50 @@ namespace ts { description: Diagnostics.Suppress_noImplicitAny_errors_for_indexing_objects_lacking_index_signatures, }, { - name: "stripInternal", + name: "forceConsistentCasingInFileNames", type: "boolean", - experimental: true, - description: Diagnostics.Do_not_emit_declarations_for_code_that_has_an_internal_annotation, + description: Diagnostics.Disallow_inconsistently_cased_references_to_the_same_file + }, + + // Source Maps + { + name: "sourceRoot", + type: "string", + isFilePath: true, + paramType: Diagnostics.LOCATION, + description: Diagnostics.Specify_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations, }, { - name: "target", - shortName: "t", - type: createMapFromTemplate({ - "es3": ScriptTarget.ES3, - "es5": ScriptTarget.ES5, - "es6": ScriptTarget.ES2015, - "es2015": ScriptTarget.ES2015, - "es2016": ScriptTarget.ES2016, - "es2017": ScriptTarget.ES2017, - "esnext": ScriptTarget.ESNext, - }), - paramType: Diagnostics.VERSION, - description: Diagnostics.Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_or_ESNEXT, + name: "mapRoot", + type: "string", + isFilePath: true, + paramType: Diagnostics.LOCATION, + description: Diagnostics.Specify_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations, }, { - name: "version", - shortName: "v", + name: "inlineSourceMap", type: "boolean", - description: Diagnostics.Print_the_compiler_s_version, + description: Diagnostics.Emit_a_single_file_with_source_maps_instead_of_having_a_separate_file }, { - name: "watch", - shortName: "w", + name: "inlineSources", type: "boolean", - description: Diagnostics.Watch_input_files, + description:Diagnostics.Emit_the_source_alongside_the_sourcemaps_within_a_single_file_requires_inlineSourceMap_or_sourceMap_to_be_set + }, + + // JSX + { + name: "reactNamespace", + type: "string", + description: Diagnostics.Specify_the_object_invoked_for_createElement_and_spread_when_targeting_react_JSX_emit }, { - name: "experimentalDecorators", - type: "boolean", - description: Diagnostics.Enables_experimental_support_for_ES7_decorators - }, - { - name: "emitDecoratorMetadata", - type: "boolean", - experimental: true, - description: Diagnostics.Enables_experimental_support_for_emitting_type_metadata_for_decorators + name: "jsxFactory", + type: "string", + description: Diagnostics.Specify_the_JSX_factory_function_to_use_when_targeting_react_JSX_emit_e_g_React_createElement_or_h }, + + // Module Resolution { name: "moduleResolution", type: createMapFromTemplate({ @@ -324,31 +337,6 @@ namespace ts { paramType: Diagnostics.STRATEGY, description: Diagnostics.Specify_module_resolution_strategy_Colon_node_Node_js_or_classic_TypeScript_pre_1_6, }, - { - name: "allowUnusedLabels", - type: "boolean", - description: Diagnostics.Do_not_report_errors_on_unused_labels - }, - { - name: "noImplicitReturns", - type: "boolean", - description: Diagnostics.Report_error_when_not_all_code_paths_in_function_return_a_value - }, - { - name: "noFallthroughCasesInSwitch", - type: "boolean", - description: Diagnostics.Report_errors_for_fallthrough_cases_in_switch_statement - }, - { - name: "allowUnreachableCode", - type: "boolean", - description: Diagnostics.Do_not_report_errors_on_unreachable_code - }, - { - name: "forceConsistentCasingInFileNames", - type: "boolean", - description: Diagnostics.Disallow_inconsistently_cased_references_to_the_same_file - }, { name: "baseUrl", type: "string", @@ -396,71 +384,109 @@ namespace ts { }, description: Diagnostics.Type_declaration_files_to_be_included_in_compilation }, - { - name: "traceResolution", - type: "boolean", - description: Diagnostics.Enable_tracing_of_the_name_resolution_process - }, - { - name: "allowJs", - type: "boolean", - description: Diagnostics.Allow_javascript_files_to_be_compiled - }, { name: "allowSyntheticDefaultImports", type: "boolean", description: Diagnostics.Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typechecking }, - { - name: "noImplicitUseStrict", - type: "boolean", - description: Diagnostics.Do_not_emit_use_strict_directives_in_module_output - }, { name: "maxNodeModuleJsDepth", type: "number", description: Diagnostics.The_maximum_dependency_depth_to_search_under_node_modules_and_load_JavaScript_files }, + + // Experimental + { + name: "experimentalDecorators", + type: "boolean", + description: Diagnostics.Enables_experimental_support_for_ES7_decorators + }, + { + name: "emitDecoratorMetadata", + type: "boolean", + experimental: true, + description: Diagnostics.Enables_experimental_support_for_emitting_type_metadata_for_decorators + }, + + // Diagnostic + { + name: "diagnostics", + type: "boolean", + description: Diagnostics.Show_diagnostic_information + }, + { + name: "extendedDiagnostics", + type: "boolean", + experimental: true, + description: Diagnostics.Show_extended_diagnostic_information + }, + { + name: "traceResolution", + type: "boolean", + description: Diagnostics.Enable_tracing_of_the_name_resolution_process + }, + { + name: "listFiles", + type: "boolean", + description: Diagnostics.Print_names_of_files_part_of_the_compilation + }, { name: "listEmittedFiles", type: "boolean", description: Diagnostics.Print_names_of_generated_files_part_of_the_compilation }, + + // Other { - name: "lib", - type: "list", - element: { - name: "lib", - type: createMapFromTemplate({ - // JavaScript only - "es5": "lib.es5.d.ts", - "es6": "lib.es2015.d.ts", - "es2015": "lib.es2015.d.ts", - "es7": "lib.es2016.d.ts", - "es2016": "lib.es2016.d.ts", - "es2017": "lib.es2017.d.ts", - // Host only - "dom": "lib.dom.d.ts", - "dom.iterable": "lib.dom.iterable.d.ts", - "webworker": "lib.webworker.d.ts", - "scripthost": "lib.scripthost.d.ts", - // ES2015 Or ESNext By-feature options - "es2015.core": "lib.es2015.core.d.ts", - "es2015.collection": "lib.es2015.collection.d.ts", - "es2015.generator": "lib.es2015.generator.d.ts", - "es2015.iterable": "lib.es2015.iterable.d.ts", - "es2015.promise": "lib.es2015.promise.d.ts", - "es2015.proxy": "lib.es2015.proxy.d.ts", - "es2015.reflect": "lib.es2015.reflect.d.ts", - "es2015.symbol": "lib.es2015.symbol.d.ts", - "es2015.symbol.wellknown": "lib.es2015.symbol.wellknown.d.ts", - "es2016.array.include": "lib.es2016.array.include.d.ts", - "es2017.object": "lib.es2017.object.d.ts", - "es2017.sharedmemory": "lib.es2017.sharedmemory.d.ts", - "es2017.string": "lib.es2017.string.d.ts", - }), - }, - description: Diagnostics.Specify_library_files_to_be_included_in_the_compilation_Colon + name: "charset", + type: "string", + description: Diagnostics.The_character_set_of_the_input_files + }, + compileOnSaveCommandLineOption, + { + name: "emitBOM", + type: "boolean", + description:Diagnostics.Emit_a_UTF_8_Byte_Order_Mark_BOM_in_the_beginning_of_output_files + }, + { + name: "locale", + type: "string", + description: Diagnostics.The_locale_to_use_to_show_error_messages_e_g_en_us + }, + { + name: "newLine", + type: createMapFromTemplate({ + "crlf": NewLineKind.CarriageReturnLineFeed, + "lf": NewLineKind.LineFeed + }), + paramType: Diagnostics.NEWLINE, + description: Diagnostics.Specify_the_end_of_line_sequence_to_be_used_when_emitting_files_Colon_CRLF_dos_or_LF_unix, + }, + { + name: "noErrorTruncation", + type: "boolean", + description: Diagnostics.Do_not_truncation_error_messages + }, + { + name: "noLib", + type: "boolean", + description: Diagnostics.Do_not_include_the_default_library_file_lib_d_ts + }, + { + name: "noResolve", + type: "boolean", + description:Diagnostics.Do_not_add_triple_slash_references_or_module_import_targets_to_the_list_of_compiled_files + }, + { + name: "skipDefaultLibCheck", + type: "boolean", + description: Diagnostics.Skip_type_checking_of_default_library_declaration_files + }, + { + name: "stripInternal", + type: "boolean", + experimental: true, + description: Diagnostics.Do_not_emit_declarations_for_code_that_has_an_internal_annotation, }, { name: "disableSizeLimit", @@ -468,20 +494,10 @@ namespace ts { description: Diagnostics.Disable_size_limitation_on_JavaScript_project }, { - name: "strictNullChecks", + name: "noImplicitUseStrict", type: "boolean", - description: Diagnostics.Enable_strict_null_checks + description: Diagnostics.Do_not_emit_use_strict_directives_in_module_output }, - { - name: "importHelpers", - type: "boolean", - description: Diagnostics.Import_emit_helpers_from_tslib - }, - { - name: "alwaysStrict", - type: "boolean", - description: Diagnostics.Parse_in_strict_mode_and_emit_use_strict_for_each_source_file - } ]; /* @internal */ diff --git a/src/compiler/tsc.ts b/src/compiler/tsc.ts index b1ffcff43a..936a6d69c6 100644 --- a/src/compiler/tsc.ts +++ b/src/compiler/tsc.ts @@ -644,7 +644,7 @@ namespace ts { // Sort our options by their names, (e.g. "--noImplicitAny" comes before "--watch") const optsList = filter(optionDeclarations.slice(), v => !v.experimental); - optsList.sort((a, b) => compareValues(a.name.toLowerCase(), b.name.toLowerCase())); + //optsList.sort((a, b) => compareValues(a.name.toLowerCase(), b.name.toLowerCase())); // We want our descriptions to align at the same column in our output, // so we keep track of the longest option usage string. From 486757f51f557b9fcdb3dfa666f9f8252ea88964 Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Wed, 8 Feb 2017 12:14:43 -0800 Subject: [PATCH 03/24] Add simplified help view and full help view --- src/compiler/commandLineParser.ts | 272 ++++++++++++++++++--------- src/compiler/diagnosticMessages.json | 4 + src/compiler/tsc.ts | 11 +- src/compiler/types.ts | 5 +- 4 files changed, 201 insertions(+), 91 deletions(-) diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts index 26f6014987..c161aa55bb 100644 --- a/src/compiler/commandLineParser.ts +++ b/src/compiler/commandLineParser.ts @@ -9,11 +9,13 @@ namespace ts { export const compileOnSaveCommandLineOption: CommandLineOption = { name: "compileOnSave", type: "boolean" }; /* @internal */ export const optionDeclarations: CommandLineOption[] = [ - // Basic options + // CommandLine only options { name: "help", shortName: "h", type: "boolean", + showInSimplifiedHelpView: true, + category: "CommandLine", description: Diagnostics.Print_this_message, }, { @@ -21,15 +23,26 @@ namespace ts { shortName: "?", type: "boolean" }, + { + name: "all", + type: "boolean", + showInSimplifiedHelpView: true, + category: "CommandLine", + description: Diagnostics.Show_all_compiler_options, + }, { name: "version", shortName: "v", type: "boolean", + showInSimplifiedHelpView: true, + category: "CommandLine", description: Diagnostics.Print_the_compiler_s_version, }, { name: "init", type: "boolean", + showInSimplifiedHelpView: true, + category: "CommandLine", description: Diagnostics.Initializes_a_TypeScript_project_and_creates_a_tsconfig_json_file, }, { @@ -37,9 +50,28 @@ namespace ts { shortName: "p", type: "string", isFilePath: true, + showInSimplifiedHelpView: true, + category: "CommandLine", paramType: Diagnostics.FILE_OR_DIRECTORY, description: Diagnostics.Compile_the_project_given_the_path_to_its_configuration_file_or_to_a_folder_with_a_tsconfig_json, }, + { + name: "pretty", + type: "boolean", + showInSimplifiedHelpView: true, + category: "CommandLine", + description: Diagnostics.Stylize_errors_and_messages_using_color_and_context_experimental + }, + { + name: "watch", + shortName: "w", + type: "boolean", + showInSimplifiedHelpView: true, + category: "CommandLine", + description: Diagnostics.Watch_input_files, + }, + + // Basic { name: "target", shortName: "t", @@ -53,6 +85,8 @@ namespace ts { "esnext": ScriptTarget.ESNext, }), paramType: Diagnostics.VERSION, + showInSimplifiedHelpView: true, + category: "Basic", description: Diagnostics.Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_or_ESNEXT, }, { @@ -68,6 +102,8 @@ namespace ts { "es2015": ModuleKind.ES2015, }), paramType: Diagnostics.KIND, + showInSimplifiedHelpView: true, + category: "Basic", description: Diagnostics.Specify_module_code_generation_Colon_commonjs_amd_system_umd_or_es2015, }, { @@ -104,11 +140,15 @@ namespace ts { "es2017.string": "lib.es2017.string.d.ts", }), }, + showInSimplifiedHelpView: true, + category: "Basic", description: Diagnostics.Specify_library_files_to_be_included_in_the_compilation_Colon }, { name: "allowJs", type: "boolean", + showInSimplifiedHelpView: true, + category: "Basic", description: Diagnostics.Allow_javascript_files_to_be_compiled }, { @@ -119,32 +159,32 @@ namespace ts { "react": JsxEmit.React }), paramType: Diagnostics.KIND, + showInSimplifiedHelpView: true, + category: "Basic", description: Diagnostics.Specify_JSX_code_generation_Colon_preserve_react_native_or_react, }, { name: "declaration", shortName: "d", type: "boolean", + showInSimplifiedHelpView: true, + category: "Basic", description: Diagnostics.Generates_corresponding_d_ts_file, }, { name: "sourceMap", type: "boolean", + showInSimplifiedHelpView: true, + category: "Basic", description: Diagnostics.Generates_corresponding_map_file, }, - { - name: "out", - type: "string", - isFilePath: false, // This is intentionally broken to support compatability with existing tsconfig files - // for correct behaviour, please use outFile - paramType: Diagnostics.FILE, - description: Diagnostics.Concatenate_and_emit_output_to_single_file, - }, { name: "outFile", type: "string", isFilePath: true, paramType: Diagnostics.FILE, + showInSimplifiedHelpView: true, + category: "Basic", description: Diagnostics.Concatenate_and_emit_output_to_single_file, }, { @@ -152,6 +192,8 @@ namespace ts { type: "string", isFilePath: true, paramType: Diagnostics.DIRECTORY, + showInSimplifiedHelpView: true, + category: "Basic", description: Diagnostics.Redirect_output_structure_to_the_directory, }, { @@ -159,6 +201,7 @@ namespace ts { type: "string", isFilePath: true, paramType: Diagnostics.LOCATION, + category: "Basic", description: Diagnostics.Specify_the_root_directory_of_input_files_Use_to_control_the_output_directory_structure_with_outDir, }, { @@ -166,167 +209,130 @@ namespace ts { type: "string", isFilePath: true, paramType: Diagnostics.DIRECTORY, + category: "Basic", description: Diagnostics.Output_directory_for_generated_declaration_files }, { name: "removeComments", type: "boolean", + showInSimplifiedHelpView: true, + category: "Basic", description: Diagnostics.Do_not_emit_comments_to_output, }, { name: "noEmit", type: "boolean", + showInSimplifiedHelpView: true, + category: "Basic", description: Diagnostics.Do_not_emit_outputs, }, - { - name: "noEmitHelpers", - type: "boolean", - description: Diagnostics.Do_not_generate_custom_helper_functions_like_extends_in_compiled_output - }, - { - name: "noEmitOnError", - type: "boolean", - description: Diagnostics.Do_not_emit_outputs_if_any_errors_were_reported, - }, { name: "importHelpers", type: "boolean", + category: "Basic", description: Diagnostics.Import_emit_helpers_from_tslib }, { name: "skipLibCheck", type: "boolean", + category: "Basic", description: Diagnostics.Skip_type_checking_of_declaration_files, }, - { - name: "preserveConstEnums", - type: "boolean", - description: Diagnostics.Do_not_erase_const_enum_declarations_in_generated_code - }, { name: "isolatedModules", type: "boolean", + category: "Basic", description: Diagnostics.Unconditionally_emit_imports_for_unresolved_files }, - { - name: "pretty", - type: "boolean", - description: Diagnostics.Stylize_errors_and_messages_using_color_and_context_experimental - }, - { - name: "watch", - shortName: "w", - type: "boolean", - description: Diagnostics.Watch_input_files, - }, // Strict Checks { name: "noImplicitAny", type: "boolean", + showInSimplifiedHelpView: true, + category: "StrictChecks", description: Diagnostics.Raise_error_on_expressions_and_declarations_with_an_implied_any_type, }, { name: "strictNullChecks", type: "boolean", + showInSimplifiedHelpView: true, + category: "StrictChecks", description: Diagnostics.Enable_strict_null_checks }, { name: "noImplicitThis", type: "boolean", + showInSimplifiedHelpView: true, + category: "StrictChecks", description: Diagnostics.Raise_error_on_this_expressions_with_an_implied_any_type, }, { name: "noUnusedLocals", type: "boolean", + showInSimplifiedHelpView: true, + category: "StrictChecks", description: Diagnostics.Report_errors_on_unused_locals, }, { name: "noUnusedParameters", type: "boolean", + showInSimplifiedHelpView: true, + category: "StrictChecks", description: Diagnostics.Report_errors_on_unused_parameters, }, { name: "alwaysStrict", type: "boolean", + showInSimplifiedHelpView: true, + category: "StrictChecks", description: Diagnostics.Parse_in_strict_mode_and_emit_use_strict_for_each_source_file }, { name: "noImplicitReturns", type: "boolean", + showInSimplifiedHelpView: true, + category: "StrictChecks", description: Diagnostics.Report_error_when_not_all_code_paths_in_function_return_a_value }, { name: "noFallthroughCasesInSwitch", type: "boolean", + showInSimplifiedHelpView: true, + category: "StrictChecks", description: Diagnostics.Report_errors_for_fallthrough_cases_in_switch_statement }, - { name: "allowUnusedLabels", type: "boolean", + category: "StrictChecks", description: Diagnostics.Do_not_report_errors_on_unused_labels }, { name: "allowUnreachableCode", type: "boolean", + category: "StrictChecks", description: Diagnostics.Do_not_report_errors_on_unreachable_code }, { name: "suppressExcessPropertyErrors", type: "boolean", - experimental: true, + category: "StrictChecks", description: Diagnostics.Suppress_excess_property_checks_for_object_literals, }, { name: "suppressImplicitAnyIndexErrors", type: "boolean", + category: "StrictChecks", description: Diagnostics.Suppress_noImplicitAny_errors_for_indexing_objects_lacking_index_signatures, }, { name: "forceConsistentCasingInFileNames", type: "boolean", + category: "StrictChecks", description: Diagnostics.Disallow_inconsistently_cased_references_to_the_same_file }, - // Source Maps - { - name: "sourceRoot", - type: "string", - isFilePath: true, - paramType: Diagnostics.LOCATION, - description: Diagnostics.Specify_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations, - }, - { - name: "mapRoot", - type: "string", - isFilePath: true, - paramType: Diagnostics.LOCATION, - description: Diagnostics.Specify_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations, - }, - { - name: "inlineSourceMap", - type: "boolean", - description: Diagnostics.Emit_a_single_file_with_source_maps_instead_of_having_a_separate_file - }, - { - name: "inlineSources", - type: "boolean", - description:Diagnostics.Emit_the_source_alongside_the_sourcemaps_within_a_single_file_requires_inlineSourceMap_or_sourceMap_to_be_set - }, - - // JSX - { - name: "reactNamespace", - type: "string", - description: Diagnostics.Specify_the_object_invoked_for_createElement_and_spread_when_targeting_react_JSX_emit - }, - { - name: "jsxFactory", - type: "string", - description: Diagnostics.Specify_the_JSX_factory_function_to_use_when_targeting_react_JSX_emit_e_g_React_createElement_or_h - }, - // Module Resolution { name: "moduleResolution", @@ -335,12 +341,14 @@ namespace ts { "classic": ModuleResolutionKind.Classic, }), paramType: Diagnostics.STRATEGY, + category: "ModuleResolution", description: Diagnostics.Specify_module_resolution_strategy_Colon_node_Node_js_or_classic_TypeScript_pre_1_6, }, { name: "baseUrl", type: "string", isFilePath: true, + category: "ModuleResolution", description: Diagnostics.Base_directory_to_resolve_non_absolute_module_names }, { @@ -349,6 +357,7 @@ namespace ts { name: "paths", type: "object", isTSConfigOnly: true, + category: "ModuleResolution", description: Diagnostics.List_of_path_mapping_entries_for_module_names_to_locations_relative_to_the_baseUrl }, @@ -363,6 +372,7 @@ namespace ts { type: "string", isFilePath: true }, + category: "ModuleResolution", description: Diagnostics.List_of_root_folders_whose_combined_content_represent_the_structure_of_the_project_at_runtime }, { @@ -373,6 +383,7 @@ namespace ts { type: "string", isFilePath: true }, + category: "ModuleResolution", description: Diagnostics.List_of_folders_to_include_type_definitions_from }, { @@ -382,75 +393,146 @@ namespace ts { name: "types", type: "string" }, + showInSimplifiedHelpView: true, + category: "ModuleResolution", description: Diagnostics.Type_declaration_files_to_be_included_in_compilation }, { name: "allowSyntheticDefaultImports", type: "boolean", + category: "ModuleResolution", description: Diagnostics.Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typechecking }, { name: "maxNodeModuleJsDepth", type: "number", + category: "ModuleResolution", description: Diagnostics.The_maximum_dependency_depth_to_search_under_node_modules_and_load_JavaScript_files }, + // Source Maps + { + name: "sourceRoot", + type: "string", + isFilePath: true, + paramType: Diagnostics.LOCATION, + category: "SourceMaps", + description: Diagnostics.Specify_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations, + }, + { + name: "mapRoot", + type: "string", + isFilePath: true, + paramType: Diagnostics.LOCATION, + category: "SourceMaps", + description: Diagnostics.Specify_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations, + }, + { + name: "inlineSourceMap", + type: "boolean", + category: "SourceMaps", + description: Diagnostics.Emit_a_single_file_with_source_maps_instead_of_having_a_separate_file + }, + { + name: "inlineSources", + type: "boolean", + category: "SourceMaps", + description:Diagnostics.Emit_the_source_alongside_the_sourcemaps_within_a_single_file_requires_inlineSourceMap_or_sourceMap_to_be_set + }, + + // JSX + { + name: "jsxFactory", + type: "string", + category: "JSX", + description: Diagnostics.Specify_the_JSX_factory_function_to_use_when_targeting_react_JSX_emit_e_g_React_createElement_or_h + }, + // Experimental { name: "experimentalDecorators", type: "boolean", + category: "Experimental", description: Diagnostics.Enables_experimental_support_for_ES7_decorators }, { name: "emitDecoratorMetadata", type: "boolean", - experimental: true, + category: "Experimental", description: Diagnostics.Enables_experimental_support_for_emitting_type_metadata_for_decorators }, - // Diagnostic + // Advanced { name: "diagnostics", type: "boolean", + category: "Advanced", description: Diagnostics.Show_diagnostic_information }, { name: "extendedDiagnostics", type: "boolean", - experimental: true, + category: "Advanced", description: Diagnostics.Show_extended_diagnostic_information }, { name: "traceResolution", type: "boolean", + category: "Advanced", description: Diagnostics.Enable_tracing_of_the_name_resolution_process }, { name: "listFiles", type: "boolean", + category: "Advanced", description: Diagnostics.Print_names_of_files_part_of_the_compilation }, { name: "listEmittedFiles", type: "boolean", + category: "Advanced", description: Diagnostics.Print_names_of_generated_files_part_of_the_compilation }, - // Other + { + name: "out", + type: "string", + isFilePath: false, // This is intentionally broken to support compatability with existing tsconfig files + // for correct behaviour, please use outFile + category: "Advanced", + paramType: Diagnostics.FILE, + description: Diagnostics.Concatenate_and_emit_output_to_single_file, + }, + { + name: "reactNamespace", + type: "string", + category: "Advanced", + description: Diagnostics.Specify_the_object_invoked_for_createElement_and_spread_when_targeting_react_JSX_emit + }, + { + name: "skipDefaultLibCheck", + type: "boolean", + category: "Advanced", + description: Diagnostics.Skip_type_checking_of_default_library_declaration_files + }, + { name: "charset", type: "string", + category: "Advanced", description: Diagnostics.The_character_set_of_the_input_files }, compileOnSaveCommandLineOption, { name: "emitBOM", type: "boolean", + category: "Advanced", description:Diagnostics.Emit_a_UTF_8_Byte_Order_Mark_BOM_in_the_beginning_of_output_files }, { name: "locale", type: "string", + category: "Advanced", description: Diagnostics.The_locale_to_use_to_show_error_messages_e_g_en_us }, { @@ -460,44 +542,63 @@ namespace ts { "lf": NewLineKind.LineFeed }), paramType: Diagnostics.NEWLINE, + category: "Advanced", description: Diagnostics.Specify_the_end_of_line_sequence_to_be_used_when_emitting_files_Colon_CRLF_dos_or_LF_unix, }, { name: "noErrorTruncation", type: "boolean", + category: "Advanced", description: Diagnostics.Do_not_truncation_error_messages }, { name: "noLib", type: "boolean", + category: "Advanced", description: Diagnostics.Do_not_include_the_default_library_file_lib_d_ts }, { name: "noResolve", type: "boolean", + category: "Advanced", description:Diagnostics.Do_not_add_triple_slash_references_or_module_import_targets_to_the_list_of_compiled_files }, - { - name: "skipDefaultLibCheck", - type: "boolean", - description: Diagnostics.Skip_type_checking_of_default_library_declaration_files - }, { name: "stripInternal", type: "boolean", - experimental: true, + category: "Advanced", description: Diagnostics.Do_not_emit_declarations_for_code_that_has_an_internal_annotation, }, { name: "disableSizeLimit", type: "boolean", + category: "Advanced", description: Diagnostics.Disable_size_limitation_on_JavaScript_project }, { name: "noImplicitUseStrict", type: "boolean", + category: "Advanced", description: Diagnostics.Do_not_emit_use_strict_directives_in_module_output }, + { + name: "noEmitHelpers", + type: "boolean", + category: "Advanced", + description: Diagnostics.Do_not_generate_custom_helper_functions_like_extends_in_compiled_output + }, + { + name: "noEmitOnError", + type: "boolean", + category: "Advanced", + description: Diagnostics.Do_not_emit_outputs_if_any_errors_were_reported, + }, + { + name: "preserveConstEnums", + type: "boolean", + category: "Advanced", + description: Diagnostics.Do_not_erase_const_enum_declarations_in_generated_code + }, ]; /* @internal */ @@ -813,6 +914,7 @@ namespace ts { case "version": case "help": case "project": + case "all": break; default: const value = options[name]; diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index cae9ad0a3a..166417118c 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -3077,6 +3077,10 @@ "category": "Message", "code": 6168 }, + "Show all compiler options.": { + "category": "Message", + "code": 6169 + }, "Variable '{0}' implicitly has an '{1}' type.": { "category": "Error", diff --git a/src/compiler/tsc.ts b/src/compiler/tsc.ts index 936a6d69c6..474e5af8e1 100644 --- a/src/compiler/tsc.ts +++ b/src/compiler/tsc.ts @@ -227,7 +227,7 @@ namespace ts { if (commandLine.options.help) { printVersion(); - printHelp(); + printHelp(commandLine.options.all); return sys.exit(ExitStatus.Success); } @@ -264,7 +264,7 @@ namespace ts { if (commandLine.fileNames.length === 0 && !configFileName) { printVersion(); - printHelp(); + printHelp(commandLine.options.all); return sys.exit(ExitStatus.Success); } @@ -618,7 +618,7 @@ namespace ts { sys.write(getDiagnosticText(Diagnostics.Version_0, ts.version) + sys.newLine); } - function printHelp() { + function printHelp(showAllOptions: boolean) { const output: string[] = []; // We want to align our "syntax" and "examples" commands to a certain margin. @@ -643,8 +643,9 @@ namespace ts { output.push(getDiagnosticText(Diagnostics.Options_Colon) + sys.newLine); // Sort our options by their names, (e.g. "--noImplicitAny" comes before "--watch") - const optsList = filter(optionDeclarations.slice(), v => !v.experimental); - //optsList.sort((a, b) => compareValues(a.name.toLowerCase(), b.name.toLowerCase())); + const optsList = showAllOptions ? + optionDeclarations.slice().sort((a, b) => compareValues(a.name.toLowerCase(), b.name.toLowerCase())) : + filter(optionDeclarations.slice(), v => v.showInSimplifiedHelpView); // We want our descriptions to align at the same column in our output, // so we keep track of the longest option usage string. diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 49e744682b..69c8d7a5c9 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -3194,6 +3194,7 @@ export type CompilerOptionsValue = string | number | boolean | (string | number)[] | string[] | MapLike; export interface CompilerOptions { + /*@internal*/ all?: boolean; allowJs?: boolean; /*@internal*/ allowNonTsExtensions?: boolean; allowSyntheticDefaultImports?: boolean; @@ -3382,8 +3383,10 @@ shortName?: string; // A short mnemonic for convenience - for instance, 'h' can be used in place of 'help' description?: DiagnosticMessage; // The message describing what the command line switch does paramType?: DiagnosticMessage; // The name to be used for a non-boolean option's parameter - experimental?: boolean; isTSConfigOnly?: boolean; // True if option can only be specified via tsconfig.json file + isCommandLineOnly?: boolean; + showInSimplifiedHelpView?:boolean; + category?: "CommandLine" | "Basic" | "StrictChecks" | "ModuleResolution" | "JSX" | "SourceMaps" | "Experimental" | "Advanced"; } /* @internal */ From 6837125657f9f04321aa39767276b257d5639f2e Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Wed, 8 Feb 2017 12:25:38 -0800 Subject: [PATCH 04/24] Add deprecation notice for some options --- src/compiler/commandLineParser.ts | 6 +++--- src/compiler/diagnosticMessages.json | 8 ++++++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts index c161aa55bb..3b5b7cbba2 100644 --- a/src/compiler/commandLineParser.ts +++ b/src/compiler/commandLineParser.ts @@ -501,19 +501,19 @@ namespace ts { // for correct behaviour, please use outFile category: "Advanced", paramType: Diagnostics.FILE, - description: Diagnostics.Concatenate_and_emit_output_to_single_file, + description: Diagnostics.Deprecated_Use_outFile_instead_Concatenate_and_emit_output_to_single_file, }, { name: "reactNamespace", type: "string", category: "Advanced", - description: Diagnostics.Specify_the_object_invoked_for_createElement_and_spread_when_targeting_react_JSX_emit + description: Diagnostics.Deprecated_Use_jsxFactory_instead_Specify_the_object_invoked_for_createElement_when_targeting_react_JSX_emit }, { name: "skipDefaultLibCheck", type: "boolean", category: "Advanced", - description: Diagnostics.Skip_type_checking_of_default_library_declaration_files + description: Diagnostics.Deprecated_Use_skipLibCheck_instead_Skip_type_checking_of_default_library_declaration_files }, { diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 166417118c..b487b47b10 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -2737,7 +2737,7 @@ "category": "Message", "code": 6083 }, - "Specify the object invoked for createElement and __spread when targeting 'react' JSX emit": { + "[Deprecated] Use '--jsxFactory' instead. Specify the object invoked for createElement when targeting 'react' JSX emit": { "category": "Message", "code": 6084 }, @@ -3041,7 +3041,7 @@ "category": "Message", "code": 6159 }, - "Skip type checking of default library declaration files.": { + "[Deprecated] Use '--skipLibCheck' instead. Skip type checking of default library declaration files.": { "category": "Message", "code": 6160 }, @@ -3081,6 +3081,10 @@ "category": "Message", "code": 6169 }, + "[Deprecated] Use '--outFile' instead. Concatenate and emit output to single file": { + "category": "Message", + "code": 6170 + }, "Variable '{0}' implicitly has an '{1}' type.": { "category": "Error", From f53eeae4d8332b6aa800d867287c46011bb979de Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Wed, 8 Feb 2017 12:35:31 -0800 Subject: [PATCH 05/24] use category in serializeCompilerOptions --- src/compiler/commandLineParser.ts | 54 +++++++++++++------------------ 1 file changed, 23 insertions(+), 31 deletions(-) diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts index 3b5b7cbba2..d3940b6342 100644 --- a/src/compiler/commandLineParser.ts +++ b/src/compiler/commandLineParser.ts @@ -908,39 +908,31 @@ namespace ts { if (hasProperty(options, name)) { // tsconfig only options cannot be specified via command line, // so we can assume that only types that can appear here string | number | boolean - switch (name) { - case "init": - case "watch": - case "version": - case "help": - case "project": - case "all": - break; - default: - const value = options[name]; - const optionDefinition = optionsNameMap.get(name.toLowerCase()); - if (optionDefinition) { - const customTypeMap = getCustomTypeMapOfCommandLineOption(optionDefinition); - if (!customTypeMap) { - // There is no map associated with this compiler option then use the value as-is - // This is the case if the value is expect to be string, number, boolean or list of string - result[name] = value; - } - else { - if (optionDefinition.type === "list") { - const convertedValue: string[] = []; - for (const element of value as (string | number)[]) { - convertedValue.push(getNameOfCompilerOptionValue(element, customTypeMap)); - } - result[name] = convertedValue; - } - else { - // There is a typeMap associated with this command-line option so use it to map value back to its name - result[name] = getNameOfCompilerOptionValue(value, customTypeMap); - } + if (optionsNameMap.has(name) && optionsNameMap.get(name).category === "CommandLine") { + continue; + } + const value = options[name]; + const optionDefinition = optionsNameMap.get(name.toLowerCase()); + if (optionDefinition) { + const customTypeMap = getCustomTypeMapOfCommandLineOption(optionDefinition); + if (!customTypeMap) { + // There is no map associated with this compiler option then use the value as-is + // This is the case if the value is expect to be string, number, boolean or list of string + result[name] = value; + } + else { + if (optionDefinition.type === "list") { + const convertedValue: string[] = []; + for (const element of value as (string | number)[]) { + convertedValue.push(getNameOfCompilerOptionValue(element, customTypeMap)); } + result[name] = convertedValue; } - break; + else { + // There is a typeMap associated with this command-line option so use it to map value back to its name + result[name] = getNameOfCompilerOptionValue(value, customTypeMap); + } + } } } } From 0bc2840af4695dcd96e1d50d08672d36b21e6165 Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Wed, 8 Feb 2017 12:41:40 -0800 Subject: [PATCH 06/24] Make generateTSConfig return a string --- src/compiler/commandLineParser.ts | 4 ++-- src/compiler/tsc.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts index d3940b6342..d8a6f402a1 100644 --- a/src/compiler/commandLineParser.ts +++ b/src/compiler/commandLineParser.ts @@ -866,7 +866,7 @@ namespace ts { * @param fileNames array of filenames to be generated into tsconfig.json */ /* @internal */ - export function generateTSConfig(options: CompilerOptions, fileNames: string[]): { compilerOptions: MapLike } { + export function generateTSConfig(options: CompilerOptions, fileNames: string[]): string { const compilerOptions = extend(options, defaultInitCompilerOptions); const configurations: any = { compilerOptions: serializeCompilerOptions(compilerOptions) @@ -876,7 +876,7 @@ namespace ts { configurations.files = fileNames; } - return configurations; + return JSON.stringify(configurations, undefined, 4); function getCustomTypeMapOfCommandLineOption(optionDefinition: CommandLineOption): Map | undefined { if (optionDefinition.type === "string" || optionDefinition.type === "number" || optionDefinition.type === "boolean") { diff --git a/src/compiler/tsc.ts b/src/compiler/tsc.ts index 474e5af8e1..3800ed91aa 100644 --- a/src/compiler/tsc.ts +++ b/src/compiler/tsc.ts @@ -739,7 +739,7 @@ namespace ts { reportDiagnostic(createCompilerDiagnostic(Diagnostics.A_tsconfig_json_file_is_already_defined_at_Colon_0, file), /* host */ undefined); } else { - sys.writeFile(file, JSON.stringify(generateTSConfig(options, fileNames), undefined, 4)); + sys.writeFile(file, generateTSConfig(options, fileNames)); reportDiagnostic(createCompilerDiagnostic(Diagnostics.Successfully_created_a_tsconfig_json_file), /* host */ undefined); } From 9fc4f6e1b9175f2649f4b14f46285ab889764285 Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Wed, 8 Feb 2017 19:07:15 -0800 Subject: [PATCH 07/24] Write comments for compiler options in `tsc --init` output --- src/compiler/commandLineParser.ts | 71 ++++++++++++++++++++++++++++++- 1 file changed, 69 insertions(+), 2 deletions(-) diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts index d8a6f402a1..1a388c9e96 100644 --- a/src/compiler/commandLineParser.ts +++ b/src/compiler/commandLineParser.ts @@ -868,7 +868,7 @@ namespace ts { /* @internal */ export function generateTSConfig(options: CompilerOptions, fileNames: string[]): string { const compilerOptions = extend(options, defaultInitCompilerOptions); - const configurations: any = { + const configurations: { compilerOptions: MapLike; files?: string[] } = { compilerOptions: serializeCompilerOptions(compilerOptions) }; if (fileNames && fileNames.length) { @@ -876,7 +876,8 @@ namespace ts { configurations.files = fileNames; } - return JSON.stringify(configurations, undefined, 4); + + return writeConfigurations(); function getCustomTypeMapOfCommandLineOption(optionDefinition: CommandLineOption): Map | undefined { if (optionDefinition.type === "string" || optionDefinition.type === "number" || optionDefinition.type === "boolean") { @@ -938,6 +939,72 @@ namespace ts { } return result; } + + function getDefaultValueForOption(option: CommandLineOption) { + switch (option.type) { + case "number": + return 1; + case "boolean": + return true; + case "string": + return option.isFilePath ? "./" : ""; + case "list": + return []; + case "object": + return {}; + default: + return arrayFrom((option).type.keys())[0]; + } + } + + function writeConfigurations() { + const categorizedOptions = reduceLeft( + filter(optionDeclarations, o => o.category !== "CommandLine" && o.category !== "Advanced"), + (memo, value) => { + if (value.category) { + (memo[value.category] || (memo[value.category] = [])).push(value); + } + return memo; + }, >{}); + const knownKesyCount = getOwnKeys(configurations.compilerOptions).length; + + const newLine = "\n"; + const tab = " "; + + let result = ""; + let seenKnownKeys = 0; + result += `{${newLine}`; + result += `${tab}"compilerOptions": {${newLine}`; + for (const category in categorizedOptions) { + result += `${tab}${tab}// ${category}${newLine}`; + result += `${newLine}`; + for (const option of categorizedOptions[category]) { + result += `${tab}${tab}// ${option.description && option.description.message || option.name}${newLine}`; + if (option.name in configurations.compilerOptions) { + result += `${tab}${tab}"${option.name}": ${JSON.stringify(configurations.compilerOptions[option.name])}${++seenKnownKeys === knownKesyCount ? "" : ","}${newLine}`; + } + else { + result += `${tab}${tab}// "${option.name}": ${JSON.stringify(getDefaultValueForOption(option))},${newLine}`; + } + result += `${newLine}`; + } + result += `${newLine}`; + } + if (configurations.files && configurations.files.length) { + result += `${tab}},${newLine}`; + result += `${tab}"files": [${newLine}`; + for (let i = 0; i < configurations.files.length; i++) { + result += `${tab}${tab}${JSON.stringify(configurations.files[i])}${i === configurations.files.length - 1 ? "" : ","}${newLine}`; + } + result += `${tab}]${newLine}`; + } + else { + result += `${tab}}${newLine}`; + } + result += `}${newLine}`; + + return result; + } } /** From 1c0ca7ce1d9f8a147e1ff00c63ed15475437fa98 Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Wed, 8 Feb 2017 19:09:22 -0800 Subject: [PATCH 08/24] Remove properties from tsconfig.json that defaults to false --- src/compiler/commandLineParser.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts index 1a388c9e96..adbb879d5e 100644 --- a/src/compiler/commandLineParser.ts +++ b/src/compiler/commandLineParser.ts @@ -641,9 +641,7 @@ namespace ts { /* @internal */ export const defaultInitCompilerOptions: CompilerOptions = { module: ModuleKind.CommonJS, - target: ScriptTarget.ES5, - noImplicitAny: false, - sourceMap: false, + target: ScriptTarget.ES5 }; let optionNameMapCache: OptionNameMap; From c97673c55cf12b880d6177a143aa2b4dc112fded Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Wed, 8 Feb 2017 19:25:08 -0800 Subject: [PATCH 09/24] Make categories localizable --- src/compiler/commandLineParser.ts | 153 ++++++++++++++------------- src/compiler/diagnosticMessages.json | 33 ++++++ src/compiler/types.ts | 2 +- 3 files changed, 111 insertions(+), 77 deletions(-) diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts index adbb879d5e..46327668f2 100644 --- a/src/compiler/commandLineParser.ts +++ b/src/compiler/commandLineParser.ts @@ -15,7 +15,7 @@ namespace ts { shortName: "h", type: "boolean", showInSimplifiedHelpView: true, - category: "CommandLine", + category: Diagnostics.CommandLine_Options, description: Diagnostics.Print_this_message, }, { @@ -27,7 +27,7 @@ namespace ts { name: "all", type: "boolean", showInSimplifiedHelpView: true, - category: "CommandLine", + category: Diagnostics.CommandLine_Options, description: Diagnostics.Show_all_compiler_options, }, { @@ -35,14 +35,14 @@ namespace ts { shortName: "v", type: "boolean", showInSimplifiedHelpView: true, - category: "CommandLine", + category: Diagnostics.CommandLine_Options, description: Diagnostics.Print_the_compiler_s_version, }, { name: "init", type: "boolean", showInSimplifiedHelpView: true, - category: "CommandLine", + category: Diagnostics.CommandLine_Options, description: Diagnostics.Initializes_a_TypeScript_project_and_creates_a_tsconfig_json_file, }, { @@ -51,7 +51,7 @@ namespace ts { type: "string", isFilePath: true, showInSimplifiedHelpView: true, - category: "CommandLine", + category: Diagnostics.CommandLine_Options, paramType: Diagnostics.FILE_OR_DIRECTORY, description: Diagnostics.Compile_the_project_given_the_path_to_its_configuration_file_or_to_a_folder_with_a_tsconfig_json, }, @@ -59,7 +59,7 @@ namespace ts { name: "pretty", type: "boolean", showInSimplifiedHelpView: true, - category: "CommandLine", + category: Diagnostics.CommandLine_Options, description: Diagnostics.Stylize_errors_and_messages_using_color_and_context_experimental }, { @@ -67,7 +67,7 @@ namespace ts { shortName: "w", type: "boolean", showInSimplifiedHelpView: true, - category: "CommandLine", + category: Diagnostics.CommandLine_Options, description: Diagnostics.Watch_input_files, }, @@ -86,7 +86,7 @@ namespace ts { }), paramType: Diagnostics.VERSION, showInSimplifiedHelpView: true, - category: "Basic", + category: Diagnostics.Basic_Options, description: Diagnostics.Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_or_ESNEXT, }, { @@ -103,7 +103,7 @@ namespace ts { }), paramType: Diagnostics.KIND, showInSimplifiedHelpView: true, - category: "Basic", + category: Diagnostics.Basic_Options, description: Diagnostics.Specify_module_code_generation_Colon_commonjs_amd_system_umd_or_es2015, }, { @@ -141,14 +141,14 @@ namespace ts { }), }, showInSimplifiedHelpView: true, - category: "Basic", + category: Diagnostics.Basic_Options, description: Diagnostics.Specify_library_files_to_be_included_in_the_compilation_Colon }, { name: "allowJs", type: "boolean", showInSimplifiedHelpView: true, - category: "Basic", + category: Diagnostics.Basic_Options, description: Diagnostics.Allow_javascript_files_to_be_compiled }, { @@ -160,7 +160,7 @@ namespace ts { }), paramType: Diagnostics.KIND, showInSimplifiedHelpView: true, - category: "Basic", + category: Diagnostics.Basic_Options, description: Diagnostics.Specify_JSX_code_generation_Colon_preserve_react_native_or_react, }, { @@ -168,14 +168,14 @@ namespace ts { shortName: "d", type: "boolean", showInSimplifiedHelpView: true, - category: "Basic", + category: Diagnostics.Basic_Options, description: Diagnostics.Generates_corresponding_d_ts_file, }, { name: "sourceMap", type: "boolean", showInSimplifiedHelpView: true, - category: "Basic", + category: Diagnostics.Basic_Options, description: Diagnostics.Generates_corresponding_map_file, }, { @@ -184,7 +184,7 @@ namespace ts { isFilePath: true, paramType: Diagnostics.FILE, showInSimplifiedHelpView: true, - category: "Basic", + category: Diagnostics.Basic_Options, description: Diagnostics.Concatenate_and_emit_output_to_single_file, }, { @@ -193,7 +193,7 @@ namespace ts { isFilePath: true, paramType: Diagnostics.DIRECTORY, showInSimplifiedHelpView: true, - category: "Basic", + category: Diagnostics.Basic_Options, description: Diagnostics.Redirect_output_structure_to_the_directory, }, { @@ -201,7 +201,7 @@ namespace ts { type: "string", isFilePath: true, paramType: Diagnostics.LOCATION, - category: "Basic", + category: Diagnostics.Basic_Options, description: Diagnostics.Specify_the_root_directory_of_input_files_Use_to_control_the_output_directory_structure_with_outDir, }, { @@ -209,39 +209,39 @@ namespace ts { type: "string", isFilePath: true, paramType: Diagnostics.DIRECTORY, - category: "Basic", + category: Diagnostics.Basic_Options, description: Diagnostics.Output_directory_for_generated_declaration_files }, { name: "removeComments", type: "boolean", showInSimplifiedHelpView: true, - category: "Basic", + category: Diagnostics.Basic_Options, description: Diagnostics.Do_not_emit_comments_to_output, }, { name: "noEmit", type: "boolean", showInSimplifiedHelpView: true, - category: "Basic", + category: Diagnostics.Basic_Options, description: Diagnostics.Do_not_emit_outputs, }, { name: "importHelpers", type: "boolean", - category: "Basic", + category: Diagnostics.Basic_Options, description: Diagnostics.Import_emit_helpers_from_tslib }, { name: "skipLibCheck", type: "boolean", - category: "Basic", + category: Diagnostics.Basic_Options, description: Diagnostics.Skip_type_checking_of_declaration_files, }, { name: "isolatedModules", type: "boolean", - category: "Basic", + category: Diagnostics.Basic_Options, description: Diagnostics.Unconditionally_emit_imports_for_unresolved_files }, @@ -250,86 +250,86 @@ namespace ts { name: "noImplicitAny", type: "boolean", showInSimplifiedHelpView: true, - category: "StrictChecks", + category: Diagnostics.Strict_Checks, description: Diagnostics.Raise_error_on_expressions_and_declarations_with_an_implied_any_type, }, { name: "strictNullChecks", type: "boolean", showInSimplifiedHelpView: true, - category: "StrictChecks", + category: Diagnostics.Strict_Checks, description: Diagnostics.Enable_strict_null_checks }, { name: "noImplicitThis", type: "boolean", showInSimplifiedHelpView: true, - category: "StrictChecks", + category: Diagnostics.Strict_Checks, description: Diagnostics.Raise_error_on_this_expressions_with_an_implied_any_type, }, { name: "noUnusedLocals", type: "boolean", showInSimplifiedHelpView: true, - category: "StrictChecks", + category: Diagnostics.Strict_Checks, description: Diagnostics.Report_errors_on_unused_locals, }, { name: "noUnusedParameters", type: "boolean", showInSimplifiedHelpView: true, - category: "StrictChecks", + category: Diagnostics.Strict_Checks, description: Diagnostics.Report_errors_on_unused_parameters, }, { name: "alwaysStrict", type: "boolean", showInSimplifiedHelpView: true, - category: "StrictChecks", + category: Diagnostics.Strict_Checks, description: Diagnostics.Parse_in_strict_mode_and_emit_use_strict_for_each_source_file }, { name: "noImplicitReturns", type: "boolean", showInSimplifiedHelpView: true, - category: "StrictChecks", + category: Diagnostics.Strict_Checks, description: Diagnostics.Report_error_when_not_all_code_paths_in_function_return_a_value }, { name: "noFallthroughCasesInSwitch", type: "boolean", showInSimplifiedHelpView: true, - category: "StrictChecks", + category: Diagnostics.Strict_Checks, description: Diagnostics.Report_errors_for_fallthrough_cases_in_switch_statement }, { name: "allowUnusedLabels", type: "boolean", - category: "StrictChecks", + category: Diagnostics.Strict_Checks, description: Diagnostics.Do_not_report_errors_on_unused_labels }, { name: "allowUnreachableCode", type: "boolean", - category: "StrictChecks", + category: Diagnostics.Strict_Checks, description: Diagnostics.Do_not_report_errors_on_unreachable_code }, { name: "suppressExcessPropertyErrors", type: "boolean", - category: "StrictChecks", + category: Diagnostics.Strict_Checks, description: Diagnostics.Suppress_excess_property_checks_for_object_literals, }, { name: "suppressImplicitAnyIndexErrors", type: "boolean", - category: "StrictChecks", + category: Diagnostics.Strict_Checks, description: Diagnostics.Suppress_noImplicitAny_errors_for_indexing_objects_lacking_index_signatures, }, { name: "forceConsistentCasingInFileNames", type: "boolean", - category: "StrictChecks", + category: Diagnostics.Strict_Checks, description: Diagnostics.Disallow_inconsistently_cased_references_to_the_same_file }, @@ -341,14 +341,14 @@ namespace ts { "classic": ModuleResolutionKind.Classic, }), paramType: Diagnostics.STRATEGY, - category: "ModuleResolution", + category: Diagnostics.Module_Resolution_Options, description: Diagnostics.Specify_module_resolution_strategy_Colon_node_Node_js_or_classic_TypeScript_pre_1_6, }, { name: "baseUrl", type: "string", isFilePath: true, - category: "ModuleResolution", + category: Diagnostics.Module_Resolution_Options, description: Diagnostics.Base_directory_to_resolve_non_absolute_module_names }, { @@ -357,7 +357,7 @@ namespace ts { name: "paths", type: "object", isTSConfigOnly: true, - category: "ModuleResolution", + category: Diagnostics.Module_Resolution_Options, description: Diagnostics.List_of_path_mapping_entries_for_module_names_to_locations_relative_to_the_baseUrl }, @@ -372,7 +372,7 @@ namespace ts { type: "string", isFilePath: true }, - category: "ModuleResolution", + category: Diagnostics.Module_Resolution_Options, description: Diagnostics.List_of_root_folders_whose_combined_content_represent_the_structure_of_the_project_at_runtime }, { @@ -383,7 +383,7 @@ namespace ts { type: "string", isFilePath: true }, - category: "ModuleResolution", + category: Diagnostics.Module_Resolution_Options, description: Diagnostics.List_of_folders_to_include_type_definitions_from }, { @@ -394,19 +394,19 @@ namespace ts { type: "string" }, showInSimplifiedHelpView: true, - category: "ModuleResolution", + category: Diagnostics.Module_Resolution_Options, description: Diagnostics.Type_declaration_files_to_be_included_in_compilation }, { name: "allowSyntheticDefaultImports", type: "boolean", - category: "ModuleResolution", + category: Diagnostics.Module_Resolution_Options, description: Diagnostics.Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typechecking }, { name: "maxNodeModuleJsDepth", type: "number", - category: "ModuleResolution", + category: Diagnostics.Module_Resolution_Options, description: Diagnostics.The_maximum_dependency_depth_to_search_under_node_modules_and_load_JavaScript_files }, @@ -416,7 +416,7 @@ namespace ts { type: "string", isFilePath: true, paramType: Diagnostics.LOCATION, - category: "SourceMaps", + category: Diagnostics.SourceMap_Options, description: Diagnostics.Specify_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations, }, { @@ -424,19 +424,19 @@ namespace ts { type: "string", isFilePath: true, paramType: Diagnostics.LOCATION, - category: "SourceMaps", + category: Diagnostics.SourceMap_Options, description: Diagnostics.Specify_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations, }, { name: "inlineSourceMap", type: "boolean", - category: "SourceMaps", + category: Diagnostics.SourceMap_Options, description: Diagnostics.Emit_a_single_file_with_source_maps_instead_of_having_a_separate_file }, { name: "inlineSources", type: "boolean", - category: "SourceMaps", + category: Diagnostics.SourceMap_Options, description:Diagnostics.Emit_the_source_alongside_the_sourcemaps_within_a_single_file_requires_inlineSourceMap_or_sourceMap_to_be_set }, @@ -444,7 +444,7 @@ namespace ts { { name: "jsxFactory", type: "string", - category: "JSX", + category: Diagnostics.JSX_Options, description: Diagnostics.Specify_the_JSX_factory_function_to_use_when_targeting_react_JSX_emit_e_g_React_createElement_or_h }, @@ -452,13 +452,13 @@ namespace ts { { name: "experimentalDecorators", type: "boolean", - category: "Experimental", + category: Diagnostics.Experimental_Options, description: Diagnostics.Enables_experimental_support_for_ES7_decorators }, { name: "emitDecoratorMetadata", type: "boolean", - category: "Experimental", + category: Diagnostics.Experimental_Options, description: Diagnostics.Enables_experimental_support_for_emitting_type_metadata_for_decorators }, @@ -466,31 +466,31 @@ namespace ts { { name: "diagnostics", type: "boolean", - category: "Advanced", + category: Diagnostics.Advanced_Options, description: Diagnostics.Show_diagnostic_information }, { name: "extendedDiagnostics", type: "boolean", - category: "Advanced", + category: Diagnostics.Advanced_Options, description: Diagnostics.Show_extended_diagnostic_information }, { name: "traceResolution", type: "boolean", - category: "Advanced", + category: Diagnostics.Advanced_Options, description: Diagnostics.Enable_tracing_of_the_name_resolution_process }, { name: "listFiles", type: "boolean", - category: "Advanced", + category: Diagnostics.Advanced_Options, description: Diagnostics.Print_names_of_files_part_of_the_compilation }, { name: "listEmittedFiles", type: "boolean", - category: "Advanced", + category: Diagnostics.Advanced_Options, description: Diagnostics.Print_names_of_generated_files_part_of_the_compilation }, @@ -499,40 +499,40 @@ namespace ts { type: "string", isFilePath: false, // This is intentionally broken to support compatability with existing tsconfig files // for correct behaviour, please use outFile - category: "Advanced", + category: Diagnostics.Advanced_Options, paramType: Diagnostics.FILE, description: Diagnostics.Deprecated_Use_outFile_instead_Concatenate_and_emit_output_to_single_file, }, { name: "reactNamespace", type: "string", - category: "Advanced", + category: Diagnostics.Advanced_Options, description: Diagnostics.Deprecated_Use_jsxFactory_instead_Specify_the_object_invoked_for_createElement_when_targeting_react_JSX_emit }, { name: "skipDefaultLibCheck", type: "boolean", - category: "Advanced", + category: Diagnostics.Advanced_Options, description: Diagnostics.Deprecated_Use_skipLibCheck_instead_Skip_type_checking_of_default_library_declaration_files }, { name: "charset", type: "string", - category: "Advanced", + category: Diagnostics.Advanced_Options, description: Diagnostics.The_character_set_of_the_input_files }, compileOnSaveCommandLineOption, { name: "emitBOM", type: "boolean", - category: "Advanced", + category: Diagnostics.Advanced_Options, description:Diagnostics.Emit_a_UTF_8_Byte_Order_Mark_BOM_in_the_beginning_of_output_files }, { name: "locale", type: "string", - category: "Advanced", + category: Diagnostics.Advanced_Options, description: Diagnostics.The_locale_to_use_to_show_error_messages_e_g_en_us }, { @@ -542,61 +542,61 @@ namespace ts { "lf": NewLineKind.LineFeed }), paramType: Diagnostics.NEWLINE, - category: "Advanced", + category: Diagnostics.Advanced_Options, description: Diagnostics.Specify_the_end_of_line_sequence_to_be_used_when_emitting_files_Colon_CRLF_dos_or_LF_unix, }, { name: "noErrorTruncation", type: "boolean", - category: "Advanced", + category: Diagnostics.Advanced_Options, description: Diagnostics.Do_not_truncation_error_messages }, { name: "noLib", type: "boolean", - category: "Advanced", + category: Diagnostics.Advanced_Options, description: Diagnostics.Do_not_include_the_default_library_file_lib_d_ts }, { name: "noResolve", type: "boolean", - category: "Advanced", + category: Diagnostics.Advanced_Options, description:Diagnostics.Do_not_add_triple_slash_references_or_module_import_targets_to_the_list_of_compiled_files }, { name: "stripInternal", type: "boolean", - category: "Advanced", + category: Diagnostics.Advanced_Options, description: Diagnostics.Do_not_emit_declarations_for_code_that_has_an_internal_annotation, }, { name: "disableSizeLimit", type: "boolean", - category: "Advanced", + category: Diagnostics.Advanced_Options, description: Diagnostics.Disable_size_limitation_on_JavaScript_project }, { name: "noImplicitUseStrict", type: "boolean", - category: "Advanced", + category: Diagnostics.Advanced_Options, description: Diagnostics.Do_not_emit_use_strict_directives_in_module_output }, { name: "noEmitHelpers", type: "boolean", - category: "Advanced", + category: Diagnostics.Advanced_Options, description: Diagnostics.Do_not_generate_custom_helper_functions_like_extends_in_compiled_output }, { name: "noEmitOnError", type: "boolean", - category: "Advanced", + category: Diagnostics.Advanced_Options, description: Diagnostics.Do_not_emit_outputs_if_any_errors_were_reported, }, { name: "preserveConstEnums", type: "boolean", - category: "Advanced", + category: Diagnostics.Advanced_Options, description: Diagnostics.Do_not_erase_const_enum_declarations_in_generated_code }, ]; @@ -907,7 +907,7 @@ namespace ts { if (hasProperty(options, name)) { // tsconfig only options cannot be specified via command line, // so we can assume that only types that can appear here string | number | boolean - if (optionsNameMap.has(name) && optionsNameMap.get(name).category === "CommandLine") { + if (optionsNameMap.has(name) && optionsNameMap.get(name).category === Diagnostics.CommandLine_Options) { continue; } const value = options[name]; @@ -957,10 +957,11 @@ namespace ts { function writeConfigurations() { const categorizedOptions = reduceLeft( - filter(optionDeclarations, o => o.category !== "CommandLine" && o.category !== "Advanced"), + filter(optionDeclarations, o => o.category !== Diagnostics.CommandLine_Options && o.category !== Diagnostics.Advanced_Options), (memo, value) => { if (value.category) { - (memo[value.category] || (memo[value.category] = [])).push(value); + const name = getLocaleSpecificMessage(value.category); + (memo[name] || (memo[name] = [])).push(value); } return memo; }, >{}); @@ -977,7 +978,7 @@ namespace ts { result += `${tab}${tab}// ${category}${newLine}`; result += `${newLine}`; for (const option of categorizedOptions[category]) { - result += `${tab}${tab}// ${option.description && option.description.message || option.name}${newLine}`; + result += `${tab}${tab}// ${option.description && getLocaleSpecificMessage(option.description) || option.name}${newLine}`; if (option.name in configurations.compilerOptions) { result += `${tab}${tab}"${option.name}": ${JSON.stringify(configurations.compilerOptions[option.name])}${++seenKnownKeys === knownKesyCount ? "" : ","}${newLine}`; } diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index b487b47b10..f5ee14a8cb 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -3085,6 +3085,39 @@ "category": "Message", "code": 6170 }, + "CommandLine Options": { + "category": "Message", + "code": 6171 + }, + "Basic Options": { + "category": "Message", + "code": 6172 + }, + "Strict Checks": { + "category": "Message", + "code": 6173 + }, + "Module Resolution Options": { + "category": "Message", + "code": 6174 + }, + "SourceMap Options": { + "category": "Message", + "code": 6175 + }, + "JSX Options": { + "category": "Message", + "code": 6176 + }, + "Experimental Options": { + "category": "Message", + "code": 6177 + }, + "Advanced Options": { + "category": "Message", + "code": 6178 + }, + "Variable '{0}' implicitly has an '{1}' type.": { "category": "Error", diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 69c8d7a5c9..589c196d13 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -3386,7 +3386,7 @@ isTSConfigOnly?: boolean; // True if option can only be specified via tsconfig.json file isCommandLineOnly?: boolean; showInSimplifiedHelpView?:boolean; - category?: "CommandLine" | "Basic" | "StrictChecks" | "ModuleResolution" | "JSX" | "SourceMaps" | "Experimental" | "Advanced"; + category?: DiagnosticMessage; } /* @internal */ From 4de44ee1a241da87ccf2a797e5eb682c1ddbf57f Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Wed, 8 Feb 2017 19:32:27 -0800 Subject: [PATCH 10/24] Mark some more options as advanced --- src/compiler/commandLineParser.ts | 100 +++++++++++++++--------------- 1 file changed, 50 insertions(+), 50 deletions(-) diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts index 46327668f2..7b32a23a7d 100644 --- a/src/compiler/commandLineParser.ts +++ b/src/compiler/commandLineParser.ts @@ -204,14 +204,6 @@ namespace ts { category: Diagnostics.Basic_Options, description: Diagnostics.Specify_the_root_directory_of_input_files_Use_to_control_the_output_directory_structure_with_outDir, }, - { - name: "declarationDir", - type: "string", - isFilePath: true, - paramType: Diagnostics.DIRECTORY, - category: Diagnostics.Basic_Options, - description: Diagnostics.Output_directory_for_generated_declaration_files - }, { name: "removeComments", type: "boolean", @@ -232,12 +224,6 @@ namespace ts { category: Diagnostics.Basic_Options, description: Diagnostics.Import_emit_helpers_from_tslib }, - { - name: "skipLibCheck", - type: "boolean", - category: Diagnostics.Basic_Options, - description: Diagnostics.Skip_type_checking_of_declaration_files, - }, { name: "isolatedModules", type: "boolean", @@ -302,36 +288,6 @@ namespace ts { category: Diagnostics.Strict_Checks, description: Diagnostics.Report_errors_for_fallthrough_cases_in_switch_statement }, - { - name: "allowUnusedLabels", - type: "boolean", - category: Diagnostics.Strict_Checks, - description: Diagnostics.Do_not_report_errors_on_unused_labels - }, - { - name: "allowUnreachableCode", - type: "boolean", - category: Diagnostics.Strict_Checks, - description: Diagnostics.Do_not_report_errors_on_unreachable_code - }, - { - name: "suppressExcessPropertyErrors", - type: "boolean", - category: Diagnostics.Strict_Checks, - description: Diagnostics.Suppress_excess_property_checks_for_object_literals, - }, - { - name: "suppressImplicitAnyIndexErrors", - type: "boolean", - category: Diagnostics.Strict_Checks, - description: Diagnostics.Suppress_noImplicitAny_errors_for_indexing_objects_lacking_index_signatures, - }, - { - name: "forceConsistentCasingInFileNames", - type: "boolean", - category: Diagnostics.Strict_Checks, - description: Diagnostics.Disallow_inconsistently_cased_references_to_the_same_file - }, // Module Resolution { @@ -403,12 +359,6 @@ namespace ts { category: Diagnostics.Module_Resolution_Options, description: Diagnostics.Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typechecking }, - { - name: "maxNodeModuleJsDepth", - type: "number", - category: Diagnostics.Module_Resolution_Options, - description: Diagnostics.The_maximum_dependency_depth_to_search_under_node_modules_and_load_JavaScript_files - }, // Source Maps { @@ -599,6 +549,56 @@ namespace ts { category: Diagnostics.Advanced_Options, description: Diagnostics.Do_not_erase_const_enum_declarations_in_generated_code }, + { + name: "declarationDir", + type: "string", + isFilePath: true, + paramType: Diagnostics.DIRECTORY, + category: Diagnostics.Advanced_Options, + description: Diagnostics.Output_directory_for_generated_declaration_files + }, + { + name: "skipLibCheck", + type: "boolean", + category: Diagnostics.Advanced_Options, + description: Diagnostics.Skip_type_checking_of_declaration_files, + }, + { + name: "allowUnusedLabels", + type: "boolean", + category: Diagnostics.Advanced_Options, + description: Diagnostics.Do_not_report_errors_on_unused_labels + }, + { + name: "allowUnreachableCode", + type: "boolean", + category: Diagnostics.Advanced_Options, + description: Diagnostics.Do_not_report_errors_on_unreachable_code + }, + { + name: "suppressExcessPropertyErrors", + type: "boolean", + category: Diagnostics.Advanced_Options, + description: Diagnostics.Suppress_excess_property_checks_for_object_literals, + }, + { + name: "suppressImplicitAnyIndexErrors", + type: "boolean", + category: Diagnostics.Advanced_Options, + description: Diagnostics.Suppress_noImplicitAny_errors_for_indexing_objects_lacking_index_signatures, + }, + { + name: "forceConsistentCasingInFileNames", + type: "boolean", + category: Diagnostics.Advanced_Options, + description: Diagnostics.Disallow_inconsistently_cased_references_to_the_same_file + }, + { + name: "maxNodeModuleJsDepth", + type: "number", + category: Diagnostics.Advanced_Options, + description: Diagnostics.The_maximum_dependency_depth_to_search_under_node_modules_and_load_JavaScript_files + }, ]; /* @internal */ From abae1bd13680e1fd13deb2f827563770181d071b Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Mon, 13 Feb 2017 22:13:48 -0800 Subject: [PATCH 11/24] Accept baseline recursivelly --- Jakefile.js | 36 +++++++++++++++++++++++------------- 1 file changed, 23 insertions(+), 13 deletions(-) diff --git a/Jakefile.js b/Jakefile.js index f422a99572..89e693fe19 100644 --- a/Jakefile.js +++ b/Jakefile.js @@ -966,21 +966,31 @@ task("baseline-accept", function () { function acceptBaseline(sourceFolder, targetFolder) { console.log('Accept baselines from ' + sourceFolder + ' to ' + targetFolder); - var files = fs.readdirSync(sourceFolder); var deleteEnding = '.delete'; - for (var i in files) { - var filename = files[i]; - var fullLocalPath = path.join(sourceFolder, filename); - if (fs.statSync(fullLocalPath).isFile()) { - if (filename.substr(filename.length - deleteEnding.length) === deleteEnding) { - filename = filename.substr(0, filename.length - deleteEnding.length); - fs.unlinkSync(path.join(targetFolder, filename)); - } else { - var target = path.join(targetFolder, filename); - if (fs.existsSync(target)) { - fs.unlinkSync(target); + + acceptBaselineFolder(sourceFolder, targetFolder); + + function acceptBaselineFolder(sourceFolder, targetFolder) { + var files = fs.readdirSync(sourceFolder); + + for (var i in files) { + var filename = files[i]; + var fullLocalPath = path.join(sourceFolder, filename); + var stat = fs.statSync(fullLocalPath); + if (stat.isFile()) { + if (filename.substr(filename.length - deleteEnding.length) === deleteEnding) { + filename = filename.substr(0, filename.length - deleteEnding.length); + fs.unlinkSync(path.join(targetFolder, filename)); + } else { + var target = path.join(targetFolder, filename); + if (fs.existsSync(target)) { + fs.unlinkSync(target); + } + fs.renameSync(path.join(sourceFolder, filename), target); } - fs.renameSync(path.join(sourceFolder, filename), target); + } + else if (stat.isDirectory()) { + acceptBaselineFolder(fullLocalPath, path.join(targetFolder, filename)); } } } From 66135309354f018550b515321ed5dce3cc85e8cb Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Mon, 13 Feb 2017 22:14:05 -0800 Subject: [PATCH 12/24] Accept baselines --- src/harness/unittests/initializeTSConfig.ts | 2 +- .../tsconfig.json | 130 ++++++++++++++++- .../tsconfig.json | 129 ++++++++++++++++- .../tsconfig.json | 129 ++++++++++++++++- .../tsconfig.json | 130 ++++++++++++++++- .../tsconfig.json | 134 ++++++++++++++++-- .../tsconfig.json | 130 ++++++++++++++++- .../tsconfig.json | 134 ++++++++++++++++-- .../tsconfig.json | 134 ++++++++++++++++-- 9 files changed, 1007 insertions(+), 45 deletions(-) diff --git a/src/harness/unittests/initializeTSConfig.ts b/src/harness/unittests/initializeTSConfig.ts index cb995212a9..b71396411e 100644 --- a/src/harness/unittests/initializeTSConfig.ts +++ b/src/harness/unittests/initializeTSConfig.ts @@ -12,7 +12,7 @@ namespace ts { it(`Correct output for ${outputFileName}`, () => { Harness.Baseline.runBaseline(outputFileName, () => { if (initResult) { - return JSON.stringify(initResult, undefined, 4); + return initResult; } else { // This can happen if compiler recieve invalid compiler-options diff --git a/tests/baselines/reference/tsConfig/Default initialized TSConfig/tsconfig.json b/tests/baselines/reference/tsConfig/Default initialized TSConfig/tsconfig.json index ea891967cb..9234ce6ad8 100644 --- a/tests/baselines/reference/tsConfig/Default initialized TSConfig/tsconfig.json +++ b/tests/baselines/reference/tsConfig/Default initialized TSConfig/tsconfig.json @@ -1,8 +1,130 @@ { "compilerOptions": { - "module": "commonjs", + // Basic Options + + // Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', or 'ESNEXT' "target": "es5", - "noImplicitAny": false, - "sourceMap": false + + // Specify module code generation: 'commonjs', 'amd', 'system', 'umd' or 'es2015' + "module": "commonjs" + + // Specify library files to be included in the compilation: + // "lib": [], + + // Allow javascript files to be compiled. + // "allowJs": true, + + // Specify JSX code generation: 'preserve', 'react-native', or 'react' + // "jsx": "preserve", + + // Generates corresponding '.d.ts' file. + // "declaration": true, + + // Generates corresponding '.map' file. + // "sourceMap": true, + + // Concatenate and emit output to single file. + // "outFile": "./", + + // Redirect output structure to the directory. + // "outDir": "./", + + // Specify the root directory of input files. Use to control the output directory structure with --outDir. + // "rootDir": "./", + + // Do not emit comments to output. + // "removeComments": true, + + // Do not emit outputs. + // "noEmit": true, + + // Import emit helpers from 'tslib'. + // "importHelpers": true, + + // Unconditionally emit imports for unresolved files. + // "isolatedModules": true, + + + // Strict Checks + + // Raise error on expressions and declarations with an implied 'any' type. + // "noImplicitAny": true, + + // Enable strict null checks. + // "strictNullChecks": true, + + // Raise error on 'this' expressions with an implied 'any' type. + // "noImplicitThis": true, + + // Report errors on unused locals. + // "noUnusedLocals": true, + + // Report errors on unused parameters. + // "noUnusedParameters": true, + + // Parse in strict mode and emit "use strict" for each source file + // "alwaysStrict": true, + + // Report error when not all code paths in function return a value. + // "noImplicitReturns": true, + + // Report errors for fallthrough cases in switch statement. + // "noFallthroughCasesInSwitch": true, + + + // Module Resolution Options + + // Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). + // "moduleResolution": "node", + + // Base directory to resolve non-absolute module names. + // "baseUrl": "./", + + // List of path mapping entries for module names to locations relative to the 'baseUrl'. + // "paths": {}, + + // List of root folders whose combined content represent the structure of the project at runtime. + // "rootDirs": [], + + // List of folders to include type definitions from. + // "typeRoots": [], + + // Type declaration files to be included in compilation. + // "types": [], + + // Allow default imports from modules with no default export. This does not affect code emit, just typechecking. + // "allowSyntheticDefaultImports": true, + + + // SourceMap Options + + // Specify the location where debugger should locate TypeScript files instead of source locations. + // "sourceRoot": "./", + + // Specify the location where debugger should locate map files instead of generated locations. + // "mapRoot": "./", + + // Emit a single file with source maps instead of having a separate file. + // "inlineSourceMap": true, + + // Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. + // "inlineSources": true, + + + // JSX Options + + // Specify the JSX factory function to use when targeting 'react' JSX emit, e.g. 'React.createElement' or 'h'. + // "jsxFactory": "", + + + // Experimental Options + + // Enables experimental support for ES7 decorators. + // "experimentalDecorators": true, + + // Enables experimental support for emitting type metadata for decorators. + // "emitDecoratorMetadata": true, + + } -} \ No newline at end of file +} diff --git a/tests/baselines/reference/tsConfig/Initialized TSConfig with boolean value compiler options/tsconfig.json b/tests/baselines/reference/tsConfig/Initialized TSConfig with boolean value compiler options/tsconfig.json index abe135b4f1..7481eb6e86 100644 --- a/tests/baselines/reference/tsConfig/Initialized TSConfig with boolean value compiler options/tsconfig.json +++ b/tests/baselines/reference/tsConfig/Initialized TSConfig with boolean value compiler options/tsconfig.json @@ -1,9 +1,130 @@ { "compilerOptions": { - "module": "commonjs", + // Basic Options + + // Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', or 'ESNEXT' "target": "es5", - "noImplicitAny": false, - "sourceMap": false, + + // Specify module code generation: 'commonjs', 'amd', 'system', 'umd' or 'es2015' + "module": "commonjs", + + // Specify library files to be included in the compilation: + // "lib": [], + + // Allow javascript files to be compiled. + // "allowJs": true, + + // Specify JSX code generation: 'preserve', 'react-native', or 'react' + // "jsx": "preserve", + + // Generates corresponding '.d.ts' file. + // "declaration": true, + + // Generates corresponding '.map' file. + // "sourceMap": true, + + // Concatenate and emit output to single file. + // "outFile": "./", + + // Redirect output structure to the directory. + // "outDir": "./", + + // Specify the root directory of input files. Use to control the output directory structure with --outDir. + // "rootDir": "./", + + // Do not emit comments to output. + // "removeComments": true, + + // Do not emit outputs. + // "noEmit": true, + + // Import emit helpers from 'tslib'. + // "importHelpers": true, + + // Unconditionally emit imports for unresolved files. + // "isolatedModules": true, + + + // Strict Checks + + // Raise error on expressions and declarations with an implied 'any' type. + // "noImplicitAny": true, + + // Enable strict null checks. + // "strictNullChecks": true, + + // Raise error on 'this' expressions with an implied 'any' type. + // "noImplicitThis": true, + + // Report errors on unused locals. "noUnusedLocals": true + + // Report errors on unused parameters. + // "noUnusedParameters": true, + + // Parse in strict mode and emit "use strict" for each source file + // "alwaysStrict": true, + + // Report error when not all code paths in function return a value. + // "noImplicitReturns": true, + + // Report errors for fallthrough cases in switch statement. + // "noFallthroughCasesInSwitch": true, + + + // Module Resolution Options + + // Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). + // "moduleResolution": "node", + + // Base directory to resolve non-absolute module names. + // "baseUrl": "./", + + // List of path mapping entries for module names to locations relative to the 'baseUrl'. + // "paths": {}, + + // List of root folders whose combined content represent the structure of the project at runtime. + // "rootDirs": [], + + // List of folders to include type definitions from. + // "typeRoots": [], + + // Type declaration files to be included in compilation. + // "types": [], + + // Allow default imports from modules with no default export. This does not affect code emit, just typechecking. + // "allowSyntheticDefaultImports": true, + + + // SourceMap Options + + // Specify the location where debugger should locate TypeScript files instead of source locations. + // "sourceRoot": "./", + + // Specify the location where debugger should locate map files instead of generated locations. + // "mapRoot": "./", + + // Emit a single file with source maps instead of having a separate file. + // "inlineSourceMap": true, + + // Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. + // "inlineSources": true, + + + // JSX Options + + // Specify the JSX factory function to use when targeting 'react' JSX emit, e.g. 'React.createElement' or 'h'. + // "jsxFactory": "", + + + // Experimental Options + + // Enables experimental support for ES7 decorators. + // "experimentalDecorators": true, + + // Enables experimental support for emitting type metadata for decorators. + // "emitDecoratorMetadata": true, + + } -} \ No newline at end of file +} diff --git a/tests/baselines/reference/tsConfig/Initialized TSConfig with enum value compiler options/tsconfig.json b/tests/baselines/reference/tsConfig/Initialized TSConfig with enum value compiler options/tsconfig.json index e28b66c8c2..37ddc8169b 100644 --- a/tests/baselines/reference/tsConfig/Initialized TSConfig with enum value compiler options/tsconfig.json +++ b/tests/baselines/reference/tsConfig/Initialized TSConfig with enum value compiler options/tsconfig.json @@ -1,9 +1,130 @@ { "compilerOptions": { - "module": "commonjs", + // Basic Options + + // Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', or 'ESNEXT' "target": "es5", - "noImplicitAny": false, - "sourceMap": false, + + // Specify module code generation: 'commonjs', 'amd', 'system', 'umd' or 'es2015' + "module": "commonjs", + + // Specify library files to be included in the compilation: + // "lib": [], + + // Allow javascript files to be compiled. + // "allowJs": true, + + // Specify JSX code generation: 'preserve', 'react-native', or 'react' "jsx": "react" + + // Generates corresponding '.d.ts' file. + // "declaration": true, + + // Generates corresponding '.map' file. + // "sourceMap": true, + + // Concatenate and emit output to single file. + // "outFile": "./", + + // Redirect output structure to the directory. + // "outDir": "./", + + // Specify the root directory of input files. Use to control the output directory structure with --outDir. + // "rootDir": "./", + + // Do not emit comments to output. + // "removeComments": true, + + // Do not emit outputs. + // "noEmit": true, + + // Import emit helpers from 'tslib'. + // "importHelpers": true, + + // Unconditionally emit imports for unresolved files. + // "isolatedModules": true, + + + // Strict Checks + + // Raise error on expressions and declarations with an implied 'any' type. + // "noImplicitAny": true, + + // Enable strict null checks. + // "strictNullChecks": true, + + // Raise error on 'this' expressions with an implied 'any' type. + // "noImplicitThis": true, + + // Report errors on unused locals. + // "noUnusedLocals": true, + + // Report errors on unused parameters. + // "noUnusedParameters": true, + + // Parse in strict mode and emit "use strict" for each source file + // "alwaysStrict": true, + + // Report error when not all code paths in function return a value. + // "noImplicitReturns": true, + + // Report errors for fallthrough cases in switch statement. + // "noFallthroughCasesInSwitch": true, + + + // Module Resolution Options + + // Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). + // "moduleResolution": "node", + + // Base directory to resolve non-absolute module names. + // "baseUrl": "./", + + // List of path mapping entries for module names to locations relative to the 'baseUrl'. + // "paths": {}, + + // List of root folders whose combined content represent the structure of the project at runtime. + // "rootDirs": [], + + // List of folders to include type definitions from. + // "typeRoots": [], + + // Type declaration files to be included in compilation. + // "types": [], + + // Allow default imports from modules with no default export. This does not affect code emit, just typechecking. + // "allowSyntheticDefaultImports": true, + + + // SourceMap Options + + // Specify the location where debugger should locate TypeScript files instead of source locations. + // "sourceRoot": "./", + + // Specify the location where debugger should locate map files instead of generated locations. + // "mapRoot": "./", + + // Emit a single file with source maps instead of having a separate file. + // "inlineSourceMap": true, + + // Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. + // "inlineSources": true, + + + // JSX Options + + // Specify the JSX factory function to use when targeting 'react' JSX emit, e.g. 'React.createElement' or 'h'. + // "jsxFactory": "", + + + // Experimental Options + + // Enables experimental support for ES7 decorators. + // "experimentalDecorators": true, + + // Enables experimental support for emitting type metadata for decorators. + // "emitDecoratorMetadata": true, + + } -} \ No newline at end of file +} diff --git a/tests/baselines/reference/tsConfig/Initialized TSConfig with files options/tsconfig.json b/tests/baselines/reference/tsConfig/Initialized TSConfig with files options/tsconfig.json index 5273b3cb7c..24fb7b4431 100644 --- a/tests/baselines/reference/tsConfig/Initialized TSConfig with files options/tsconfig.json +++ b/tests/baselines/reference/tsConfig/Initialized TSConfig with files options/tsconfig.json @@ -1,13 +1,135 @@ { "compilerOptions": { - "module": "commonjs", + // Basic Options + + // Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', or 'ESNEXT' "target": "es5", - "noImplicitAny": false, - "sourceMap": false + + // Specify module code generation: 'commonjs', 'amd', 'system', 'umd' or 'es2015' + "module": "commonjs" + + // Specify library files to be included in the compilation: + // "lib": [], + + // Allow javascript files to be compiled. + // "allowJs": true, + + // Specify JSX code generation: 'preserve', 'react-native', or 'react' + // "jsx": "preserve", + + // Generates corresponding '.d.ts' file. + // "declaration": true, + + // Generates corresponding '.map' file. + // "sourceMap": true, + + // Concatenate and emit output to single file. + // "outFile": "./", + + // Redirect output structure to the directory. + // "outDir": "./", + + // Specify the root directory of input files. Use to control the output directory structure with --outDir. + // "rootDir": "./", + + // Do not emit comments to output. + // "removeComments": true, + + // Do not emit outputs. + // "noEmit": true, + + // Import emit helpers from 'tslib'. + // "importHelpers": true, + + // Unconditionally emit imports for unresolved files. + // "isolatedModules": true, + + + // Strict Checks + + // Raise error on expressions and declarations with an implied 'any' type. + // "noImplicitAny": true, + + // Enable strict null checks. + // "strictNullChecks": true, + + // Raise error on 'this' expressions with an implied 'any' type. + // "noImplicitThis": true, + + // Report errors on unused locals. + // "noUnusedLocals": true, + + // Report errors on unused parameters. + // "noUnusedParameters": true, + + // Parse in strict mode and emit "use strict" for each source file + // "alwaysStrict": true, + + // Report error when not all code paths in function return a value. + // "noImplicitReturns": true, + + // Report errors for fallthrough cases in switch statement. + // "noFallthroughCasesInSwitch": true, + + + // Module Resolution Options + + // Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). + // "moduleResolution": "node", + + // Base directory to resolve non-absolute module names. + // "baseUrl": "./", + + // List of path mapping entries for module names to locations relative to the 'baseUrl'. + // "paths": {}, + + // List of root folders whose combined content represent the structure of the project at runtime. + // "rootDirs": [], + + // List of folders to include type definitions from. + // "typeRoots": [], + + // Type declaration files to be included in compilation. + // "types": [], + + // Allow default imports from modules with no default export. This does not affect code emit, just typechecking. + // "allowSyntheticDefaultImports": true, + + + // SourceMap Options + + // Specify the location where debugger should locate TypeScript files instead of source locations. + // "sourceRoot": "./", + + // Specify the location where debugger should locate map files instead of generated locations. + // "mapRoot": "./", + + // Emit a single file with source maps instead of having a separate file. + // "inlineSourceMap": true, + + // Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. + // "inlineSources": true, + + + // JSX Options + + // Specify the JSX factory function to use when targeting 'react' JSX emit, e.g. 'React.createElement' or 'h'. + // "jsxFactory": "", + + + // Experimental Options + + // Enables experimental support for ES7 decorators. + // "experimentalDecorators": true, + + // Enables experimental support for emitting type metadata for decorators. + // "emitDecoratorMetadata": true, + + }, "files": [ "file0.st", "file1.ts", "file2.ts" ] -} \ No newline at end of file +} diff --git a/tests/baselines/reference/tsConfig/Initialized TSConfig with incorrect compiler option value/tsconfig.json b/tests/baselines/reference/tsConfig/Initialized TSConfig with incorrect compiler option value/tsconfig.json index fa9cb6cad8..0621c2991e 100644 --- a/tests/baselines/reference/tsConfig/Initialized TSConfig with incorrect compiler option value/tsconfig.json +++ b/tests/baselines/reference/tsConfig/Initialized TSConfig with incorrect compiler option value/tsconfig.json @@ -1,12 +1,130 @@ { "compilerOptions": { - "module": "commonjs", + // Basic Options + + // Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', or 'ESNEXT' "target": "es5", - "noImplicitAny": false, - "sourceMap": false, - "lib": [ - "es5", - "es2015.promise" - ] + + // Specify module code generation: 'commonjs', 'amd', 'system', 'umd' or 'es2015' + "module": "commonjs", + + // Specify library files to be included in the compilation: + "lib": ["es5","es2015.promise"] + + // Allow javascript files to be compiled. + // "allowJs": true, + + // Specify JSX code generation: 'preserve', 'react-native', or 'react' + // "jsx": "preserve", + + // Generates corresponding '.d.ts' file. + // "declaration": true, + + // Generates corresponding '.map' file. + // "sourceMap": true, + + // Concatenate and emit output to single file. + // "outFile": "./", + + // Redirect output structure to the directory. + // "outDir": "./", + + // Specify the root directory of input files. Use to control the output directory structure with --outDir. + // "rootDir": "./", + + // Do not emit comments to output. + // "removeComments": true, + + // Do not emit outputs. + // "noEmit": true, + + // Import emit helpers from 'tslib'. + // "importHelpers": true, + + // Unconditionally emit imports for unresolved files. + // "isolatedModules": true, + + + // Strict Checks + + // Raise error on expressions and declarations with an implied 'any' type. + // "noImplicitAny": true, + + // Enable strict null checks. + // "strictNullChecks": true, + + // Raise error on 'this' expressions with an implied 'any' type. + // "noImplicitThis": true, + + // Report errors on unused locals. + // "noUnusedLocals": true, + + // Report errors on unused parameters. + // "noUnusedParameters": true, + + // Parse in strict mode and emit "use strict" for each source file + // "alwaysStrict": true, + + // Report error when not all code paths in function return a value. + // "noImplicitReturns": true, + + // Report errors for fallthrough cases in switch statement. + // "noFallthroughCasesInSwitch": true, + + + // Module Resolution Options + + // Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). + // "moduleResolution": "node", + + // Base directory to resolve non-absolute module names. + // "baseUrl": "./", + + // List of path mapping entries for module names to locations relative to the 'baseUrl'. + // "paths": {}, + + // List of root folders whose combined content represent the structure of the project at runtime. + // "rootDirs": [], + + // List of folders to include type definitions from. + // "typeRoots": [], + + // Type declaration files to be included in compilation. + // "types": [], + + // Allow default imports from modules with no default export. This does not affect code emit, just typechecking. + // "allowSyntheticDefaultImports": true, + + + // SourceMap Options + + // Specify the location where debugger should locate TypeScript files instead of source locations. + // "sourceRoot": "./", + + // Specify the location where debugger should locate map files instead of generated locations. + // "mapRoot": "./", + + // Emit a single file with source maps instead of having a separate file. + // "inlineSourceMap": true, + + // Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. + // "inlineSources": true, + + + // JSX Options + + // Specify the JSX factory function to use when targeting 'react' JSX emit, e.g. 'React.createElement' or 'h'. + // "jsxFactory": "", + + + // Experimental Options + + // Enables experimental support for ES7 decorators. + // "experimentalDecorators": true, + + // Enables experimental support for emitting type metadata for decorators. + // "emitDecoratorMetadata": true, + + } -} \ No newline at end of file +} diff --git a/tests/baselines/reference/tsConfig/Initialized TSConfig with incorrect compiler option/tsconfig.json b/tests/baselines/reference/tsConfig/Initialized TSConfig with incorrect compiler option/tsconfig.json index ea891967cb..9234ce6ad8 100644 --- a/tests/baselines/reference/tsConfig/Initialized TSConfig with incorrect compiler option/tsconfig.json +++ b/tests/baselines/reference/tsConfig/Initialized TSConfig with incorrect compiler option/tsconfig.json @@ -1,8 +1,130 @@ { "compilerOptions": { - "module": "commonjs", + // Basic Options + + // Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', or 'ESNEXT' "target": "es5", - "noImplicitAny": false, - "sourceMap": false + + // Specify module code generation: 'commonjs', 'amd', 'system', 'umd' or 'es2015' + "module": "commonjs" + + // Specify library files to be included in the compilation: + // "lib": [], + + // Allow javascript files to be compiled. + // "allowJs": true, + + // Specify JSX code generation: 'preserve', 'react-native', or 'react' + // "jsx": "preserve", + + // Generates corresponding '.d.ts' file. + // "declaration": true, + + // Generates corresponding '.map' file. + // "sourceMap": true, + + // Concatenate and emit output to single file. + // "outFile": "./", + + // Redirect output structure to the directory. + // "outDir": "./", + + // Specify the root directory of input files. Use to control the output directory structure with --outDir. + // "rootDir": "./", + + // Do not emit comments to output. + // "removeComments": true, + + // Do not emit outputs. + // "noEmit": true, + + // Import emit helpers from 'tslib'. + // "importHelpers": true, + + // Unconditionally emit imports for unresolved files. + // "isolatedModules": true, + + + // Strict Checks + + // Raise error on expressions and declarations with an implied 'any' type. + // "noImplicitAny": true, + + // Enable strict null checks. + // "strictNullChecks": true, + + // Raise error on 'this' expressions with an implied 'any' type. + // "noImplicitThis": true, + + // Report errors on unused locals. + // "noUnusedLocals": true, + + // Report errors on unused parameters. + // "noUnusedParameters": true, + + // Parse in strict mode and emit "use strict" for each source file + // "alwaysStrict": true, + + // Report error when not all code paths in function return a value. + // "noImplicitReturns": true, + + // Report errors for fallthrough cases in switch statement. + // "noFallthroughCasesInSwitch": true, + + + // Module Resolution Options + + // Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). + // "moduleResolution": "node", + + // Base directory to resolve non-absolute module names. + // "baseUrl": "./", + + // List of path mapping entries for module names to locations relative to the 'baseUrl'. + // "paths": {}, + + // List of root folders whose combined content represent the structure of the project at runtime. + // "rootDirs": [], + + // List of folders to include type definitions from. + // "typeRoots": [], + + // Type declaration files to be included in compilation. + // "types": [], + + // Allow default imports from modules with no default export. This does not affect code emit, just typechecking. + // "allowSyntheticDefaultImports": true, + + + // SourceMap Options + + // Specify the location where debugger should locate TypeScript files instead of source locations. + // "sourceRoot": "./", + + // Specify the location where debugger should locate map files instead of generated locations. + // "mapRoot": "./", + + // Emit a single file with source maps instead of having a separate file. + // "inlineSourceMap": true, + + // Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. + // "inlineSources": true, + + + // JSX Options + + // Specify the JSX factory function to use when targeting 'react' JSX emit, e.g. 'React.createElement' or 'h'. + // "jsxFactory": "", + + + // Experimental Options + + // Enables experimental support for ES7 decorators. + // "experimentalDecorators": true, + + // Enables experimental support for emitting type metadata for decorators. + // "emitDecoratorMetadata": true, + + } -} \ No newline at end of file +} diff --git a/tests/baselines/reference/tsConfig/Initialized TSConfig with list compiler options with enum value/tsconfig.json b/tests/baselines/reference/tsConfig/Initialized TSConfig with list compiler options with enum value/tsconfig.json index 3ff8208d9d..499c3d57de 100644 --- a/tests/baselines/reference/tsConfig/Initialized TSConfig with list compiler options with enum value/tsconfig.json +++ b/tests/baselines/reference/tsConfig/Initialized TSConfig with list compiler options with enum value/tsconfig.json @@ -1,12 +1,130 @@ { "compilerOptions": { - "module": "commonjs", + // Basic Options + + // Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', or 'ESNEXT' "target": "es5", - "noImplicitAny": false, - "sourceMap": false, - "lib": [ - "es5", - "es2015.core" - ] + + // Specify module code generation: 'commonjs', 'amd', 'system', 'umd' or 'es2015' + "module": "commonjs", + + // Specify library files to be included in the compilation: + "lib": ["es5","es2015.core"] + + // Allow javascript files to be compiled. + // "allowJs": true, + + // Specify JSX code generation: 'preserve', 'react-native', or 'react' + // "jsx": "preserve", + + // Generates corresponding '.d.ts' file. + // "declaration": true, + + // Generates corresponding '.map' file. + // "sourceMap": true, + + // Concatenate and emit output to single file. + // "outFile": "./", + + // Redirect output structure to the directory. + // "outDir": "./", + + // Specify the root directory of input files. Use to control the output directory structure with --outDir. + // "rootDir": "./", + + // Do not emit comments to output. + // "removeComments": true, + + // Do not emit outputs. + // "noEmit": true, + + // Import emit helpers from 'tslib'. + // "importHelpers": true, + + // Unconditionally emit imports for unresolved files. + // "isolatedModules": true, + + + // Strict Checks + + // Raise error on expressions and declarations with an implied 'any' type. + // "noImplicitAny": true, + + // Enable strict null checks. + // "strictNullChecks": true, + + // Raise error on 'this' expressions with an implied 'any' type. + // "noImplicitThis": true, + + // Report errors on unused locals. + // "noUnusedLocals": true, + + // Report errors on unused parameters. + // "noUnusedParameters": true, + + // Parse in strict mode and emit "use strict" for each source file + // "alwaysStrict": true, + + // Report error when not all code paths in function return a value. + // "noImplicitReturns": true, + + // Report errors for fallthrough cases in switch statement. + // "noFallthroughCasesInSwitch": true, + + + // Module Resolution Options + + // Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). + // "moduleResolution": "node", + + // Base directory to resolve non-absolute module names. + // "baseUrl": "./", + + // List of path mapping entries for module names to locations relative to the 'baseUrl'. + // "paths": {}, + + // List of root folders whose combined content represent the structure of the project at runtime. + // "rootDirs": [], + + // List of folders to include type definitions from. + // "typeRoots": [], + + // Type declaration files to be included in compilation. + // "types": [], + + // Allow default imports from modules with no default export. This does not affect code emit, just typechecking. + // "allowSyntheticDefaultImports": true, + + + // SourceMap Options + + // Specify the location where debugger should locate TypeScript files instead of source locations. + // "sourceRoot": "./", + + // Specify the location where debugger should locate map files instead of generated locations. + // "mapRoot": "./", + + // Emit a single file with source maps instead of having a separate file. + // "inlineSourceMap": true, + + // Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. + // "inlineSources": true, + + + // JSX Options + + // Specify the JSX factory function to use when targeting 'react' JSX emit, e.g. 'React.createElement' or 'h'. + // "jsxFactory": "", + + + // Experimental Options + + // Enables experimental support for ES7 decorators. + // "experimentalDecorators": true, + + // Enables experimental support for emitting type metadata for decorators. + // "emitDecoratorMetadata": true, + + } -} \ No newline at end of file +} diff --git a/tests/baselines/reference/tsConfig/Initialized TSConfig with list compiler options/tsconfig.json b/tests/baselines/reference/tsConfig/Initialized TSConfig with list compiler options/tsconfig.json index b1740ac4c1..7eebba70ab 100644 --- a/tests/baselines/reference/tsConfig/Initialized TSConfig with list compiler options/tsconfig.json +++ b/tests/baselines/reference/tsConfig/Initialized TSConfig with list compiler options/tsconfig.json @@ -1,12 +1,130 @@ { "compilerOptions": { - "module": "commonjs", + // Basic Options + + // Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', or 'ESNEXT' "target": "es5", - "noImplicitAny": false, - "sourceMap": false, - "types": [ - "jquery", - "mocha" - ] + + // Specify module code generation: 'commonjs', 'amd', 'system', 'umd' or 'es2015' + "module": "commonjs", + + // Specify library files to be included in the compilation: + // "lib": [], + + // Allow javascript files to be compiled. + // "allowJs": true, + + // Specify JSX code generation: 'preserve', 'react-native', or 'react' + // "jsx": "preserve", + + // Generates corresponding '.d.ts' file. + // "declaration": true, + + // Generates corresponding '.map' file. + // "sourceMap": true, + + // Concatenate and emit output to single file. + // "outFile": "./", + + // Redirect output structure to the directory. + // "outDir": "./", + + // Specify the root directory of input files. Use to control the output directory structure with --outDir. + // "rootDir": "./", + + // Do not emit comments to output. + // "removeComments": true, + + // Do not emit outputs. + // "noEmit": true, + + // Import emit helpers from 'tslib'. + // "importHelpers": true, + + // Unconditionally emit imports for unresolved files. + // "isolatedModules": true, + + + // Strict Checks + + // Raise error on expressions and declarations with an implied 'any' type. + // "noImplicitAny": true, + + // Enable strict null checks. + // "strictNullChecks": true, + + // Raise error on 'this' expressions with an implied 'any' type. + // "noImplicitThis": true, + + // Report errors on unused locals. + // "noUnusedLocals": true, + + // Report errors on unused parameters. + // "noUnusedParameters": true, + + // Parse in strict mode and emit "use strict" for each source file + // "alwaysStrict": true, + + // Report error when not all code paths in function return a value. + // "noImplicitReturns": true, + + // Report errors for fallthrough cases in switch statement. + // "noFallthroughCasesInSwitch": true, + + + // Module Resolution Options + + // Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). + // "moduleResolution": "node", + + // Base directory to resolve non-absolute module names. + // "baseUrl": "./", + + // List of path mapping entries for module names to locations relative to the 'baseUrl'. + // "paths": {}, + + // List of root folders whose combined content represent the structure of the project at runtime. + // "rootDirs": [], + + // List of folders to include type definitions from. + // "typeRoots": [], + + // Type declaration files to be included in compilation. + "types": ["jquery","mocha"] + + // Allow default imports from modules with no default export. This does not affect code emit, just typechecking. + // "allowSyntheticDefaultImports": true, + + + // SourceMap Options + + // Specify the location where debugger should locate TypeScript files instead of source locations. + // "sourceRoot": "./", + + // Specify the location where debugger should locate map files instead of generated locations. + // "mapRoot": "./", + + // Emit a single file with source maps instead of having a separate file. + // "inlineSourceMap": true, + + // Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. + // "inlineSources": true, + + + // JSX Options + + // Specify the JSX factory function to use when targeting 'react' JSX emit, e.g. 'React.createElement' or 'h'. + // "jsxFactory": "", + + + // Experimental Options + + // Enables experimental support for ES7 decorators. + // "experimentalDecorators": true, + + // Enables experimental support for emitting type metadata for decorators. + // "emitDecoratorMetadata": true, + + } -} \ No newline at end of file +} From 2752bfb704a576108b6601b38738dd37ba7f2f62 Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Mon, 13 Feb 2017 22:21:34 -0800 Subject: [PATCH 13/24] Fix lint failures --- src/compiler/commandLineParser.ts | 12 ++++++------ src/compiler/types.ts | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts index 7b32a23a7d..c10045fce3 100644 --- a/src/compiler/commandLineParser.ts +++ b/src/compiler/commandLineParser.ts @@ -387,7 +387,7 @@ namespace ts { name: "inlineSources", type: "boolean", category: Diagnostics.SourceMap_Options, - description:Diagnostics.Emit_the_source_alongside_the_sourcemaps_within_a_single_file_requires_inlineSourceMap_or_sourceMap_to_be_set + description: Diagnostics.Emit_the_source_alongside_the_sourcemaps_within_a_single_file_requires_inlineSourceMap_or_sourceMap_to_be_set }, // JSX @@ -477,7 +477,7 @@ namespace ts { name: "emitBOM", type: "boolean", category: Diagnostics.Advanced_Options, - description:Diagnostics.Emit_a_UTF_8_Byte_Order_Mark_BOM_in_the_beginning_of_output_files + description: Diagnostics.Emit_a_UTF_8_Byte_Order_Mark_BOM_in_the_beginning_of_output_files }, { name: "locale", @@ -511,7 +511,7 @@ namespace ts { name: "noResolve", type: "boolean", category: Diagnostics.Advanced_Options, - description:Diagnostics.Do_not_add_triple_slash_references_or_module_import_targets_to_the_list_of_compiled_files + description: Diagnostics.Do_not_add_triple_slash_references_or_module_import_targets_to_the_list_of_compiled_files }, { name: "stripInternal", @@ -979,8 +979,8 @@ namespace ts { result += `${newLine}`; for (const option of categorizedOptions[category]) { result += `${tab}${tab}// ${option.description && getLocaleSpecificMessage(option.description) || option.name}${newLine}`; - if (option.name in configurations.compilerOptions) { - result += `${tab}${tab}"${option.name}": ${JSON.stringify(configurations.compilerOptions[option.name])}${++seenKnownKeys === knownKesyCount ? "" : ","}${newLine}`; + if (configurations.compilerOptions[option.name]) { + result += `${tab}${tab}"${option.name}": ${JSON.stringify(configurations.compilerOptions[option.name])}${(seenKnownKeys += 1) === knownKesyCount ? "" : ","}${newLine}`; } else { result += `${tab}${tab}// "${option.name}": ${JSON.stringify(getDefaultValueForOption(option))},${newLine}`; @@ -1606,4 +1606,4 @@ namespace ts { function caseInsensitiveKeyMapper(key: string) { return key.toLowerCase(); } -} +} \ No newline at end of file diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 589c196d13..7dee8bca9c 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -3385,7 +3385,7 @@ paramType?: DiagnosticMessage; // The name to be used for a non-boolean option's parameter isTSConfigOnly?: boolean; // True if option can only be specified via tsconfig.json file isCommandLineOnly?: boolean; - showInSimplifiedHelpView?:boolean; + showInSimplifiedHelpView?: boolean; category?: DiagnosticMessage; } From f2654c65d958b5cf4a47bcde2c0de5b093ca78b8 Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Wed, 15 Mar 2017 15:40:01 -0700 Subject: [PATCH 14/24] Remove compileOnSave from compiler option --- src/compiler/commandLineParser.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts index b07bdcc9fe..724c580ace 100644 --- a/src/compiler/commandLineParser.ts +++ b/src/compiler/commandLineParser.ts @@ -479,14 +479,12 @@ namespace ts { category: Diagnostics.Advanced_Options, description: Diagnostics.Deprecated_Use_skipLibCheck_instead_Skip_type_checking_of_default_library_declaration_files }, - { name: "charset", type: "string", category: Diagnostics.Advanced_Options, description: Diagnostics.The_character_set_of_the_input_files }, - compileOnSaveCommandLineOption, { name: "emitBOM", type: "boolean", From efa3093eced433e7c58b93b0777440cdc468c4de Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Wed, 15 Mar 2017 16:08:32 -0700 Subject: [PATCH 15/24] Print comments in a diffrent column --- src/compiler/commandLineParser.ts | 62 ++++++++++++++++++++----------- 1 file changed, 41 insertions(+), 21 deletions(-) diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts index 724c580ace..f5cddf0e65 100644 --- a/src/compiler/commandLineParser.ts +++ b/src/compiler/commandLineParser.ts @@ -980,7 +980,12 @@ namespace ts { } } + function makePadding(paddingLength: number): string { + return Array(paddingLength + 1).join(" "); + } + function writeConfigurations() { + // Filter applicable options to place in the file const categorizedOptions = reduceLeft( filter(optionDeclarations, o => o.category !== Diagnostics.CommandLine_Options && o.category !== Diagnostics.Advanced_Options), (memo, value) => { @@ -990,44 +995,59 @@ namespace ts { } return memo; }, >{}); - const knownKesyCount = getOwnKeys(configurations.compilerOptions).length; - const newLine = "\n"; - const tab = " "; - - let result = ""; + // Serialize all options and thier descriptions + let marginLength = 0; let seenKnownKeys = 0; - result += `{${newLine}`; - result += `${tab}"compilerOptions": {${newLine}`; + const nameColumn: string[] = []; + const descriptionColumn: string[] = []; + const knownKesyCount = getOwnKeys(configurations.compilerOptions).length; for (const category in categorizedOptions) { - result += `${tab}${tab}// ${category}${newLine}`; - result += `${newLine}`; + if (nameColumn.length !== 0) { + nameColumn.push(""); + descriptionColumn.push(""); + } + nameColumn.push(`/* ${category} */`); + descriptionColumn.push(""); for (const option of categorizedOptions[category]) { - result += `${tab}${tab}// ${option.description && getLocaleSpecificMessage(option.description) || option.name}${newLine}`; + let optionName; if (configurations.compilerOptions[option.name]) { - result += `${tab}${tab}"${option.name}": ${JSON.stringify(configurations.compilerOptions[option.name])}${(seenKnownKeys += 1) === knownKesyCount ? "" : ","}${newLine}`; + optionName = `"${option.name}": ${JSON.stringify(configurations.compilerOptions[option.name])}${(seenKnownKeys += 1) === knownKesyCount ? "" : ","}`; } else { - result += `${tab}${tab}// "${option.name}": ${JSON.stringify(getDefaultValueForOption(option))},${newLine}`; + optionName = `// "${option.name}": ${JSON.stringify(getDefaultValueForOption(option))},`; } - result += `${newLine}`; + nameColumn.push(optionName); + descriptionColumn.push(`/* ${option.description && getLocaleSpecificMessage(option.description) || option.name} */`); + marginLength = Math.max(optionName.length, marginLength); } - result += `${newLine}`; + } + + // Write the output + const tab = makePadding(2); + const result: string[] = []; + result.push(`{`); + result.push(`${tab}"compilerOptions": {`); + // Print out each row, aligning all the descriptions on the same column. + for (let i = 0; i < nameColumn.length; i++) { + const optionName = nameColumn[i]; + const description = descriptionColumn[i]; + result.push(tab + tab + optionName + makePadding(marginLength - optionName.length + 2) + description); } if (configurations.files && configurations.files.length) { - result += `${tab}},${newLine}`; - result += `${tab}"files": [${newLine}`; + result.push(`${tab}},`); + result.push(`${tab}"files": [`); for (let i = 0; i < configurations.files.length; i++) { - result += `${tab}${tab}${JSON.stringify(configurations.files[i])}${i === configurations.files.length - 1 ? "" : ","}${newLine}`; + result.push(`${tab}${tab}${JSON.stringify(configurations.files[i])}${i === configurations.files.length - 1 ? "" : ","}`); } - result += `${tab}]${newLine}`; + result.push(`${tab}]`); } else { - result += `${tab}}${newLine}`; + result.push(`${tab}}`); } - result += `}${newLine}`; + result.push(`}`); - return result; + return result.join(sys.newLine); } } From 5bbd8f809a7765f231e1b5a0e4e3f653993a1c57 Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Wed, 15 Mar 2017 16:15:59 -0700 Subject: [PATCH 16/24] rename catogories, and reorder options --- src/compiler/commandLineParser.ts | 48 ++++++++++++++-------------- src/compiler/diagnosticMessages.json | 4 +-- 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts index f5cddf0e65..1e6a89d444 100644 --- a/src/compiler/commandLineParser.ts +++ b/src/compiler/commandLineParser.ts @@ -238,68 +238,70 @@ namespace ts { description: Diagnostics.Unconditionally_emit_imports_for_unresolved_files }, - // Strict Checks + // Strict Type Checks { name: "strict", type: "boolean", showInSimplifiedHelpView: true, - category: Diagnostics.Strict_Checks, + category: Diagnostics.Strict_Type_Checks, description: Diagnostics.Enable_all_strict_type_checks }, { name: "noImplicitAny", type: "boolean", showInSimplifiedHelpView: true, - category: Diagnostics.Strict_Checks, + category: Diagnostics.Strict_Type_Checks, description: Diagnostics.Raise_error_on_expressions_and_declarations_with_an_implied_any_type, }, { name: "strictNullChecks", type: "boolean", showInSimplifiedHelpView: true, - category: Diagnostics.Strict_Checks, + category: Diagnostics.Strict_Type_Checks, description: Diagnostics.Enable_strict_null_checks }, { name: "noImplicitThis", type: "boolean", showInSimplifiedHelpView: true, - category: Diagnostics.Strict_Checks, + category: Diagnostics.Strict_Type_Checks, description: Diagnostics.Raise_error_on_this_expressions_with_an_implied_any_type, }, + { + name: "alwaysStrict", + type: "boolean", + showInSimplifiedHelpView: true, + category: Diagnostics.Strict_Type_Checks, + description: Diagnostics.Parse_in_strict_mode_and_emit_use_strict_for_each_source_file + }, + + // Additional Checks { name: "noUnusedLocals", type: "boolean", showInSimplifiedHelpView: true, - category: Diagnostics.Strict_Checks, + category: Diagnostics.Additional_Checks, description: Diagnostics.Report_errors_on_unused_locals, }, { name: "noUnusedParameters", type: "boolean", showInSimplifiedHelpView: true, - category: Diagnostics.Strict_Checks, + category: Diagnostics.Additional_Checks, description: Diagnostics.Report_errors_on_unused_parameters, }, - { - name: "alwaysStrict", - type: "boolean", - showInSimplifiedHelpView: true, - category: Diagnostics.Strict_Checks, - description: Diagnostics.Parse_in_strict_mode_and_emit_use_strict_for_each_source_file - }, { name: "noImplicitReturns", type: "boolean", showInSimplifiedHelpView: true, - category: Diagnostics.Strict_Checks, + category: Diagnostics.Additional_Checks, description: Diagnostics.Report_error_when_not_all_code_paths_in_function_return_a_value }, { name: "noFallthroughCasesInSwitch", type: "boolean", showInSimplifiedHelpView: true, - category: Diagnostics.Strict_Checks, + category: Diagnostics.Additional_Checks, description: Diagnostics.Report_errors_for_fallthrough_cases_in_switch_statement }, @@ -404,14 +406,6 @@ namespace ts { description: Diagnostics.Emit_the_source_alongside_the_sourcemaps_within_a_single_file_requires_inlineSourceMap_or_sourceMap_to_be_set }, - // JSX - { - name: "jsxFactory", - type: "string", - category: Diagnostics.JSX_Options, - description: Diagnostics.Specify_the_JSX_factory_function_to_use_when_targeting_react_JSX_emit_e_g_React_createElement_or_h - }, - // Experimental { name: "experimentalDecorators", @@ -427,6 +421,12 @@ namespace ts { }, // Advanced + { + name: "jsxFactory", + type: "string", + category: Diagnostics.Advanced_Options, + description: Diagnostics.Specify_the_JSX_factory_function_to_use_when_targeting_react_JSX_emit_e_g_React_createElement_or_h + }, { name: "diagnostics", type: "boolean", diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 6546408fdc..e833d77651 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -3137,7 +3137,7 @@ "category": "Message", "code": 6172 }, - "Strict Checks": { + "Strict Type Checks": { "category": "Message", "code": 6173 }, @@ -3149,7 +3149,7 @@ "category": "Message", "code": 6175 }, - "JSX Options": { + "Additional Checks": { "category": "Message", "code": 6176 }, From 5016141b94b0578ad3e9f0395d4a1e5a7ba444b5 Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Wed, 15 Mar 2017 16:41:39 -0700 Subject: [PATCH 17/24] Remove `sourceMap:false` from default compiler optios now that we have all options generated --- src/compiler/commandLineParser.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts index 1e6a89d444..6c8c8bb1b2 100644 --- a/src/compiler/commandLineParser.ts +++ b/src/compiler/commandLineParser.ts @@ -665,8 +665,7 @@ namespace ts { export const defaultInitCompilerOptions: CompilerOptions = { module: ModuleKind.CommonJS, target: ScriptTarget.ES5, - strict: true, - sourceMap: false, + strict: true }; let optionNameMapCache: OptionNameMap; @@ -1011,7 +1010,7 @@ namespace ts { descriptionColumn.push(""); for (const option of categorizedOptions[category]) { let optionName; - if (configurations.compilerOptions[option.name]) { + if (hasProperty(configurations.compilerOptions, option.name)) { optionName = `"${option.name}": ${JSON.stringify(configurations.compilerOptions[option.name])}${(seenKnownKeys += 1) === knownKesyCount ? "" : ","}`; } else { From b6ccad4b54e362fff37e45d29fc75e4df52fb6d4 Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Wed, 15 Mar 2017 17:21:07 -0700 Subject: [PATCH 18/24] Fix bad merge --- src/compiler/commandLineParser.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts index 6c8c8bb1b2..bc9d090edd 100644 --- a/src/compiler/commandLineParser.ts +++ b/src/compiler/commandLineParser.ts @@ -119,6 +119,7 @@ namespace ts { "es7": "lib.es2016.d.ts", "es2016": "lib.es2016.d.ts", "es2017": "lib.es2017.d.ts", + "esnext": "lib.esnext.d.ts", // Host only "dom": "lib.dom.d.ts", "dom.iterable": "lib.dom.iterable.d.ts", From 0112a38ec9460dbcd51e77e2124f074d2090bfd3 Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Wed, 15 Mar 2017 17:21:28 -0700 Subject: [PATCH 19/24] Accept baselines --- .../tsconfig.json | 185 +++++------------ .../tsconfig.json | 185 +++++------------ .../tsconfig.json | 185 +++++------------ .../tsconfig.json | 195 +++++------------- .../tsconfig.json | 185 +++++------------ .../tsconfig.json | 185 +++++------------ .../tsconfig.json | 185 +++++------------ .../tsconfig.json | 185 +++++------------ 8 files changed, 421 insertions(+), 1069 deletions(-) diff --git a/tests/baselines/reference/tsConfig/Default initialized TSConfig/tsconfig.json b/tests/baselines/reference/tsConfig/Default initialized TSConfig/tsconfig.json index 452c031408..13e3bdb0f4 100644 --- a/tests/baselines/reference/tsConfig/Default initialized TSConfig/tsconfig.json +++ b/tests/baselines/reference/tsConfig/Default initialized TSConfig/tsconfig.json @@ -1,133 +1,52 @@ -{ - "compilerOptions": { - // Basic Options - - // Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', or 'ESNEXT'. - "target": "es5", - - // Specify module code generation: 'commonjs', 'amd', 'system', 'umd' or 'es2015'. - "module": "commonjs", - - // Specify library files to be included in the compilation: - // "lib": [], - - // Allow javascript files to be compiled. - // "allowJs": true, - - // Specify JSX code generation: 'preserve', 'react-native', or 'react'. - // "jsx": "preserve", - - // Generates corresponding '.d.ts' file. - // "declaration": true, - - // Generates corresponding '.map' file. - // "sourceMap": true, - - // Concatenate and emit output to single file. - // "outFile": "./", - - // Redirect output structure to the directory. - // "outDir": "./", - - // Specify the root directory of input files. Use to control the output directory structure with --outDir. - // "rootDir": "./", - - // Do not emit comments to output. - // "removeComments": true, - - // Do not emit outputs. - // "noEmit": true, - - // Import emit helpers from 'tslib'. - // "importHelpers": true, - - // Unconditionally emit imports for unresolved files. - // "isolatedModules": true, - - - // Strict Checks - - // Enable all strict type checks. - "strict": true, - - // Raise error on expressions and declarations with an implied 'any' type. - // "noImplicitAny": true, - - // Enable strict null checks. - // "strictNullChecks": true, - - // Raise error on 'this' expressions with an implied 'any' type. - // "noImplicitThis": true, - - // Report errors on unused locals. - // "noUnusedLocals": true, - - // Report errors on unused parameters. - // "noUnusedParameters": true, - - // Parse in strict mode and emit "use strict" for each source file. - // "alwaysStrict": true, - - // Report error when not all code paths in function return a value. - // "noImplicitReturns": true, - - // Report errors for fallthrough cases in switch statement. - // "noFallthroughCasesInSwitch": true, - - - // Module Resolution Options - - // Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). - // "moduleResolution": "node", - - // Base directory to resolve non-absolute module names. - // "baseUrl": "./", - - // List of path mapping entries for module names to locations relative to the 'baseUrl'. - // "paths": {}, - - // List of root folders whose combined content represent the structure of the project at runtime. - // "rootDirs": [], - - // List of folders to include type definitions from. - // "typeRoots": [], - - // Type declaration files to be included in compilation. - // "types": [], - - // Allow default imports from modules with no default export. This does not affect code emit, just typechecking. - // "allowSyntheticDefaultImports": true, - - - // SourceMap Options - - // Specify the location where debugger should locate TypeScript files instead of source locations. - // "sourceRoot": "./", - - // Specify the location where debugger should locate map files instead of generated locations. - // "mapRoot": "./", - - // Emit a single file with source maps instead of having a separate file. - // "inlineSourceMap": true, - - // Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. - // "inlineSources": true, - - - // JSX Options - - // Specify the JSX factory function to use when targeting 'react' JSX emit, e.g. 'React.createElement' or 'h'. - // "jsxFactory": "", - - - // Experimental Options - - // Enables experimental support for ES7 decorators. - // "experimentalDecorators": true, - - // Enables experimental support for emitting type metadata for decorators. - // "emitDecoratorMetadata": true, - - - } -} +{ + "compilerOptions": { + /* Basic Options */ + "target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', or 'ESNEXT'. */ + "module": "commonjs", /* Specify module code generation: 'commonjs', 'amd', 'system', 'umd' or 'es2015'. */ + // "lib": [], /* Specify library files to be included in the compilation: */ + // "allowJs": true, /* Allow javascript files to be compiled. */ + // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */ + // "declaration": true, /* Generates corresponding '.d.ts' file. */ + // "sourceMap": true, /* Generates corresponding '.map' file. */ + // "outFile": "./", /* Concatenate and emit output to single file. */ + // "outDir": "./", /* Redirect output structure to the directory. */ + // "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */ + // "removeComments": true, /* Do not emit comments to output. */ + // "noEmit": true, /* Do not emit outputs. */ + // "importHelpers": true, /* Import emit helpers from 'tslib'. */ + // "downlevelIteration": true, /* Use full down-level iteration for iterables and arrays for 'for-of', spread, and destructuring in ES5/3. */ + // "isolatedModules": true, /* Unconditionally emit imports for unresolved files. */ + + /* Strict Type Checks */ + "strict": true /* Enable all strict type checks. */ + // "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */ + // "strictNullChecks": true, /* Enable strict null checks. */ + // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */ + // "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */ + + /* Additional Checks */ + // "noUnusedLocals": true, /* Report errors on unused locals. */ + // "noUnusedParameters": true, /* Report errors on unused parameters. */ + // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ + // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ + + /* Module Resolution Options */ + // "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */ + // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */ + // "paths": {}, /* List of path mapping entries for module names to locations relative to the 'baseUrl'. */ + // "rootDirs": [], /* List of root folders whose combined content represent the structure of the project at runtime. */ + // "typeRoots": [], /* List of folders to include type definitions from. */ + // "types": [], /* Type declaration files to be included in compilation. */ + // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ + + /* SourceMap Options */ + // "sourceRoot": "./", /* Specify the location where debugger should locate TypeScript files instead of source locations. */ + // "mapRoot": "./", /* Specify the location where debugger should locate map files instead of generated locations. */ + // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */ + // "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */ + + /* Experimental Options */ + // "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */ + // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */ + } +} \ No newline at end of file diff --git a/tests/baselines/reference/tsConfig/Initialized TSConfig with boolean value compiler options/tsconfig.json b/tests/baselines/reference/tsConfig/Initialized TSConfig with boolean value compiler options/tsconfig.json index f4c45f1674..39dd00c200 100644 --- a/tests/baselines/reference/tsConfig/Initialized TSConfig with boolean value compiler options/tsconfig.json +++ b/tests/baselines/reference/tsConfig/Initialized TSConfig with boolean value compiler options/tsconfig.json @@ -1,133 +1,52 @@ -{ - "compilerOptions": { - // Basic Options - - // Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', or 'ESNEXT'. - "target": "es5", - - // Specify module code generation: 'commonjs', 'amd', 'system', 'umd' or 'es2015'. - "module": "commonjs", - - // Specify library files to be included in the compilation: - // "lib": [], - - // Allow javascript files to be compiled. - // "allowJs": true, - - // Specify JSX code generation: 'preserve', 'react-native', or 'react'. - // "jsx": "preserve", - - // Generates corresponding '.d.ts' file. - // "declaration": true, - - // Generates corresponding '.map' file. - // "sourceMap": true, - - // Concatenate and emit output to single file. - // "outFile": "./", - - // Redirect output structure to the directory. - // "outDir": "./", - - // Specify the root directory of input files. Use to control the output directory structure with --outDir. - // "rootDir": "./", - - // Do not emit comments to output. - // "removeComments": true, - - // Do not emit outputs. - // "noEmit": true, - - // Import emit helpers from 'tslib'. - // "importHelpers": true, - - // Unconditionally emit imports for unresolved files. - // "isolatedModules": true, - - - // Strict Checks - - // Enable all strict type checks. - "strict": true, - - // Raise error on expressions and declarations with an implied 'any' type. - // "noImplicitAny": true, - - // Enable strict null checks. - // "strictNullChecks": true, - - // Raise error on 'this' expressions with an implied 'any' type. - // "noImplicitThis": true, - - // Report errors on unused locals. - "noUnusedLocals": true, - - // Report errors on unused parameters. - // "noUnusedParameters": true, - - // Parse in strict mode and emit "use strict" for each source file. - // "alwaysStrict": true, - - // Report error when not all code paths in function return a value. - // "noImplicitReturns": true, - - // Report errors for fallthrough cases in switch statement. - // "noFallthroughCasesInSwitch": true, - - - // Module Resolution Options - - // Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). - // "moduleResolution": "node", - - // Base directory to resolve non-absolute module names. - // "baseUrl": "./", - - // List of path mapping entries for module names to locations relative to the 'baseUrl'. - // "paths": {}, - - // List of root folders whose combined content represent the structure of the project at runtime. - // "rootDirs": [], - - // List of folders to include type definitions from. - // "typeRoots": [], - - // Type declaration files to be included in compilation. - // "types": [], - - // Allow default imports from modules with no default export. This does not affect code emit, just typechecking. - // "allowSyntheticDefaultImports": true, - - - // SourceMap Options - - // Specify the location where debugger should locate TypeScript files instead of source locations. - // "sourceRoot": "./", - - // Specify the location where debugger should locate map files instead of generated locations. - // "mapRoot": "./", - - // Emit a single file with source maps instead of having a separate file. - // "inlineSourceMap": true, - - // Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. - // "inlineSources": true, - - - // JSX Options - - // Specify the JSX factory function to use when targeting 'react' JSX emit, e.g. 'React.createElement' or 'h'. - // "jsxFactory": "", - - - // Experimental Options - - // Enables experimental support for ES7 decorators. - // "experimentalDecorators": true, - - // Enables experimental support for emitting type metadata for decorators. - // "emitDecoratorMetadata": true, - - - } -} +{ + "compilerOptions": { + /* Basic Options */ + "target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', or 'ESNEXT'. */ + "module": "commonjs", /* Specify module code generation: 'commonjs', 'amd', 'system', 'umd' or 'es2015'. */ + // "lib": [], /* Specify library files to be included in the compilation: */ + // "allowJs": true, /* Allow javascript files to be compiled. */ + // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */ + // "declaration": true, /* Generates corresponding '.d.ts' file. */ + // "sourceMap": true, /* Generates corresponding '.map' file. */ + // "outFile": "./", /* Concatenate and emit output to single file. */ + // "outDir": "./", /* Redirect output structure to the directory. */ + // "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */ + // "removeComments": true, /* Do not emit comments to output. */ + // "noEmit": true, /* Do not emit outputs. */ + // "importHelpers": true, /* Import emit helpers from 'tslib'. */ + // "downlevelIteration": true, /* Use full down-level iteration for iterables and arrays for 'for-of', spread, and destructuring in ES5/3. */ + // "isolatedModules": true, /* Unconditionally emit imports for unresolved files. */ + + /* Strict Type Checks */ + "strict": true, /* Enable all strict type checks. */ + // "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */ + // "strictNullChecks": true, /* Enable strict null checks. */ + // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */ + // "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */ + + /* Additional Checks */ + "noUnusedLocals": true /* Report errors on unused locals. */ + // "noUnusedParameters": true, /* Report errors on unused parameters. */ + // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ + // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ + + /* Module Resolution Options */ + // "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */ + // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */ + // "paths": {}, /* List of path mapping entries for module names to locations relative to the 'baseUrl'. */ + // "rootDirs": [], /* List of root folders whose combined content represent the structure of the project at runtime. */ + // "typeRoots": [], /* List of folders to include type definitions from. */ + // "types": [], /* Type declaration files to be included in compilation. */ + // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ + + /* SourceMap Options */ + // "sourceRoot": "./", /* Specify the location where debugger should locate TypeScript files instead of source locations. */ + // "mapRoot": "./", /* Specify the location where debugger should locate map files instead of generated locations. */ + // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */ + // "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */ + + /* Experimental Options */ + // "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */ + // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */ + } +} \ No newline at end of file diff --git a/tests/baselines/reference/tsConfig/Initialized TSConfig with enum value compiler options/tsconfig.json b/tests/baselines/reference/tsConfig/Initialized TSConfig with enum value compiler options/tsconfig.json index e02e2cf1ca..401ae3185f 100644 --- a/tests/baselines/reference/tsConfig/Initialized TSConfig with enum value compiler options/tsconfig.json +++ b/tests/baselines/reference/tsConfig/Initialized TSConfig with enum value compiler options/tsconfig.json @@ -1,133 +1,52 @@ -{ - "compilerOptions": { - // Basic Options - - // Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', or 'ESNEXT'. - "target": "es5", - - // Specify module code generation: 'commonjs', 'amd', 'system', 'umd' or 'es2015'. - "module": "commonjs", - - // Specify library files to be included in the compilation: - // "lib": [], - - // Allow javascript files to be compiled. - // "allowJs": true, - - // Specify JSX code generation: 'preserve', 'react-native', or 'react'. - "jsx": "react", - - // Generates corresponding '.d.ts' file. - // "declaration": true, - - // Generates corresponding '.map' file. - // "sourceMap": true, - - // Concatenate and emit output to single file. - // "outFile": "./", - - // Redirect output structure to the directory. - // "outDir": "./", - - // Specify the root directory of input files. Use to control the output directory structure with --outDir. - // "rootDir": "./", - - // Do not emit comments to output. - // "removeComments": true, - - // Do not emit outputs. - // "noEmit": true, - - // Import emit helpers from 'tslib'. - // "importHelpers": true, - - // Unconditionally emit imports for unresolved files. - // "isolatedModules": true, - - - // Strict Checks - - // Enable all strict type checks. - "strict": true, - - // Raise error on expressions and declarations with an implied 'any' type. - // "noImplicitAny": true, - - // Enable strict null checks. - // "strictNullChecks": true, - - // Raise error on 'this' expressions with an implied 'any' type. - // "noImplicitThis": true, - - // Report errors on unused locals. - // "noUnusedLocals": true, - - // Report errors on unused parameters. - // "noUnusedParameters": true, - - // Parse in strict mode and emit "use strict" for each source file. - // "alwaysStrict": true, - - // Report error when not all code paths in function return a value. - // "noImplicitReturns": true, - - // Report errors for fallthrough cases in switch statement. - // "noFallthroughCasesInSwitch": true, - - - // Module Resolution Options - - // Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). - // "moduleResolution": "node", - - // Base directory to resolve non-absolute module names. - // "baseUrl": "./", - - // List of path mapping entries for module names to locations relative to the 'baseUrl'. - // "paths": {}, - - // List of root folders whose combined content represent the structure of the project at runtime. - // "rootDirs": [], - - // List of folders to include type definitions from. - // "typeRoots": [], - - // Type declaration files to be included in compilation. - // "types": [], - - // Allow default imports from modules with no default export. This does not affect code emit, just typechecking. - // "allowSyntheticDefaultImports": true, - - - // SourceMap Options - - // Specify the location where debugger should locate TypeScript files instead of source locations. - // "sourceRoot": "./", - - // Specify the location where debugger should locate map files instead of generated locations. - // "mapRoot": "./", - - // Emit a single file with source maps instead of having a separate file. - // "inlineSourceMap": true, - - // Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. - // "inlineSources": true, - - - // JSX Options - - // Specify the JSX factory function to use when targeting 'react' JSX emit, e.g. 'React.createElement' or 'h'. - // "jsxFactory": "", - - - // Experimental Options - - // Enables experimental support for ES7 decorators. - // "experimentalDecorators": true, - - // Enables experimental support for emitting type metadata for decorators. - // "emitDecoratorMetadata": true, - - - } -} +{ + "compilerOptions": { + /* Basic Options */ + "target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', or 'ESNEXT'. */ + "module": "commonjs", /* Specify module code generation: 'commonjs', 'amd', 'system', 'umd' or 'es2015'. */ + // "lib": [], /* Specify library files to be included in the compilation: */ + // "allowJs": true, /* Allow javascript files to be compiled. */ + "jsx": "react", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */ + // "declaration": true, /* Generates corresponding '.d.ts' file. */ + // "sourceMap": true, /* Generates corresponding '.map' file. */ + // "outFile": "./", /* Concatenate and emit output to single file. */ + // "outDir": "./", /* Redirect output structure to the directory. */ + // "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */ + // "removeComments": true, /* Do not emit comments to output. */ + // "noEmit": true, /* Do not emit outputs. */ + // "importHelpers": true, /* Import emit helpers from 'tslib'. */ + // "downlevelIteration": true, /* Use full down-level iteration for iterables and arrays for 'for-of', spread, and destructuring in ES5/3. */ + // "isolatedModules": true, /* Unconditionally emit imports for unresolved files. */ + + /* Strict Type Checks */ + "strict": true /* Enable all strict type checks. */ + // "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */ + // "strictNullChecks": true, /* Enable strict null checks. */ + // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */ + // "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */ + + /* Additional Checks */ + // "noUnusedLocals": true, /* Report errors on unused locals. */ + // "noUnusedParameters": true, /* Report errors on unused parameters. */ + // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ + // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ + + /* Module Resolution Options */ + // "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */ + // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */ + // "paths": {}, /* List of path mapping entries for module names to locations relative to the 'baseUrl'. */ + // "rootDirs": [], /* List of root folders whose combined content represent the structure of the project at runtime. */ + // "typeRoots": [], /* List of folders to include type definitions from. */ + // "types": [], /* Type declaration files to be included in compilation. */ + // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ + + /* SourceMap Options */ + // "sourceRoot": "./", /* Specify the location where debugger should locate TypeScript files instead of source locations. */ + // "mapRoot": "./", /* Specify the location where debugger should locate map files instead of generated locations. */ + // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */ + // "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */ + + /* Experimental Options */ + // "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */ + // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */ + } +} \ No newline at end of file diff --git a/tests/baselines/reference/tsConfig/Initialized TSConfig with files options/tsconfig.json b/tests/baselines/reference/tsConfig/Initialized TSConfig with files options/tsconfig.json index f413bdd2a6..9e99149547 100644 --- a/tests/baselines/reference/tsConfig/Initialized TSConfig with files options/tsconfig.json +++ b/tests/baselines/reference/tsConfig/Initialized TSConfig with files options/tsconfig.json @@ -1,138 +1,57 @@ -{ - "compilerOptions": { - // Basic Options - - // Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', or 'ESNEXT'. - "target": "es5", - - // Specify module code generation: 'commonjs', 'amd', 'system', 'umd' or 'es2015'. - "module": "commonjs", - - // Specify library files to be included in the compilation: - // "lib": [], - - // Allow javascript files to be compiled. - // "allowJs": true, - - // Specify JSX code generation: 'preserve', 'react-native', or 'react'. - // "jsx": "preserve", - - // Generates corresponding '.d.ts' file. - // "declaration": true, - - // Generates corresponding '.map' file. - // "sourceMap": true, - - // Concatenate and emit output to single file. - // "outFile": "./", - - // Redirect output structure to the directory. - // "outDir": "./", - - // Specify the root directory of input files. Use to control the output directory structure with --outDir. - // "rootDir": "./", - - // Do not emit comments to output. - // "removeComments": true, - - // Do not emit outputs. - // "noEmit": true, - - // Import emit helpers from 'tslib'. - // "importHelpers": true, - - // Unconditionally emit imports for unresolved files. - // "isolatedModules": true, - - - // Strict Checks - - // Enable all strict type checks. - "strict": true, - - // Raise error on expressions and declarations with an implied 'any' type. - // "noImplicitAny": true, - - // Enable strict null checks. - // "strictNullChecks": true, - - // Raise error on 'this' expressions with an implied 'any' type. - // "noImplicitThis": true, - - // Report errors on unused locals. - // "noUnusedLocals": true, - - // Report errors on unused parameters. - // "noUnusedParameters": true, - - // Parse in strict mode and emit "use strict" for each source file. - // "alwaysStrict": true, - - // Report error when not all code paths in function return a value. - // "noImplicitReturns": true, - - // Report errors for fallthrough cases in switch statement. - // "noFallthroughCasesInSwitch": true, - - - // Module Resolution Options - - // Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). - // "moduleResolution": "node", - - // Base directory to resolve non-absolute module names. - // "baseUrl": "./", - - // List of path mapping entries for module names to locations relative to the 'baseUrl'. - // "paths": {}, - - // List of root folders whose combined content represent the structure of the project at runtime. - // "rootDirs": [], - - // List of folders to include type definitions from. - // "typeRoots": [], - - // Type declaration files to be included in compilation. - // "types": [], - - // Allow default imports from modules with no default export. This does not affect code emit, just typechecking. - // "allowSyntheticDefaultImports": true, - - - // SourceMap Options - - // Specify the location where debugger should locate TypeScript files instead of source locations. - // "sourceRoot": "./", - - // Specify the location where debugger should locate map files instead of generated locations. - // "mapRoot": "./", - - // Emit a single file with source maps instead of having a separate file. - // "inlineSourceMap": true, - - // Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. - // "inlineSources": true, - - - // JSX Options - - // Specify the JSX factory function to use when targeting 'react' JSX emit, e.g. 'React.createElement' or 'h'. - // "jsxFactory": "", - - - // Experimental Options - - // Enables experimental support for ES7 decorators. - // "experimentalDecorators": true, - - // Enables experimental support for emitting type metadata for decorators. - // "emitDecoratorMetadata": true, - - - }, - "files": [ - "file0.st", - "file1.ts", - "file2.ts" - ] -} +{ + "compilerOptions": { + /* Basic Options */ + "target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', or 'ESNEXT'. */ + "module": "commonjs", /* Specify module code generation: 'commonjs', 'amd', 'system', 'umd' or 'es2015'. */ + // "lib": [], /* Specify library files to be included in the compilation: */ + // "allowJs": true, /* Allow javascript files to be compiled. */ + // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */ + // "declaration": true, /* Generates corresponding '.d.ts' file. */ + // "sourceMap": true, /* Generates corresponding '.map' file. */ + // "outFile": "./", /* Concatenate and emit output to single file. */ + // "outDir": "./", /* Redirect output structure to the directory. */ + // "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */ + // "removeComments": true, /* Do not emit comments to output. */ + // "noEmit": true, /* Do not emit outputs. */ + // "importHelpers": true, /* Import emit helpers from 'tslib'. */ + // "downlevelIteration": true, /* Use full down-level iteration for iterables and arrays for 'for-of', spread, and destructuring in ES5/3. */ + // "isolatedModules": true, /* Unconditionally emit imports for unresolved files. */ + + /* Strict Type Checks */ + "strict": true /* Enable all strict type checks. */ + // "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */ + // "strictNullChecks": true, /* Enable strict null checks. */ + // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */ + // "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */ + + /* Additional Checks */ + // "noUnusedLocals": true, /* Report errors on unused locals. */ + // "noUnusedParameters": true, /* Report errors on unused parameters. */ + // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ + // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ + + /* Module Resolution Options */ + // "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */ + // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */ + // "paths": {}, /* List of path mapping entries for module names to locations relative to the 'baseUrl'. */ + // "rootDirs": [], /* List of root folders whose combined content represent the structure of the project at runtime. */ + // "typeRoots": [], /* List of folders to include type definitions from. */ + // "types": [], /* Type declaration files to be included in compilation. */ + // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ + + /* SourceMap Options */ + // "sourceRoot": "./", /* Specify the location where debugger should locate TypeScript files instead of source locations. */ + // "mapRoot": "./", /* Specify the location where debugger should locate map files instead of generated locations. */ + // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */ + // "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */ + + /* Experimental Options */ + // "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */ + // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */ + }, + "files": [ + "file0.st", + "file1.ts", + "file2.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/tsConfig/Initialized TSConfig with incorrect compiler option value/tsconfig.json b/tests/baselines/reference/tsConfig/Initialized TSConfig with incorrect compiler option value/tsconfig.json index 09b72cfa42..976f8c984e 100644 --- a/tests/baselines/reference/tsConfig/Initialized TSConfig with incorrect compiler option value/tsconfig.json +++ b/tests/baselines/reference/tsConfig/Initialized TSConfig with incorrect compiler option value/tsconfig.json @@ -1,133 +1,52 @@ -{ - "compilerOptions": { - // Basic Options - - // Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', or 'ESNEXT'. - "target": "es5", - - // Specify module code generation: 'commonjs', 'amd', 'system', 'umd' or 'es2015'. - "module": "commonjs", - - // Specify library files to be included in the compilation: - "lib": ["es5","es2015.promise"], - - // Allow javascript files to be compiled. - // "allowJs": true, - - // Specify JSX code generation: 'preserve', 'react-native', or 'react'. - // "jsx": "preserve", - - // Generates corresponding '.d.ts' file. - // "declaration": true, - - // Generates corresponding '.map' file. - // "sourceMap": true, - - // Concatenate and emit output to single file. - // "outFile": "./", - - // Redirect output structure to the directory. - // "outDir": "./", - - // Specify the root directory of input files. Use to control the output directory structure with --outDir. - // "rootDir": "./", - - // Do not emit comments to output. - // "removeComments": true, - - // Do not emit outputs. - // "noEmit": true, - - // Import emit helpers from 'tslib'. - // "importHelpers": true, - - // Unconditionally emit imports for unresolved files. - // "isolatedModules": true, - - - // Strict Checks - - // Enable all strict type checks. - "strict": true, - - // Raise error on expressions and declarations with an implied 'any' type. - // "noImplicitAny": true, - - // Enable strict null checks. - // "strictNullChecks": true, - - // Raise error on 'this' expressions with an implied 'any' type. - // "noImplicitThis": true, - - // Report errors on unused locals. - // "noUnusedLocals": true, - - // Report errors on unused parameters. - // "noUnusedParameters": true, - - // Parse in strict mode and emit "use strict" for each source file. - // "alwaysStrict": true, - - // Report error when not all code paths in function return a value. - // "noImplicitReturns": true, - - // Report errors for fallthrough cases in switch statement. - // "noFallthroughCasesInSwitch": true, - - - // Module Resolution Options - - // Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). - // "moduleResolution": "node", - - // Base directory to resolve non-absolute module names. - // "baseUrl": "./", - - // List of path mapping entries for module names to locations relative to the 'baseUrl'. - // "paths": {}, - - // List of root folders whose combined content represent the structure of the project at runtime. - // "rootDirs": [], - - // List of folders to include type definitions from. - // "typeRoots": [], - - // Type declaration files to be included in compilation. - // "types": [], - - // Allow default imports from modules with no default export. This does not affect code emit, just typechecking. - // "allowSyntheticDefaultImports": true, - - - // SourceMap Options - - // Specify the location where debugger should locate TypeScript files instead of source locations. - // "sourceRoot": "./", - - // Specify the location where debugger should locate map files instead of generated locations. - // "mapRoot": "./", - - // Emit a single file with source maps instead of having a separate file. - // "inlineSourceMap": true, - - // Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. - // "inlineSources": true, - - - // JSX Options - - // Specify the JSX factory function to use when targeting 'react' JSX emit, e.g. 'React.createElement' or 'h'. - // "jsxFactory": "", - - - // Experimental Options - - // Enables experimental support for ES7 decorators. - // "experimentalDecorators": true, - - // Enables experimental support for emitting type metadata for decorators. - // "emitDecoratorMetadata": true, - - - } -} +{ + "compilerOptions": { + /* Basic Options */ + "target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', or 'ESNEXT'. */ + "module": "commonjs", /* Specify module code generation: 'commonjs', 'amd', 'system', 'umd' or 'es2015'. */ + "lib": ["es5","es2015.promise"], /* Specify library files to be included in the compilation: */ + // "allowJs": true, /* Allow javascript files to be compiled. */ + // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */ + // "declaration": true, /* Generates corresponding '.d.ts' file. */ + // "sourceMap": true, /* Generates corresponding '.map' file. */ + // "outFile": "./", /* Concatenate and emit output to single file. */ + // "outDir": "./", /* Redirect output structure to the directory. */ + // "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */ + // "removeComments": true, /* Do not emit comments to output. */ + // "noEmit": true, /* Do not emit outputs. */ + // "importHelpers": true, /* Import emit helpers from 'tslib'. */ + // "downlevelIteration": true, /* Use full down-level iteration for iterables and arrays for 'for-of', spread, and destructuring in ES5/3. */ + // "isolatedModules": true, /* Unconditionally emit imports for unresolved files. */ + + /* Strict Type Checks */ + "strict": true /* Enable all strict type checks. */ + // "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */ + // "strictNullChecks": true, /* Enable strict null checks. */ + // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */ + // "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */ + + /* Additional Checks */ + // "noUnusedLocals": true, /* Report errors on unused locals. */ + // "noUnusedParameters": true, /* Report errors on unused parameters. */ + // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ + // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ + + /* Module Resolution Options */ + // "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */ + // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */ + // "paths": {}, /* List of path mapping entries for module names to locations relative to the 'baseUrl'. */ + // "rootDirs": [], /* List of root folders whose combined content represent the structure of the project at runtime. */ + // "typeRoots": [], /* List of folders to include type definitions from. */ + // "types": [], /* Type declaration files to be included in compilation. */ + // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ + + /* SourceMap Options */ + // "sourceRoot": "./", /* Specify the location where debugger should locate TypeScript files instead of source locations. */ + // "mapRoot": "./", /* Specify the location where debugger should locate map files instead of generated locations. */ + // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */ + // "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */ + + /* Experimental Options */ + // "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */ + // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */ + } +} \ No newline at end of file diff --git a/tests/baselines/reference/tsConfig/Initialized TSConfig with incorrect compiler option/tsconfig.json b/tests/baselines/reference/tsConfig/Initialized TSConfig with incorrect compiler option/tsconfig.json index 452c031408..13e3bdb0f4 100644 --- a/tests/baselines/reference/tsConfig/Initialized TSConfig with incorrect compiler option/tsconfig.json +++ b/tests/baselines/reference/tsConfig/Initialized TSConfig with incorrect compiler option/tsconfig.json @@ -1,133 +1,52 @@ -{ - "compilerOptions": { - // Basic Options - - // Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', or 'ESNEXT'. - "target": "es5", - - // Specify module code generation: 'commonjs', 'amd', 'system', 'umd' or 'es2015'. - "module": "commonjs", - - // Specify library files to be included in the compilation: - // "lib": [], - - // Allow javascript files to be compiled. - // "allowJs": true, - - // Specify JSX code generation: 'preserve', 'react-native', or 'react'. - // "jsx": "preserve", - - // Generates corresponding '.d.ts' file. - // "declaration": true, - - // Generates corresponding '.map' file. - // "sourceMap": true, - - // Concatenate and emit output to single file. - // "outFile": "./", - - // Redirect output structure to the directory. - // "outDir": "./", - - // Specify the root directory of input files. Use to control the output directory structure with --outDir. - // "rootDir": "./", - - // Do not emit comments to output. - // "removeComments": true, - - // Do not emit outputs. - // "noEmit": true, - - // Import emit helpers from 'tslib'. - // "importHelpers": true, - - // Unconditionally emit imports for unresolved files. - // "isolatedModules": true, - - - // Strict Checks - - // Enable all strict type checks. - "strict": true, - - // Raise error on expressions and declarations with an implied 'any' type. - // "noImplicitAny": true, - - // Enable strict null checks. - // "strictNullChecks": true, - - // Raise error on 'this' expressions with an implied 'any' type. - // "noImplicitThis": true, - - // Report errors on unused locals. - // "noUnusedLocals": true, - - // Report errors on unused parameters. - // "noUnusedParameters": true, - - // Parse in strict mode and emit "use strict" for each source file. - // "alwaysStrict": true, - - // Report error when not all code paths in function return a value. - // "noImplicitReturns": true, - - // Report errors for fallthrough cases in switch statement. - // "noFallthroughCasesInSwitch": true, - - - // Module Resolution Options - - // Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). - // "moduleResolution": "node", - - // Base directory to resolve non-absolute module names. - // "baseUrl": "./", - - // List of path mapping entries for module names to locations relative to the 'baseUrl'. - // "paths": {}, - - // List of root folders whose combined content represent the structure of the project at runtime. - // "rootDirs": [], - - // List of folders to include type definitions from. - // "typeRoots": [], - - // Type declaration files to be included in compilation. - // "types": [], - - // Allow default imports from modules with no default export. This does not affect code emit, just typechecking. - // "allowSyntheticDefaultImports": true, - - - // SourceMap Options - - // Specify the location where debugger should locate TypeScript files instead of source locations. - // "sourceRoot": "./", - - // Specify the location where debugger should locate map files instead of generated locations. - // "mapRoot": "./", - - // Emit a single file with source maps instead of having a separate file. - // "inlineSourceMap": true, - - // Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. - // "inlineSources": true, - - - // JSX Options - - // Specify the JSX factory function to use when targeting 'react' JSX emit, e.g. 'React.createElement' or 'h'. - // "jsxFactory": "", - - - // Experimental Options - - // Enables experimental support for ES7 decorators. - // "experimentalDecorators": true, - - // Enables experimental support for emitting type metadata for decorators. - // "emitDecoratorMetadata": true, - - - } -} +{ + "compilerOptions": { + /* Basic Options */ + "target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', or 'ESNEXT'. */ + "module": "commonjs", /* Specify module code generation: 'commonjs', 'amd', 'system', 'umd' or 'es2015'. */ + // "lib": [], /* Specify library files to be included in the compilation: */ + // "allowJs": true, /* Allow javascript files to be compiled. */ + // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */ + // "declaration": true, /* Generates corresponding '.d.ts' file. */ + // "sourceMap": true, /* Generates corresponding '.map' file. */ + // "outFile": "./", /* Concatenate and emit output to single file. */ + // "outDir": "./", /* Redirect output structure to the directory. */ + // "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */ + // "removeComments": true, /* Do not emit comments to output. */ + // "noEmit": true, /* Do not emit outputs. */ + // "importHelpers": true, /* Import emit helpers from 'tslib'. */ + // "downlevelIteration": true, /* Use full down-level iteration for iterables and arrays for 'for-of', spread, and destructuring in ES5/3. */ + // "isolatedModules": true, /* Unconditionally emit imports for unresolved files. */ + + /* Strict Type Checks */ + "strict": true /* Enable all strict type checks. */ + // "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */ + // "strictNullChecks": true, /* Enable strict null checks. */ + // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */ + // "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */ + + /* Additional Checks */ + // "noUnusedLocals": true, /* Report errors on unused locals. */ + // "noUnusedParameters": true, /* Report errors on unused parameters. */ + // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ + // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ + + /* Module Resolution Options */ + // "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */ + // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */ + // "paths": {}, /* List of path mapping entries for module names to locations relative to the 'baseUrl'. */ + // "rootDirs": [], /* List of root folders whose combined content represent the structure of the project at runtime. */ + // "typeRoots": [], /* List of folders to include type definitions from. */ + // "types": [], /* Type declaration files to be included in compilation. */ + // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ + + /* SourceMap Options */ + // "sourceRoot": "./", /* Specify the location where debugger should locate TypeScript files instead of source locations. */ + // "mapRoot": "./", /* Specify the location where debugger should locate map files instead of generated locations. */ + // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */ + // "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */ + + /* Experimental Options */ + // "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */ + // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */ + } +} \ No newline at end of file diff --git a/tests/baselines/reference/tsConfig/Initialized TSConfig with list compiler options with enum value/tsconfig.json b/tests/baselines/reference/tsConfig/Initialized TSConfig with list compiler options with enum value/tsconfig.json index 45915ac038..f4bc1dc9ef 100644 --- a/tests/baselines/reference/tsConfig/Initialized TSConfig with list compiler options with enum value/tsconfig.json +++ b/tests/baselines/reference/tsConfig/Initialized TSConfig with list compiler options with enum value/tsconfig.json @@ -1,133 +1,52 @@ -{ - "compilerOptions": { - // Basic Options - - // Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', or 'ESNEXT'. - "target": "es5", - - // Specify module code generation: 'commonjs', 'amd', 'system', 'umd' or 'es2015'. - "module": "commonjs", - - // Specify library files to be included in the compilation: - "lib": ["es5","es2015.core"], - - // Allow javascript files to be compiled. - // "allowJs": true, - - // Specify JSX code generation: 'preserve', 'react-native', or 'react'. - // "jsx": "preserve", - - // Generates corresponding '.d.ts' file. - // "declaration": true, - - // Generates corresponding '.map' file. - // "sourceMap": true, - - // Concatenate and emit output to single file. - // "outFile": "./", - - // Redirect output structure to the directory. - // "outDir": "./", - - // Specify the root directory of input files. Use to control the output directory structure with --outDir. - // "rootDir": "./", - - // Do not emit comments to output. - // "removeComments": true, - - // Do not emit outputs. - // "noEmit": true, - - // Import emit helpers from 'tslib'. - // "importHelpers": true, - - // Unconditionally emit imports for unresolved files. - // "isolatedModules": true, - - - // Strict Checks - - // Enable all strict type checks. - "strict": true, - - // Raise error on expressions and declarations with an implied 'any' type. - // "noImplicitAny": true, - - // Enable strict null checks. - // "strictNullChecks": true, - - // Raise error on 'this' expressions with an implied 'any' type. - // "noImplicitThis": true, - - // Report errors on unused locals. - // "noUnusedLocals": true, - - // Report errors on unused parameters. - // "noUnusedParameters": true, - - // Parse in strict mode and emit "use strict" for each source file. - // "alwaysStrict": true, - - // Report error when not all code paths in function return a value. - // "noImplicitReturns": true, - - // Report errors for fallthrough cases in switch statement. - // "noFallthroughCasesInSwitch": true, - - - // Module Resolution Options - - // Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). - // "moduleResolution": "node", - - // Base directory to resolve non-absolute module names. - // "baseUrl": "./", - - // List of path mapping entries for module names to locations relative to the 'baseUrl'. - // "paths": {}, - - // List of root folders whose combined content represent the structure of the project at runtime. - // "rootDirs": [], - - // List of folders to include type definitions from. - // "typeRoots": [], - - // Type declaration files to be included in compilation. - // "types": [], - - // Allow default imports from modules with no default export. This does not affect code emit, just typechecking. - // "allowSyntheticDefaultImports": true, - - - // SourceMap Options - - // Specify the location where debugger should locate TypeScript files instead of source locations. - // "sourceRoot": "./", - - // Specify the location where debugger should locate map files instead of generated locations. - // "mapRoot": "./", - - // Emit a single file with source maps instead of having a separate file. - // "inlineSourceMap": true, - - // Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. - // "inlineSources": true, - - - // JSX Options - - // Specify the JSX factory function to use when targeting 'react' JSX emit, e.g. 'React.createElement' or 'h'. - // "jsxFactory": "", - - - // Experimental Options - - // Enables experimental support for ES7 decorators. - // "experimentalDecorators": true, - - // Enables experimental support for emitting type metadata for decorators. - // "emitDecoratorMetadata": true, - - - } -} +{ + "compilerOptions": { + /* Basic Options */ + "target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', or 'ESNEXT'. */ + "module": "commonjs", /* Specify module code generation: 'commonjs', 'amd', 'system', 'umd' or 'es2015'. */ + "lib": ["es5","es2015.core"], /* Specify library files to be included in the compilation: */ + // "allowJs": true, /* Allow javascript files to be compiled. */ + // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */ + // "declaration": true, /* Generates corresponding '.d.ts' file. */ + // "sourceMap": true, /* Generates corresponding '.map' file. */ + // "outFile": "./", /* Concatenate and emit output to single file. */ + // "outDir": "./", /* Redirect output structure to the directory. */ + // "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */ + // "removeComments": true, /* Do not emit comments to output. */ + // "noEmit": true, /* Do not emit outputs. */ + // "importHelpers": true, /* Import emit helpers from 'tslib'. */ + // "downlevelIteration": true, /* Use full down-level iteration for iterables and arrays for 'for-of', spread, and destructuring in ES5/3. */ + // "isolatedModules": true, /* Unconditionally emit imports for unresolved files. */ + + /* Strict Type Checks */ + "strict": true /* Enable all strict type checks. */ + // "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */ + // "strictNullChecks": true, /* Enable strict null checks. */ + // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */ + // "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */ + + /* Additional Checks */ + // "noUnusedLocals": true, /* Report errors on unused locals. */ + // "noUnusedParameters": true, /* Report errors on unused parameters. */ + // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ + // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ + + /* Module Resolution Options */ + // "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */ + // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */ + // "paths": {}, /* List of path mapping entries for module names to locations relative to the 'baseUrl'. */ + // "rootDirs": [], /* List of root folders whose combined content represent the structure of the project at runtime. */ + // "typeRoots": [], /* List of folders to include type definitions from. */ + // "types": [], /* Type declaration files to be included in compilation. */ + // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ + + /* SourceMap Options */ + // "sourceRoot": "./", /* Specify the location where debugger should locate TypeScript files instead of source locations. */ + // "mapRoot": "./", /* Specify the location where debugger should locate map files instead of generated locations. */ + // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */ + // "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */ + + /* Experimental Options */ + // "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */ + // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */ + } +} \ No newline at end of file diff --git a/tests/baselines/reference/tsConfig/Initialized TSConfig with list compiler options/tsconfig.json b/tests/baselines/reference/tsConfig/Initialized TSConfig with list compiler options/tsconfig.json index 33b17b3cf5..434e886b25 100644 --- a/tests/baselines/reference/tsConfig/Initialized TSConfig with list compiler options/tsconfig.json +++ b/tests/baselines/reference/tsConfig/Initialized TSConfig with list compiler options/tsconfig.json @@ -1,133 +1,52 @@ -{ - "compilerOptions": { - // Basic Options - - // Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', or 'ESNEXT'. - "target": "es5", - - // Specify module code generation: 'commonjs', 'amd', 'system', 'umd' or 'es2015'. - "module": "commonjs", - - // Specify library files to be included in the compilation: - // "lib": [], - - // Allow javascript files to be compiled. - // "allowJs": true, - - // Specify JSX code generation: 'preserve', 'react-native', or 'react'. - // "jsx": "preserve", - - // Generates corresponding '.d.ts' file. - // "declaration": true, - - // Generates corresponding '.map' file. - // "sourceMap": true, - - // Concatenate and emit output to single file. - // "outFile": "./", - - // Redirect output structure to the directory. - // "outDir": "./", - - // Specify the root directory of input files. Use to control the output directory structure with --outDir. - // "rootDir": "./", - - // Do not emit comments to output. - // "removeComments": true, - - // Do not emit outputs. - // "noEmit": true, - - // Import emit helpers from 'tslib'. - // "importHelpers": true, - - // Unconditionally emit imports for unresolved files. - // "isolatedModules": true, - - - // Strict Checks - - // Enable all strict type checks. - "strict": true, - - // Raise error on expressions and declarations with an implied 'any' type. - // "noImplicitAny": true, - - // Enable strict null checks. - // "strictNullChecks": true, - - // Raise error on 'this' expressions with an implied 'any' type. - // "noImplicitThis": true, - - // Report errors on unused locals. - // "noUnusedLocals": true, - - // Report errors on unused parameters. - // "noUnusedParameters": true, - - // Parse in strict mode and emit "use strict" for each source file. - // "alwaysStrict": true, - - // Report error when not all code paths in function return a value. - // "noImplicitReturns": true, - - // Report errors for fallthrough cases in switch statement. - // "noFallthroughCasesInSwitch": true, - - - // Module Resolution Options - - // Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). - // "moduleResolution": "node", - - // Base directory to resolve non-absolute module names. - // "baseUrl": "./", - - // List of path mapping entries for module names to locations relative to the 'baseUrl'. - // "paths": {}, - - // List of root folders whose combined content represent the structure of the project at runtime. - // "rootDirs": [], - - // List of folders to include type definitions from. - // "typeRoots": [], - - // Type declaration files to be included in compilation. - "types": ["jquery","mocha"], - - // Allow default imports from modules with no default export. This does not affect code emit, just typechecking. - // "allowSyntheticDefaultImports": true, - - - // SourceMap Options - - // Specify the location where debugger should locate TypeScript files instead of source locations. - // "sourceRoot": "./", - - // Specify the location where debugger should locate map files instead of generated locations. - // "mapRoot": "./", - - // Emit a single file with source maps instead of having a separate file. - // "inlineSourceMap": true, - - // Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. - // "inlineSources": true, - - - // JSX Options - - // Specify the JSX factory function to use when targeting 'react' JSX emit, e.g. 'React.createElement' or 'h'. - // "jsxFactory": "", - - - // Experimental Options - - // Enables experimental support for ES7 decorators. - // "experimentalDecorators": true, - - // Enables experimental support for emitting type metadata for decorators. - // "emitDecoratorMetadata": true, - - - } -} +{ + "compilerOptions": { + /* Basic Options */ + "target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', or 'ESNEXT'. */ + "module": "commonjs", /* Specify module code generation: 'commonjs', 'amd', 'system', 'umd' or 'es2015'. */ + // "lib": [], /* Specify library files to be included in the compilation: */ + // "allowJs": true, /* Allow javascript files to be compiled. */ + // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */ + // "declaration": true, /* Generates corresponding '.d.ts' file. */ + // "sourceMap": true, /* Generates corresponding '.map' file. */ + // "outFile": "./", /* Concatenate and emit output to single file. */ + // "outDir": "./", /* Redirect output structure to the directory. */ + // "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */ + // "removeComments": true, /* Do not emit comments to output. */ + // "noEmit": true, /* Do not emit outputs. */ + // "importHelpers": true, /* Import emit helpers from 'tslib'. */ + // "downlevelIteration": true, /* Use full down-level iteration for iterables and arrays for 'for-of', spread, and destructuring in ES5/3. */ + // "isolatedModules": true, /* Unconditionally emit imports for unresolved files. */ + + /* Strict Type Checks */ + "strict": true, /* Enable all strict type checks. */ + // "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */ + // "strictNullChecks": true, /* Enable strict null checks. */ + // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */ + // "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */ + + /* Additional Checks */ + // "noUnusedLocals": true, /* Report errors on unused locals. */ + // "noUnusedParameters": true, /* Report errors on unused parameters. */ + // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ + // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ + + /* Module Resolution Options */ + // "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */ + // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */ + // "paths": {}, /* List of path mapping entries for module names to locations relative to the 'baseUrl'. */ + // "rootDirs": [], /* List of root folders whose combined content represent the structure of the project at runtime. */ + // "typeRoots": [], /* List of folders to include type definitions from. */ + "types": ["jquery","mocha"] /* Type declaration files to be included in compilation. */ + // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ + + /* SourceMap Options */ + // "sourceRoot": "./", /* Specify the location where debugger should locate TypeScript files instead of source locations. */ + // "mapRoot": "./", /* Specify the location where debugger should locate map files instead of generated locations. */ + // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */ + // "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */ + + /* Experimental Options */ + // "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */ + // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */ + } +} \ No newline at end of file From d78e5a1db52a2ec72724461a600ea07ab57191e6 Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Wed, 15 Mar 2017 18:39:44 -0700 Subject: [PATCH 20/24] Normalize line endings when validating baselines --- src/harness/unittests/initializeTSConfig.ts | 5 +- .../tsconfig.json | 102 ++++++++-------- .../tsconfig.json | 102 ++++++++-------- .../tsconfig.json | 102 ++++++++-------- .../tsconfig.json | 112 +++++++++--------- .../tsconfig.json | 102 ++++++++-------- .../tsconfig.json | 102 ++++++++-------- .../tsconfig.json | 102 ++++++++-------- .../tsconfig.json | 102 ++++++++-------- 9 files changed, 416 insertions(+), 415 deletions(-) diff --git a/src/harness/unittests/initializeTSConfig.ts b/src/harness/unittests/initializeTSConfig.ts index 7163ab3e34..4f193d358f 100644 --- a/src/harness/unittests/initializeTSConfig.ts +++ b/src/harness/unittests/initializeTSConfig.ts @@ -1,4 +1,4 @@ -/// +/// /// namespace ts { @@ -12,7 +12,8 @@ namespace ts { it(`Correct output for ${outputFileName}`, () => { Harness.Baseline.runBaseline(outputFileName, () => { if (initResult) { - return initResult; + // normalize line endings + return initResult.replace(new RegExp(sys.newLine, "g"), "\n"); } else { // This can happen if compiler recieve invalid compiler-options diff --git a/tests/baselines/reference/tsConfig/Default initialized TSConfig/tsconfig.json b/tests/baselines/reference/tsConfig/Default initialized TSConfig/tsconfig.json index 13e3bdb0f4..f26b471d2c 100644 --- a/tests/baselines/reference/tsConfig/Default initialized TSConfig/tsconfig.json +++ b/tests/baselines/reference/tsConfig/Default initialized TSConfig/tsconfig.json @@ -1,52 +1,52 @@ -{ - "compilerOptions": { - /* Basic Options */ - "target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', or 'ESNEXT'. */ - "module": "commonjs", /* Specify module code generation: 'commonjs', 'amd', 'system', 'umd' or 'es2015'. */ - // "lib": [], /* Specify library files to be included in the compilation: */ - // "allowJs": true, /* Allow javascript files to be compiled. */ - // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */ - // "declaration": true, /* Generates corresponding '.d.ts' file. */ - // "sourceMap": true, /* Generates corresponding '.map' file. */ - // "outFile": "./", /* Concatenate and emit output to single file. */ - // "outDir": "./", /* Redirect output structure to the directory. */ - // "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */ - // "removeComments": true, /* Do not emit comments to output. */ - // "noEmit": true, /* Do not emit outputs. */ - // "importHelpers": true, /* Import emit helpers from 'tslib'. */ - // "downlevelIteration": true, /* Use full down-level iteration for iterables and arrays for 'for-of', spread, and destructuring in ES5/3. */ - // "isolatedModules": true, /* Unconditionally emit imports for unresolved files. */ - - /* Strict Type Checks */ - "strict": true /* Enable all strict type checks. */ - // "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */ - // "strictNullChecks": true, /* Enable strict null checks. */ - // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */ - // "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */ - - /* Additional Checks */ - // "noUnusedLocals": true, /* Report errors on unused locals. */ - // "noUnusedParameters": true, /* Report errors on unused parameters. */ - // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ - // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ - - /* Module Resolution Options */ - // "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */ - // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */ - // "paths": {}, /* List of path mapping entries for module names to locations relative to the 'baseUrl'. */ - // "rootDirs": [], /* List of root folders whose combined content represent the structure of the project at runtime. */ - // "typeRoots": [], /* List of folders to include type definitions from. */ - // "types": [], /* Type declaration files to be included in compilation. */ - // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ - - /* SourceMap Options */ - // "sourceRoot": "./", /* Specify the location where debugger should locate TypeScript files instead of source locations. */ - // "mapRoot": "./", /* Specify the location where debugger should locate map files instead of generated locations. */ - // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */ - // "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */ - - /* Experimental Options */ - // "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */ - // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */ - } +{ + "compilerOptions": { + /* Basic Options */ + "target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', or 'ESNEXT'. */ + "module": "commonjs", /* Specify module code generation: 'commonjs', 'amd', 'system', 'umd' or 'es2015'. */ + // "lib": [], /* Specify library files to be included in the compilation: */ + // "allowJs": true, /* Allow javascript files to be compiled. */ + // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */ + // "declaration": true, /* Generates corresponding '.d.ts' file. */ + // "sourceMap": true, /* Generates corresponding '.map' file. */ + // "outFile": "./", /* Concatenate and emit output to single file. */ + // "outDir": "./", /* Redirect output structure to the directory. */ + // "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */ + // "removeComments": true, /* Do not emit comments to output. */ + // "noEmit": true, /* Do not emit outputs. */ + // "importHelpers": true, /* Import emit helpers from 'tslib'. */ + // "downlevelIteration": true, /* Use full down-level iteration for iterables and arrays for 'for-of', spread, and destructuring in ES5/3. */ + // "isolatedModules": true, /* Unconditionally emit imports for unresolved files. */ + + /* Strict Type Checks */ + "strict": true /* Enable all strict type checks. */ + // "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */ + // "strictNullChecks": true, /* Enable strict null checks. */ + // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */ + // "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */ + + /* Additional Checks */ + // "noUnusedLocals": true, /* Report errors on unused locals. */ + // "noUnusedParameters": true, /* Report errors on unused parameters. */ + // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ + // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ + + /* Module Resolution Options */ + // "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */ + // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */ + // "paths": {}, /* List of path mapping entries for module names to locations relative to the 'baseUrl'. */ + // "rootDirs": [], /* List of root folders whose combined content represent the structure of the project at runtime. */ + // "typeRoots": [], /* List of folders to include type definitions from. */ + // "types": [], /* Type declaration files to be included in compilation. */ + // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ + + /* SourceMap Options */ + // "sourceRoot": "./", /* Specify the location where debugger should locate TypeScript files instead of source locations. */ + // "mapRoot": "./", /* Specify the location where debugger should locate map files instead of generated locations. */ + // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */ + // "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */ + + /* Experimental Options */ + // "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */ + // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */ + } } \ No newline at end of file diff --git a/tests/baselines/reference/tsConfig/Initialized TSConfig with boolean value compiler options/tsconfig.json b/tests/baselines/reference/tsConfig/Initialized TSConfig with boolean value compiler options/tsconfig.json index 39dd00c200..2dc7f0564b 100644 --- a/tests/baselines/reference/tsConfig/Initialized TSConfig with boolean value compiler options/tsconfig.json +++ b/tests/baselines/reference/tsConfig/Initialized TSConfig with boolean value compiler options/tsconfig.json @@ -1,52 +1,52 @@ -{ - "compilerOptions": { - /* Basic Options */ - "target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', or 'ESNEXT'. */ - "module": "commonjs", /* Specify module code generation: 'commonjs', 'amd', 'system', 'umd' or 'es2015'. */ - // "lib": [], /* Specify library files to be included in the compilation: */ - // "allowJs": true, /* Allow javascript files to be compiled. */ - // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */ - // "declaration": true, /* Generates corresponding '.d.ts' file. */ - // "sourceMap": true, /* Generates corresponding '.map' file. */ - // "outFile": "./", /* Concatenate and emit output to single file. */ - // "outDir": "./", /* Redirect output structure to the directory. */ - // "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */ - // "removeComments": true, /* Do not emit comments to output. */ - // "noEmit": true, /* Do not emit outputs. */ - // "importHelpers": true, /* Import emit helpers from 'tslib'. */ - // "downlevelIteration": true, /* Use full down-level iteration for iterables and arrays for 'for-of', spread, and destructuring in ES5/3. */ - // "isolatedModules": true, /* Unconditionally emit imports for unresolved files. */ - - /* Strict Type Checks */ - "strict": true, /* Enable all strict type checks. */ - // "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */ - // "strictNullChecks": true, /* Enable strict null checks. */ - // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */ - // "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */ - - /* Additional Checks */ - "noUnusedLocals": true /* Report errors on unused locals. */ - // "noUnusedParameters": true, /* Report errors on unused parameters. */ - // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ - // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ - - /* Module Resolution Options */ - // "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */ - // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */ - // "paths": {}, /* List of path mapping entries for module names to locations relative to the 'baseUrl'. */ - // "rootDirs": [], /* List of root folders whose combined content represent the structure of the project at runtime. */ - // "typeRoots": [], /* List of folders to include type definitions from. */ - // "types": [], /* Type declaration files to be included in compilation. */ - // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ - - /* SourceMap Options */ - // "sourceRoot": "./", /* Specify the location where debugger should locate TypeScript files instead of source locations. */ - // "mapRoot": "./", /* Specify the location where debugger should locate map files instead of generated locations. */ - // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */ - // "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */ - - /* Experimental Options */ - // "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */ - // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */ - } +{ + "compilerOptions": { + /* Basic Options */ + "target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', or 'ESNEXT'. */ + "module": "commonjs", /* Specify module code generation: 'commonjs', 'amd', 'system', 'umd' or 'es2015'. */ + // "lib": [], /* Specify library files to be included in the compilation: */ + // "allowJs": true, /* Allow javascript files to be compiled. */ + // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */ + // "declaration": true, /* Generates corresponding '.d.ts' file. */ + // "sourceMap": true, /* Generates corresponding '.map' file. */ + // "outFile": "./", /* Concatenate and emit output to single file. */ + // "outDir": "./", /* Redirect output structure to the directory. */ + // "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */ + // "removeComments": true, /* Do not emit comments to output. */ + // "noEmit": true, /* Do not emit outputs. */ + // "importHelpers": true, /* Import emit helpers from 'tslib'. */ + // "downlevelIteration": true, /* Use full down-level iteration for iterables and arrays for 'for-of', spread, and destructuring in ES5/3. */ + // "isolatedModules": true, /* Unconditionally emit imports for unresolved files. */ + + /* Strict Type Checks */ + "strict": true, /* Enable all strict type checks. */ + // "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */ + // "strictNullChecks": true, /* Enable strict null checks. */ + // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */ + // "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */ + + /* Additional Checks */ + "noUnusedLocals": true /* Report errors on unused locals. */ + // "noUnusedParameters": true, /* Report errors on unused parameters. */ + // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ + // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ + + /* Module Resolution Options */ + // "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */ + // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */ + // "paths": {}, /* List of path mapping entries for module names to locations relative to the 'baseUrl'. */ + // "rootDirs": [], /* List of root folders whose combined content represent the structure of the project at runtime. */ + // "typeRoots": [], /* List of folders to include type definitions from. */ + // "types": [], /* Type declaration files to be included in compilation. */ + // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ + + /* SourceMap Options */ + // "sourceRoot": "./", /* Specify the location where debugger should locate TypeScript files instead of source locations. */ + // "mapRoot": "./", /* Specify the location where debugger should locate map files instead of generated locations. */ + // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */ + // "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */ + + /* Experimental Options */ + // "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */ + // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */ + } } \ No newline at end of file diff --git a/tests/baselines/reference/tsConfig/Initialized TSConfig with enum value compiler options/tsconfig.json b/tests/baselines/reference/tsConfig/Initialized TSConfig with enum value compiler options/tsconfig.json index 401ae3185f..48a7fd7784 100644 --- a/tests/baselines/reference/tsConfig/Initialized TSConfig with enum value compiler options/tsconfig.json +++ b/tests/baselines/reference/tsConfig/Initialized TSConfig with enum value compiler options/tsconfig.json @@ -1,52 +1,52 @@ -{ - "compilerOptions": { - /* Basic Options */ - "target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', or 'ESNEXT'. */ - "module": "commonjs", /* Specify module code generation: 'commonjs', 'amd', 'system', 'umd' or 'es2015'. */ - // "lib": [], /* Specify library files to be included in the compilation: */ - // "allowJs": true, /* Allow javascript files to be compiled. */ - "jsx": "react", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */ - // "declaration": true, /* Generates corresponding '.d.ts' file. */ - // "sourceMap": true, /* Generates corresponding '.map' file. */ - // "outFile": "./", /* Concatenate and emit output to single file. */ - // "outDir": "./", /* Redirect output structure to the directory. */ - // "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */ - // "removeComments": true, /* Do not emit comments to output. */ - // "noEmit": true, /* Do not emit outputs. */ - // "importHelpers": true, /* Import emit helpers from 'tslib'. */ - // "downlevelIteration": true, /* Use full down-level iteration for iterables and arrays for 'for-of', spread, and destructuring in ES5/3. */ - // "isolatedModules": true, /* Unconditionally emit imports for unresolved files. */ - - /* Strict Type Checks */ - "strict": true /* Enable all strict type checks. */ - // "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */ - // "strictNullChecks": true, /* Enable strict null checks. */ - // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */ - // "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */ - - /* Additional Checks */ - // "noUnusedLocals": true, /* Report errors on unused locals. */ - // "noUnusedParameters": true, /* Report errors on unused parameters. */ - // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ - // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ - - /* Module Resolution Options */ - // "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */ - // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */ - // "paths": {}, /* List of path mapping entries for module names to locations relative to the 'baseUrl'. */ - // "rootDirs": [], /* List of root folders whose combined content represent the structure of the project at runtime. */ - // "typeRoots": [], /* List of folders to include type definitions from. */ - // "types": [], /* Type declaration files to be included in compilation. */ - // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ - - /* SourceMap Options */ - // "sourceRoot": "./", /* Specify the location where debugger should locate TypeScript files instead of source locations. */ - // "mapRoot": "./", /* Specify the location where debugger should locate map files instead of generated locations. */ - // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */ - // "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */ - - /* Experimental Options */ - // "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */ - // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */ - } +{ + "compilerOptions": { + /* Basic Options */ + "target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', or 'ESNEXT'. */ + "module": "commonjs", /* Specify module code generation: 'commonjs', 'amd', 'system', 'umd' or 'es2015'. */ + // "lib": [], /* Specify library files to be included in the compilation: */ + // "allowJs": true, /* Allow javascript files to be compiled. */ + "jsx": "react", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */ + // "declaration": true, /* Generates corresponding '.d.ts' file. */ + // "sourceMap": true, /* Generates corresponding '.map' file. */ + // "outFile": "./", /* Concatenate and emit output to single file. */ + // "outDir": "./", /* Redirect output structure to the directory. */ + // "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */ + // "removeComments": true, /* Do not emit comments to output. */ + // "noEmit": true, /* Do not emit outputs. */ + // "importHelpers": true, /* Import emit helpers from 'tslib'. */ + // "downlevelIteration": true, /* Use full down-level iteration for iterables and arrays for 'for-of', spread, and destructuring in ES5/3. */ + // "isolatedModules": true, /* Unconditionally emit imports for unresolved files. */ + + /* Strict Type Checks */ + "strict": true /* Enable all strict type checks. */ + // "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */ + // "strictNullChecks": true, /* Enable strict null checks. */ + // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */ + // "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */ + + /* Additional Checks */ + // "noUnusedLocals": true, /* Report errors on unused locals. */ + // "noUnusedParameters": true, /* Report errors on unused parameters. */ + // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ + // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ + + /* Module Resolution Options */ + // "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */ + // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */ + // "paths": {}, /* List of path mapping entries for module names to locations relative to the 'baseUrl'. */ + // "rootDirs": [], /* List of root folders whose combined content represent the structure of the project at runtime. */ + // "typeRoots": [], /* List of folders to include type definitions from. */ + // "types": [], /* Type declaration files to be included in compilation. */ + // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ + + /* SourceMap Options */ + // "sourceRoot": "./", /* Specify the location where debugger should locate TypeScript files instead of source locations. */ + // "mapRoot": "./", /* Specify the location where debugger should locate map files instead of generated locations. */ + // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */ + // "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */ + + /* Experimental Options */ + // "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */ + // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */ + } } \ No newline at end of file diff --git a/tests/baselines/reference/tsConfig/Initialized TSConfig with files options/tsconfig.json b/tests/baselines/reference/tsConfig/Initialized TSConfig with files options/tsconfig.json index 9e99149547..a2f4e6bd99 100644 --- a/tests/baselines/reference/tsConfig/Initialized TSConfig with files options/tsconfig.json +++ b/tests/baselines/reference/tsConfig/Initialized TSConfig with files options/tsconfig.json @@ -1,57 +1,57 @@ -{ - "compilerOptions": { - /* Basic Options */ - "target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', or 'ESNEXT'. */ - "module": "commonjs", /* Specify module code generation: 'commonjs', 'amd', 'system', 'umd' or 'es2015'. */ - // "lib": [], /* Specify library files to be included in the compilation: */ - // "allowJs": true, /* Allow javascript files to be compiled. */ - // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */ - // "declaration": true, /* Generates corresponding '.d.ts' file. */ - // "sourceMap": true, /* Generates corresponding '.map' file. */ - // "outFile": "./", /* Concatenate and emit output to single file. */ - // "outDir": "./", /* Redirect output structure to the directory. */ - // "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */ - // "removeComments": true, /* Do not emit comments to output. */ - // "noEmit": true, /* Do not emit outputs. */ - // "importHelpers": true, /* Import emit helpers from 'tslib'. */ - // "downlevelIteration": true, /* Use full down-level iteration for iterables and arrays for 'for-of', spread, and destructuring in ES5/3. */ - // "isolatedModules": true, /* Unconditionally emit imports for unresolved files. */ - - /* Strict Type Checks */ - "strict": true /* Enable all strict type checks. */ - // "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */ - // "strictNullChecks": true, /* Enable strict null checks. */ - // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */ - // "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */ - - /* Additional Checks */ - // "noUnusedLocals": true, /* Report errors on unused locals. */ - // "noUnusedParameters": true, /* Report errors on unused parameters. */ - // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ - // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ - - /* Module Resolution Options */ - // "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */ - // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */ - // "paths": {}, /* List of path mapping entries for module names to locations relative to the 'baseUrl'. */ - // "rootDirs": [], /* List of root folders whose combined content represent the structure of the project at runtime. */ - // "typeRoots": [], /* List of folders to include type definitions from. */ - // "types": [], /* Type declaration files to be included in compilation. */ - // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ - - /* SourceMap Options */ - // "sourceRoot": "./", /* Specify the location where debugger should locate TypeScript files instead of source locations. */ - // "mapRoot": "./", /* Specify the location where debugger should locate map files instead of generated locations. */ - // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */ - // "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */ - - /* Experimental Options */ - // "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */ - // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */ - }, - "files": [ - "file0.st", - "file1.ts", - "file2.ts" - ] +{ + "compilerOptions": { + /* Basic Options */ + "target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', or 'ESNEXT'. */ + "module": "commonjs", /* Specify module code generation: 'commonjs', 'amd', 'system', 'umd' or 'es2015'. */ + // "lib": [], /* Specify library files to be included in the compilation: */ + // "allowJs": true, /* Allow javascript files to be compiled. */ + // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */ + // "declaration": true, /* Generates corresponding '.d.ts' file. */ + // "sourceMap": true, /* Generates corresponding '.map' file. */ + // "outFile": "./", /* Concatenate and emit output to single file. */ + // "outDir": "./", /* Redirect output structure to the directory. */ + // "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */ + // "removeComments": true, /* Do not emit comments to output. */ + // "noEmit": true, /* Do not emit outputs. */ + // "importHelpers": true, /* Import emit helpers from 'tslib'. */ + // "downlevelIteration": true, /* Use full down-level iteration for iterables and arrays for 'for-of', spread, and destructuring in ES5/3. */ + // "isolatedModules": true, /* Unconditionally emit imports for unresolved files. */ + + /* Strict Type Checks */ + "strict": true /* Enable all strict type checks. */ + // "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */ + // "strictNullChecks": true, /* Enable strict null checks. */ + // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */ + // "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */ + + /* Additional Checks */ + // "noUnusedLocals": true, /* Report errors on unused locals. */ + // "noUnusedParameters": true, /* Report errors on unused parameters. */ + // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ + // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ + + /* Module Resolution Options */ + // "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */ + // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */ + // "paths": {}, /* List of path mapping entries for module names to locations relative to the 'baseUrl'. */ + // "rootDirs": [], /* List of root folders whose combined content represent the structure of the project at runtime. */ + // "typeRoots": [], /* List of folders to include type definitions from. */ + // "types": [], /* Type declaration files to be included in compilation. */ + // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ + + /* SourceMap Options */ + // "sourceRoot": "./", /* Specify the location where debugger should locate TypeScript files instead of source locations. */ + // "mapRoot": "./", /* Specify the location where debugger should locate map files instead of generated locations. */ + // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */ + // "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */ + + /* Experimental Options */ + // "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */ + // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */ + }, + "files": [ + "file0.st", + "file1.ts", + "file2.ts" + ] } \ No newline at end of file diff --git a/tests/baselines/reference/tsConfig/Initialized TSConfig with incorrect compiler option value/tsconfig.json b/tests/baselines/reference/tsConfig/Initialized TSConfig with incorrect compiler option value/tsconfig.json index 976f8c984e..62bfc7ca26 100644 --- a/tests/baselines/reference/tsConfig/Initialized TSConfig with incorrect compiler option value/tsconfig.json +++ b/tests/baselines/reference/tsConfig/Initialized TSConfig with incorrect compiler option value/tsconfig.json @@ -1,52 +1,52 @@ -{ - "compilerOptions": { - /* Basic Options */ - "target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', or 'ESNEXT'. */ - "module": "commonjs", /* Specify module code generation: 'commonjs', 'amd', 'system', 'umd' or 'es2015'. */ - "lib": ["es5","es2015.promise"], /* Specify library files to be included in the compilation: */ - // "allowJs": true, /* Allow javascript files to be compiled. */ - // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */ - // "declaration": true, /* Generates corresponding '.d.ts' file. */ - // "sourceMap": true, /* Generates corresponding '.map' file. */ - // "outFile": "./", /* Concatenate and emit output to single file. */ - // "outDir": "./", /* Redirect output structure to the directory. */ - // "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */ - // "removeComments": true, /* Do not emit comments to output. */ - // "noEmit": true, /* Do not emit outputs. */ - // "importHelpers": true, /* Import emit helpers from 'tslib'. */ - // "downlevelIteration": true, /* Use full down-level iteration for iterables and arrays for 'for-of', spread, and destructuring in ES5/3. */ - // "isolatedModules": true, /* Unconditionally emit imports for unresolved files. */ - - /* Strict Type Checks */ - "strict": true /* Enable all strict type checks. */ - // "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */ - // "strictNullChecks": true, /* Enable strict null checks. */ - // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */ - // "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */ - - /* Additional Checks */ - // "noUnusedLocals": true, /* Report errors on unused locals. */ - // "noUnusedParameters": true, /* Report errors on unused parameters. */ - // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ - // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ - - /* Module Resolution Options */ - // "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */ - // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */ - // "paths": {}, /* List of path mapping entries for module names to locations relative to the 'baseUrl'. */ - // "rootDirs": [], /* List of root folders whose combined content represent the structure of the project at runtime. */ - // "typeRoots": [], /* List of folders to include type definitions from. */ - // "types": [], /* Type declaration files to be included in compilation. */ - // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ - - /* SourceMap Options */ - // "sourceRoot": "./", /* Specify the location where debugger should locate TypeScript files instead of source locations. */ - // "mapRoot": "./", /* Specify the location where debugger should locate map files instead of generated locations. */ - // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */ - // "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */ - - /* Experimental Options */ - // "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */ - // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */ - } +{ + "compilerOptions": { + /* Basic Options */ + "target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', or 'ESNEXT'. */ + "module": "commonjs", /* Specify module code generation: 'commonjs', 'amd', 'system', 'umd' or 'es2015'. */ + "lib": ["es5","es2015.promise"], /* Specify library files to be included in the compilation: */ + // "allowJs": true, /* Allow javascript files to be compiled. */ + // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */ + // "declaration": true, /* Generates corresponding '.d.ts' file. */ + // "sourceMap": true, /* Generates corresponding '.map' file. */ + // "outFile": "./", /* Concatenate and emit output to single file. */ + // "outDir": "./", /* Redirect output structure to the directory. */ + // "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */ + // "removeComments": true, /* Do not emit comments to output. */ + // "noEmit": true, /* Do not emit outputs. */ + // "importHelpers": true, /* Import emit helpers from 'tslib'. */ + // "downlevelIteration": true, /* Use full down-level iteration for iterables and arrays for 'for-of', spread, and destructuring in ES5/3. */ + // "isolatedModules": true, /* Unconditionally emit imports for unresolved files. */ + + /* Strict Type Checks */ + "strict": true /* Enable all strict type checks. */ + // "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */ + // "strictNullChecks": true, /* Enable strict null checks. */ + // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */ + // "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */ + + /* Additional Checks */ + // "noUnusedLocals": true, /* Report errors on unused locals. */ + // "noUnusedParameters": true, /* Report errors on unused parameters. */ + // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ + // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ + + /* Module Resolution Options */ + // "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */ + // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */ + // "paths": {}, /* List of path mapping entries for module names to locations relative to the 'baseUrl'. */ + // "rootDirs": [], /* List of root folders whose combined content represent the structure of the project at runtime. */ + // "typeRoots": [], /* List of folders to include type definitions from. */ + // "types": [], /* Type declaration files to be included in compilation. */ + // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ + + /* SourceMap Options */ + // "sourceRoot": "./", /* Specify the location where debugger should locate TypeScript files instead of source locations. */ + // "mapRoot": "./", /* Specify the location where debugger should locate map files instead of generated locations. */ + // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */ + // "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */ + + /* Experimental Options */ + // "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */ + // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */ + } } \ No newline at end of file diff --git a/tests/baselines/reference/tsConfig/Initialized TSConfig with incorrect compiler option/tsconfig.json b/tests/baselines/reference/tsConfig/Initialized TSConfig with incorrect compiler option/tsconfig.json index 13e3bdb0f4..f26b471d2c 100644 --- a/tests/baselines/reference/tsConfig/Initialized TSConfig with incorrect compiler option/tsconfig.json +++ b/tests/baselines/reference/tsConfig/Initialized TSConfig with incorrect compiler option/tsconfig.json @@ -1,52 +1,52 @@ -{ - "compilerOptions": { - /* Basic Options */ - "target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', or 'ESNEXT'. */ - "module": "commonjs", /* Specify module code generation: 'commonjs', 'amd', 'system', 'umd' or 'es2015'. */ - // "lib": [], /* Specify library files to be included in the compilation: */ - // "allowJs": true, /* Allow javascript files to be compiled. */ - // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */ - // "declaration": true, /* Generates corresponding '.d.ts' file. */ - // "sourceMap": true, /* Generates corresponding '.map' file. */ - // "outFile": "./", /* Concatenate and emit output to single file. */ - // "outDir": "./", /* Redirect output structure to the directory. */ - // "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */ - // "removeComments": true, /* Do not emit comments to output. */ - // "noEmit": true, /* Do not emit outputs. */ - // "importHelpers": true, /* Import emit helpers from 'tslib'. */ - // "downlevelIteration": true, /* Use full down-level iteration for iterables and arrays for 'for-of', spread, and destructuring in ES5/3. */ - // "isolatedModules": true, /* Unconditionally emit imports for unresolved files. */ - - /* Strict Type Checks */ - "strict": true /* Enable all strict type checks. */ - // "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */ - // "strictNullChecks": true, /* Enable strict null checks. */ - // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */ - // "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */ - - /* Additional Checks */ - // "noUnusedLocals": true, /* Report errors on unused locals. */ - // "noUnusedParameters": true, /* Report errors on unused parameters. */ - // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ - // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ - - /* Module Resolution Options */ - // "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */ - // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */ - // "paths": {}, /* List of path mapping entries for module names to locations relative to the 'baseUrl'. */ - // "rootDirs": [], /* List of root folders whose combined content represent the structure of the project at runtime. */ - // "typeRoots": [], /* List of folders to include type definitions from. */ - // "types": [], /* Type declaration files to be included in compilation. */ - // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ - - /* SourceMap Options */ - // "sourceRoot": "./", /* Specify the location where debugger should locate TypeScript files instead of source locations. */ - // "mapRoot": "./", /* Specify the location where debugger should locate map files instead of generated locations. */ - // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */ - // "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */ - - /* Experimental Options */ - // "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */ - // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */ - } +{ + "compilerOptions": { + /* Basic Options */ + "target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', or 'ESNEXT'. */ + "module": "commonjs", /* Specify module code generation: 'commonjs', 'amd', 'system', 'umd' or 'es2015'. */ + // "lib": [], /* Specify library files to be included in the compilation: */ + // "allowJs": true, /* Allow javascript files to be compiled. */ + // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */ + // "declaration": true, /* Generates corresponding '.d.ts' file. */ + // "sourceMap": true, /* Generates corresponding '.map' file. */ + // "outFile": "./", /* Concatenate and emit output to single file. */ + // "outDir": "./", /* Redirect output structure to the directory. */ + // "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */ + // "removeComments": true, /* Do not emit comments to output. */ + // "noEmit": true, /* Do not emit outputs. */ + // "importHelpers": true, /* Import emit helpers from 'tslib'. */ + // "downlevelIteration": true, /* Use full down-level iteration for iterables and arrays for 'for-of', spread, and destructuring in ES5/3. */ + // "isolatedModules": true, /* Unconditionally emit imports for unresolved files. */ + + /* Strict Type Checks */ + "strict": true /* Enable all strict type checks. */ + // "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */ + // "strictNullChecks": true, /* Enable strict null checks. */ + // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */ + // "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */ + + /* Additional Checks */ + // "noUnusedLocals": true, /* Report errors on unused locals. */ + // "noUnusedParameters": true, /* Report errors on unused parameters. */ + // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ + // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ + + /* Module Resolution Options */ + // "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */ + // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */ + // "paths": {}, /* List of path mapping entries for module names to locations relative to the 'baseUrl'. */ + // "rootDirs": [], /* List of root folders whose combined content represent the structure of the project at runtime. */ + // "typeRoots": [], /* List of folders to include type definitions from. */ + // "types": [], /* Type declaration files to be included in compilation. */ + // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ + + /* SourceMap Options */ + // "sourceRoot": "./", /* Specify the location where debugger should locate TypeScript files instead of source locations. */ + // "mapRoot": "./", /* Specify the location where debugger should locate map files instead of generated locations. */ + // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */ + // "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */ + + /* Experimental Options */ + // "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */ + // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */ + } } \ No newline at end of file diff --git a/tests/baselines/reference/tsConfig/Initialized TSConfig with list compiler options with enum value/tsconfig.json b/tests/baselines/reference/tsConfig/Initialized TSConfig with list compiler options with enum value/tsconfig.json index f4bc1dc9ef..02a1724add 100644 --- a/tests/baselines/reference/tsConfig/Initialized TSConfig with list compiler options with enum value/tsconfig.json +++ b/tests/baselines/reference/tsConfig/Initialized TSConfig with list compiler options with enum value/tsconfig.json @@ -1,52 +1,52 @@ -{ - "compilerOptions": { - /* Basic Options */ - "target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', or 'ESNEXT'. */ - "module": "commonjs", /* Specify module code generation: 'commonjs', 'amd', 'system', 'umd' or 'es2015'. */ - "lib": ["es5","es2015.core"], /* Specify library files to be included in the compilation: */ - // "allowJs": true, /* Allow javascript files to be compiled. */ - // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */ - // "declaration": true, /* Generates corresponding '.d.ts' file. */ - // "sourceMap": true, /* Generates corresponding '.map' file. */ - // "outFile": "./", /* Concatenate and emit output to single file. */ - // "outDir": "./", /* Redirect output structure to the directory. */ - // "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */ - // "removeComments": true, /* Do not emit comments to output. */ - // "noEmit": true, /* Do not emit outputs. */ - // "importHelpers": true, /* Import emit helpers from 'tslib'. */ - // "downlevelIteration": true, /* Use full down-level iteration for iterables and arrays for 'for-of', spread, and destructuring in ES5/3. */ - // "isolatedModules": true, /* Unconditionally emit imports for unresolved files. */ - - /* Strict Type Checks */ - "strict": true /* Enable all strict type checks. */ - // "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */ - // "strictNullChecks": true, /* Enable strict null checks. */ - // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */ - // "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */ - - /* Additional Checks */ - // "noUnusedLocals": true, /* Report errors on unused locals. */ - // "noUnusedParameters": true, /* Report errors on unused parameters. */ - // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ - // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ - - /* Module Resolution Options */ - // "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */ - // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */ - // "paths": {}, /* List of path mapping entries for module names to locations relative to the 'baseUrl'. */ - // "rootDirs": [], /* List of root folders whose combined content represent the structure of the project at runtime. */ - // "typeRoots": [], /* List of folders to include type definitions from. */ - // "types": [], /* Type declaration files to be included in compilation. */ - // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ - - /* SourceMap Options */ - // "sourceRoot": "./", /* Specify the location where debugger should locate TypeScript files instead of source locations. */ - // "mapRoot": "./", /* Specify the location where debugger should locate map files instead of generated locations. */ - // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */ - // "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */ - - /* Experimental Options */ - // "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */ - // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */ - } +{ + "compilerOptions": { + /* Basic Options */ + "target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', or 'ESNEXT'. */ + "module": "commonjs", /* Specify module code generation: 'commonjs', 'amd', 'system', 'umd' or 'es2015'. */ + "lib": ["es5","es2015.core"], /* Specify library files to be included in the compilation: */ + // "allowJs": true, /* Allow javascript files to be compiled. */ + // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */ + // "declaration": true, /* Generates corresponding '.d.ts' file. */ + // "sourceMap": true, /* Generates corresponding '.map' file. */ + // "outFile": "./", /* Concatenate and emit output to single file. */ + // "outDir": "./", /* Redirect output structure to the directory. */ + // "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */ + // "removeComments": true, /* Do not emit comments to output. */ + // "noEmit": true, /* Do not emit outputs. */ + // "importHelpers": true, /* Import emit helpers from 'tslib'. */ + // "downlevelIteration": true, /* Use full down-level iteration for iterables and arrays for 'for-of', spread, and destructuring in ES5/3. */ + // "isolatedModules": true, /* Unconditionally emit imports for unresolved files. */ + + /* Strict Type Checks */ + "strict": true /* Enable all strict type checks. */ + // "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */ + // "strictNullChecks": true, /* Enable strict null checks. */ + // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */ + // "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */ + + /* Additional Checks */ + // "noUnusedLocals": true, /* Report errors on unused locals. */ + // "noUnusedParameters": true, /* Report errors on unused parameters. */ + // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ + // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ + + /* Module Resolution Options */ + // "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */ + // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */ + // "paths": {}, /* List of path mapping entries for module names to locations relative to the 'baseUrl'. */ + // "rootDirs": [], /* List of root folders whose combined content represent the structure of the project at runtime. */ + // "typeRoots": [], /* List of folders to include type definitions from. */ + // "types": [], /* Type declaration files to be included in compilation. */ + // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ + + /* SourceMap Options */ + // "sourceRoot": "./", /* Specify the location where debugger should locate TypeScript files instead of source locations. */ + // "mapRoot": "./", /* Specify the location where debugger should locate map files instead of generated locations. */ + // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */ + // "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */ + + /* Experimental Options */ + // "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */ + // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */ + } } \ No newline at end of file diff --git a/tests/baselines/reference/tsConfig/Initialized TSConfig with list compiler options/tsconfig.json b/tests/baselines/reference/tsConfig/Initialized TSConfig with list compiler options/tsconfig.json index 434e886b25..b1e048551d 100644 --- a/tests/baselines/reference/tsConfig/Initialized TSConfig with list compiler options/tsconfig.json +++ b/tests/baselines/reference/tsConfig/Initialized TSConfig with list compiler options/tsconfig.json @@ -1,52 +1,52 @@ -{ - "compilerOptions": { - /* Basic Options */ - "target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', or 'ESNEXT'. */ - "module": "commonjs", /* Specify module code generation: 'commonjs', 'amd', 'system', 'umd' or 'es2015'. */ - // "lib": [], /* Specify library files to be included in the compilation: */ - // "allowJs": true, /* Allow javascript files to be compiled. */ - // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */ - // "declaration": true, /* Generates corresponding '.d.ts' file. */ - // "sourceMap": true, /* Generates corresponding '.map' file. */ - // "outFile": "./", /* Concatenate and emit output to single file. */ - // "outDir": "./", /* Redirect output structure to the directory. */ - // "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */ - // "removeComments": true, /* Do not emit comments to output. */ - // "noEmit": true, /* Do not emit outputs. */ - // "importHelpers": true, /* Import emit helpers from 'tslib'. */ - // "downlevelIteration": true, /* Use full down-level iteration for iterables and arrays for 'for-of', spread, and destructuring in ES5/3. */ - // "isolatedModules": true, /* Unconditionally emit imports for unresolved files. */ - - /* Strict Type Checks */ - "strict": true, /* Enable all strict type checks. */ - // "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */ - // "strictNullChecks": true, /* Enable strict null checks. */ - // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */ - // "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */ - - /* Additional Checks */ - // "noUnusedLocals": true, /* Report errors on unused locals. */ - // "noUnusedParameters": true, /* Report errors on unused parameters. */ - // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ - // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ - - /* Module Resolution Options */ - // "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */ - // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */ - // "paths": {}, /* List of path mapping entries for module names to locations relative to the 'baseUrl'. */ - // "rootDirs": [], /* List of root folders whose combined content represent the structure of the project at runtime. */ - // "typeRoots": [], /* List of folders to include type definitions from. */ - "types": ["jquery","mocha"] /* Type declaration files to be included in compilation. */ - // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ - - /* SourceMap Options */ - // "sourceRoot": "./", /* Specify the location where debugger should locate TypeScript files instead of source locations. */ - // "mapRoot": "./", /* Specify the location where debugger should locate map files instead of generated locations. */ - // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */ - // "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */ - - /* Experimental Options */ - // "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */ - // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */ - } +{ + "compilerOptions": { + /* Basic Options */ + "target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', or 'ESNEXT'. */ + "module": "commonjs", /* Specify module code generation: 'commonjs', 'amd', 'system', 'umd' or 'es2015'. */ + // "lib": [], /* Specify library files to be included in the compilation: */ + // "allowJs": true, /* Allow javascript files to be compiled. */ + // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */ + // "declaration": true, /* Generates corresponding '.d.ts' file. */ + // "sourceMap": true, /* Generates corresponding '.map' file. */ + // "outFile": "./", /* Concatenate and emit output to single file. */ + // "outDir": "./", /* Redirect output structure to the directory. */ + // "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */ + // "removeComments": true, /* Do not emit comments to output. */ + // "noEmit": true, /* Do not emit outputs. */ + // "importHelpers": true, /* Import emit helpers from 'tslib'. */ + // "downlevelIteration": true, /* Use full down-level iteration for iterables and arrays for 'for-of', spread, and destructuring in ES5/3. */ + // "isolatedModules": true, /* Unconditionally emit imports for unresolved files. */ + + /* Strict Type Checks */ + "strict": true, /* Enable all strict type checks. */ + // "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */ + // "strictNullChecks": true, /* Enable strict null checks. */ + // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */ + // "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */ + + /* Additional Checks */ + // "noUnusedLocals": true, /* Report errors on unused locals. */ + // "noUnusedParameters": true, /* Report errors on unused parameters. */ + // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ + // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ + + /* Module Resolution Options */ + // "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */ + // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */ + // "paths": {}, /* List of path mapping entries for module names to locations relative to the 'baseUrl'. */ + // "rootDirs": [], /* List of root folders whose combined content represent the structure of the project at runtime. */ + // "typeRoots": [], /* List of folders to include type definitions from. */ + "types": ["jquery","mocha"] /* Type declaration files to be included in compilation. */ + // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ + + /* SourceMap Options */ + // "sourceRoot": "./", /* Specify the location where debugger should locate TypeScript files instead of source locations. */ + // "mapRoot": "./", /* Specify the location where debugger should locate map files instead of generated locations. */ + // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */ + // "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */ + + /* Experimental Options */ + // "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */ + // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */ + } } \ No newline at end of file From d906e91236c6363e22154ae5fa18f5b179b1f036 Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Wed, 22 Mar 2017 12:01:08 -0700 Subject: [PATCH 21/24] Code review comments --- src/compiler/commandLineParser.ts | 58 +++++++++---------- src/compiler/diagnosticMessages.json | 30 +++++----- .../tsconfig.json | 14 ++--- .../tsconfig.json | 14 ++--- .../tsconfig.json | 14 ++--- .../tsconfig.json | 14 ++--- .../tsconfig.json | 14 ++--- .../tsconfig.json | 14 ++--- .../tsconfig.json | 14 ++--- .../tsconfig.json | 14 ++--- 10 files changed, 100 insertions(+), 100 deletions(-) diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts index bc9d090edd..598906cb05 100644 --- a/src/compiler/commandLineParser.ts +++ b/src/compiler/commandLineParser.ts @@ -15,7 +15,7 @@ namespace ts { shortName: "h", type: "boolean", showInSimplifiedHelpView: true, - category: Diagnostics.CommandLine_Options, + category: Diagnostics.Command_line_Options, description: Diagnostics.Print_this_message, }, { @@ -27,7 +27,7 @@ namespace ts { name: "all", type: "boolean", showInSimplifiedHelpView: true, - category: Diagnostics.CommandLine_Options, + category: Diagnostics.Command_line_Options, description: Diagnostics.Show_all_compiler_options, }, { @@ -35,14 +35,14 @@ namespace ts { shortName: "v", type: "boolean", showInSimplifiedHelpView: true, - category: Diagnostics.CommandLine_Options, + category: Diagnostics.Command_line_Options, description: Diagnostics.Print_the_compiler_s_version, }, { name: "init", type: "boolean", showInSimplifiedHelpView: true, - category: Diagnostics.CommandLine_Options, + category: Diagnostics.Command_line_Options, description: Diagnostics.Initializes_a_TypeScript_project_and_creates_a_tsconfig_json_file, }, { @@ -51,7 +51,7 @@ namespace ts { type: "string", isFilePath: true, showInSimplifiedHelpView: true, - category: Diagnostics.CommandLine_Options, + category: Diagnostics.Command_line_Options, paramType: Diagnostics.FILE_OR_DIRECTORY, description: Diagnostics.Compile_the_project_given_the_path_to_its_configuration_file_or_to_a_folder_with_a_tsconfig_json, }, @@ -59,7 +59,7 @@ namespace ts { name: "pretty", type: "boolean", showInSimplifiedHelpView: true, - category: Diagnostics.CommandLine_Options, + category: Diagnostics.Command_line_Options, description: Diagnostics.Stylize_errors_and_messages_using_color_and_context_experimental }, { @@ -67,7 +67,7 @@ namespace ts { shortName: "w", type: "boolean", showInSimplifiedHelpView: true, - category: Diagnostics.CommandLine_Options, + category: Diagnostics.Command_line_Options, description: Diagnostics.Watch_input_files, }, @@ -230,13 +230,13 @@ namespace ts { name: "downlevelIteration", type: "boolean", category: Diagnostics.Basic_Options, - description: Diagnostics.Use_full_down_level_iteration_for_iterables_and_arrays_for_for_of_spread_and_destructuring_in_ES5_Slash3 + description: Diagnostics.Provide_full_support_for_iterables_in_for_of_spread_and_destructuring_when_targeting_ES5_or_ES3 }, { name: "isolatedModules", type: "boolean", category: Diagnostics.Basic_Options, - description: Diagnostics.Unconditionally_emit_imports_for_unresolved_files + description: Diagnostics.Transpile_each_file_as_a_separate_module_similar_to_ts_transpileModule }, // Strict Type Checks @@ -244,35 +244,35 @@ namespace ts { name: "strict", type: "boolean", showInSimplifiedHelpView: true, - category: Diagnostics.Strict_Type_Checks, - description: Diagnostics.Enable_all_strict_type_checks + category: Diagnostics.Strict_Type_Checking_Options, + description: Diagnostics.Enable_all_strict_type_checking_options }, { name: "noImplicitAny", type: "boolean", showInSimplifiedHelpView: true, - category: Diagnostics.Strict_Type_Checks, + category: Diagnostics.Strict_Type_Checking_Options, description: Diagnostics.Raise_error_on_expressions_and_declarations_with_an_implied_any_type, }, { name: "strictNullChecks", type: "boolean", showInSimplifiedHelpView: true, - category: Diagnostics.Strict_Type_Checks, + category: Diagnostics.Strict_Type_Checking_Options, description: Diagnostics.Enable_strict_null_checks }, { name: "noImplicitThis", type: "boolean", showInSimplifiedHelpView: true, - category: Diagnostics.Strict_Type_Checks, + category: Diagnostics.Strict_Type_Checking_Options, description: Diagnostics.Raise_error_on_this_expressions_with_an_implied_any_type, }, { name: "alwaysStrict", type: "boolean", showInSimplifiedHelpView: true, - category: Diagnostics.Strict_Type_Checks, + category: Diagnostics.Strict_Type_Checking_Options, description: Diagnostics.Parse_in_strict_mode_and_emit_use_strict_for_each_source_file }, @@ -331,7 +331,7 @@ namespace ts { type: "object", isTSConfigOnly: true, category: Diagnostics.Module_Resolution_Options, - description: Diagnostics.List_of_path_mapping_entries_for_module_names_to_locations_relative_to_the_baseUrl + description: Diagnostics.A_series_of_entries_which_re_map_imports_to_lookup_locations_relative_to_the_baseUrl }, { @@ -346,7 +346,7 @@ namespace ts { isFilePath: true }, category: Diagnostics.Module_Resolution_Options, - description: Diagnostics.List_of_root_folders_whose_combined_content_represent_the_structure_of_the_project_at_runtime + description: Diagnostics.List_of_root_folders_whose_combined_content_represents_the_structure_of_the_project_at_runtime }, { name: "typeRoots", @@ -383,7 +383,7 @@ namespace ts { type: "string", isFilePath: true, paramType: Diagnostics.LOCATION, - category: Diagnostics.SourceMap_Options, + category: Diagnostics.Source_Map_Options, description: Diagnostics.Specify_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations, }, { @@ -391,19 +391,19 @@ namespace ts { type: "string", isFilePath: true, paramType: Diagnostics.LOCATION, - category: Diagnostics.SourceMap_Options, + category: Diagnostics.Source_Map_Options, description: Diagnostics.Specify_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations, }, { name: "inlineSourceMap", type: "boolean", - category: Diagnostics.SourceMap_Options, + category: Diagnostics.Source_Map_Options, description: Diagnostics.Emit_a_single_file_with_source_maps_instead_of_having_a_separate_file }, { name: "inlineSources", type: "boolean", - category: Diagnostics.SourceMap_Options, + category: Diagnostics.Source_Map_Options, description: Diagnostics.Emit_the_source_alongside_the_sourcemaps_within_a_single_file_requires_inlineSourceMap_or_sourceMap_to_be_set }, @@ -438,7 +438,7 @@ namespace ts { name: "extendedDiagnostics", type: "boolean", category: Diagnostics.Advanced_Options, - description: Diagnostics.Show_extended_diagnostic_information + description: Diagnostics.Show_verbose_diagnostic_information }, { name: "traceResolution", @@ -496,7 +496,7 @@ namespace ts { name: "locale", type: "string", category: Diagnostics.Advanced_Options, - description: Diagnostics.The_locale_to_use_to_show_error_messages_e_g_en_us + description: Diagnostics.The_locale_used_when_displaying_messages_to_the_user_e_g_en_us }, { name: "newLine", @@ -512,7 +512,7 @@ namespace ts { name: "noErrorTruncation", type: "boolean", category: Diagnostics.Advanced_Options, - description: Diagnostics.Do_not_truncation_error_messages + description: Diagnostics.Do_not_truncate_error_messages }, { name: "noLib", @@ -524,7 +524,7 @@ namespace ts { name: "noResolve", type: "boolean", category: Diagnostics.Advanced_Options, - description: Diagnostics.Do_not_add_triple_slash_references_or_module_import_targets_to_the_list_of_compiled_files + description: Diagnostics.Do_not_add_triple_slash_references_or_imported_modules_to_the_list_of_compiled_files }, { name: "stripInternal", @@ -536,7 +536,7 @@ namespace ts { name: "disableSizeLimit", type: "boolean", category: Diagnostics.Advanced_Options, - description: Diagnostics.Disable_size_limitation_on_JavaScript_project + description: Diagnostics.Disable_size_limitations_on_JavaScript_projects }, { name: "noImplicitUseStrict", @@ -621,7 +621,7 @@ namespace ts { name: "plugin", type: "object" }, - description: Diagnostics.List_of_Language_Service_plugins + description: Diagnostics.List_of_language_service_plugins } ]; @@ -932,7 +932,7 @@ namespace ts { if (hasProperty(options, name)) { // tsconfig only options cannot be specified via command line, // so we can assume that only types that can appear here string | number | boolean - if (optionsNameMap.has(name) && optionsNameMap.get(name).category === Diagnostics.CommandLine_Options) { + if (optionsNameMap.has(name) && optionsNameMap.get(name).category === Diagnostics.Command_line_Options) { continue; } const value = options[name]; @@ -987,7 +987,7 @@ namespace ts { function writeConfigurations() { // Filter applicable options to place in the file const categorizedOptions = reduceLeft( - filter(optionDeclarations, o => o.category !== Diagnostics.CommandLine_Options && o.category !== Diagnostics.Advanced_Options), + filter(optionDeclarations, o => o.category !== Diagnostics.Command_line_Options && o.category !== Diagnostics.Advanced_Options), (memo, value) => { if (value.category) { const name = getLocaleSpecificMessage(value.category); diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index b60f49076e..92812604b8 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -3045,7 +3045,7 @@ "category": "Message", "code": 6149 }, - "Show extended diagnostic information.": { + "Show verbose diagnostic information.": { "category": "Message", "code": 6150 }, @@ -3057,7 +3057,7 @@ "category": "Message", "code": 6152 }, - "Unconditionally emit imports for unresolved files.": { + "Transpile each file as a separate module (similar to 'ts.transpileModule').": { "category": "Message", "code": 6153 }, @@ -3069,11 +3069,11 @@ "category": "Message", "code": 6155 }, - "The locale to use to show error messages, e.g. 'en-us'.": { + "The locale used when displaying messages to the user (e.g. 'en-us')": { "category": "Message", "code": 6156 }, - "Do not generate custom helper functions like __extends in compiled output.": { + "Do not generate custom helper functions like '__extends' in compiled output.": { "category": "Message", "code": 6157 }, @@ -3081,7 +3081,7 @@ "category": "Message", "code": 6158 }, - "Do not add triple-slash references or module import targets to the list of compiled files.": { + "Do not add triple-slash references or imported modules to the list of compiled files.": { "category": "Message", "code": 6159 }, @@ -3093,7 +3093,7 @@ "category": "Message", "code": 6161 }, - "Disable size limitation on JavaScript project.": { + "Disable size limitations on JavaScript projects.": { "category": "Message", "code": 6162 }, @@ -3105,7 +3105,7 @@ "category": "Message", "code": 6164 }, - "Do not truncation error messages.": { + "Do not truncate error messages.": { "category": "Message", "code": 6165 }, @@ -3113,11 +3113,11 @@ "category": "Message", "code": 6166 }, - "List of path mapping entries for module names to locations relative to the 'baseUrl'.": { + "A series of entries which re-map imports to lookup locations relative to the 'baseUrl'.": { "category": "Message", "code": 6167 }, - "List of root folders whose combined content represent the structure of the project at runtime.": { + "List of root folders whose combined content represents the structure of the project at runtime.": { "category": "Message", "code": 6168 }, @@ -3129,7 +3129,7 @@ "category": "Message", "code": 6170 }, - "CommandLine Options": { + "Command-line Options": { "category": "Message", "code": 6171 }, @@ -3137,7 +3137,7 @@ "category": "Message", "code": 6172 }, - "Strict Type Checks": { + "Strict Type-Checking Options": { "category": "Message", "code": 6173 }, @@ -3145,7 +3145,7 @@ "category": "Message", "code": 6174 }, - "SourceMap Options": { + "Source Map Options": { "category": "Message", "code": 6175 }, @@ -3161,15 +3161,15 @@ "category": "Message", "code": 6178 }, - "Use full down-level iteration for iterables and arrays for 'for-of', spread, and destructuring in ES5/3.": { + "Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'.": { "category": "Message", "code": 6179 }, - "Enable all strict type checks.": { + "Enable all strict type-checking options.": { "category": "Message", "code": 6180 }, - "List of Language Service plugins.": { + "List of language service plugins.": { "category": "Message", "code": 6181 }, diff --git a/tests/baselines/reference/tsConfig/Default initialized TSConfig/tsconfig.json b/tests/baselines/reference/tsConfig/Default initialized TSConfig/tsconfig.json index f26b471d2c..5918c273ce 100644 --- a/tests/baselines/reference/tsConfig/Default initialized TSConfig/tsconfig.json +++ b/tests/baselines/reference/tsConfig/Default initialized TSConfig/tsconfig.json @@ -14,11 +14,11 @@ // "removeComments": true, /* Do not emit comments to output. */ // "noEmit": true, /* Do not emit outputs. */ // "importHelpers": true, /* Import emit helpers from 'tslib'. */ - // "downlevelIteration": true, /* Use full down-level iteration for iterables and arrays for 'for-of', spread, and destructuring in ES5/3. */ - // "isolatedModules": true, /* Unconditionally emit imports for unresolved files. */ + // "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */ + // "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */ - /* Strict Type Checks */ - "strict": true /* Enable all strict type checks. */ + /* Strict Type-Checking Options */ + "strict": true /* Enable all strict type-checking options. */ // "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */ // "strictNullChecks": true, /* Enable strict null checks. */ // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */ @@ -33,13 +33,13 @@ /* Module Resolution Options */ // "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */ // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */ - // "paths": {}, /* List of path mapping entries for module names to locations relative to the 'baseUrl'. */ - // "rootDirs": [], /* List of root folders whose combined content represent the structure of the project at runtime. */ + // "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */ + // "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */ // "typeRoots": [], /* List of folders to include type definitions from. */ // "types": [], /* Type declaration files to be included in compilation. */ // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ - /* SourceMap Options */ + /* Source Map Options */ // "sourceRoot": "./", /* Specify the location where debugger should locate TypeScript files instead of source locations. */ // "mapRoot": "./", /* Specify the location where debugger should locate map files instead of generated locations. */ // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */ diff --git a/tests/baselines/reference/tsConfig/Initialized TSConfig with boolean value compiler options/tsconfig.json b/tests/baselines/reference/tsConfig/Initialized TSConfig with boolean value compiler options/tsconfig.json index 2dc7f0564b..38c4542b40 100644 --- a/tests/baselines/reference/tsConfig/Initialized TSConfig with boolean value compiler options/tsconfig.json +++ b/tests/baselines/reference/tsConfig/Initialized TSConfig with boolean value compiler options/tsconfig.json @@ -14,11 +14,11 @@ // "removeComments": true, /* Do not emit comments to output. */ // "noEmit": true, /* Do not emit outputs. */ // "importHelpers": true, /* Import emit helpers from 'tslib'. */ - // "downlevelIteration": true, /* Use full down-level iteration for iterables and arrays for 'for-of', spread, and destructuring in ES5/3. */ - // "isolatedModules": true, /* Unconditionally emit imports for unresolved files. */ + // "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */ + // "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */ - /* Strict Type Checks */ - "strict": true, /* Enable all strict type checks. */ + /* Strict Type-Checking Options */ + "strict": true, /* Enable all strict type-checking options. */ // "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */ // "strictNullChecks": true, /* Enable strict null checks. */ // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */ @@ -33,13 +33,13 @@ /* Module Resolution Options */ // "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */ // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */ - // "paths": {}, /* List of path mapping entries for module names to locations relative to the 'baseUrl'. */ - // "rootDirs": [], /* List of root folders whose combined content represent the structure of the project at runtime. */ + // "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */ + // "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */ // "typeRoots": [], /* List of folders to include type definitions from. */ // "types": [], /* Type declaration files to be included in compilation. */ // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ - /* SourceMap Options */ + /* Source Map Options */ // "sourceRoot": "./", /* Specify the location where debugger should locate TypeScript files instead of source locations. */ // "mapRoot": "./", /* Specify the location where debugger should locate map files instead of generated locations. */ // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */ diff --git a/tests/baselines/reference/tsConfig/Initialized TSConfig with enum value compiler options/tsconfig.json b/tests/baselines/reference/tsConfig/Initialized TSConfig with enum value compiler options/tsconfig.json index 48a7fd7784..d948b64815 100644 --- a/tests/baselines/reference/tsConfig/Initialized TSConfig with enum value compiler options/tsconfig.json +++ b/tests/baselines/reference/tsConfig/Initialized TSConfig with enum value compiler options/tsconfig.json @@ -14,11 +14,11 @@ // "removeComments": true, /* Do not emit comments to output. */ // "noEmit": true, /* Do not emit outputs. */ // "importHelpers": true, /* Import emit helpers from 'tslib'. */ - // "downlevelIteration": true, /* Use full down-level iteration for iterables and arrays for 'for-of', spread, and destructuring in ES5/3. */ - // "isolatedModules": true, /* Unconditionally emit imports for unresolved files. */ + // "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */ + // "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */ - /* Strict Type Checks */ - "strict": true /* Enable all strict type checks. */ + /* Strict Type-Checking Options */ + "strict": true /* Enable all strict type-checking options. */ // "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */ // "strictNullChecks": true, /* Enable strict null checks. */ // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */ @@ -33,13 +33,13 @@ /* Module Resolution Options */ // "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */ // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */ - // "paths": {}, /* List of path mapping entries for module names to locations relative to the 'baseUrl'. */ - // "rootDirs": [], /* List of root folders whose combined content represent the structure of the project at runtime. */ + // "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */ + // "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */ // "typeRoots": [], /* List of folders to include type definitions from. */ // "types": [], /* Type declaration files to be included in compilation. */ // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ - /* SourceMap Options */ + /* Source Map Options */ // "sourceRoot": "./", /* Specify the location where debugger should locate TypeScript files instead of source locations. */ // "mapRoot": "./", /* Specify the location where debugger should locate map files instead of generated locations. */ // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */ diff --git a/tests/baselines/reference/tsConfig/Initialized TSConfig with files options/tsconfig.json b/tests/baselines/reference/tsConfig/Initialized TSConfig with files options/tsconfig.json index a2f4e6bd99..70870f296e 100644 --- a/tests/baselines/reference/tsConfig/Initialized TSConfig with files options/tsconfig.json +++ b/tests/baselines/reference/tsConfig/Initialized TSConfig with files options/tsconfig.json @@ -14,11 +14,11 @@ // "removeComments": true, /* Do not emit comments to output. */ // "noEmit": true, /* Do not emit outputs. */ // "importHelpers": true, /* Import emit helpers from 'tslib'. */ - // "downlevelIteration": true, /* Use full down-level iteration for iterables and arrays for 'for-of', spread, and destructuring in ES5/3. */ - // "isolatedModules": true, /* Unconditionally emit imports for unresolved files. */ + // "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */ + // "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */ - /* Strict Type Checks */ - "strict": true /* Enable all strict type checks. */ + /* Strict Type-Checking Options */ + "strict": true /* Enable all strict type-checking options. */ // "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */ // "strictNullChecks": true, /* Enable strict null checks. */ // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */ @@ -33,13 +33,13 @@ /* Module Resolution Options */ // "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */ // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */ - // "paths": {}, /* List of path mapping entries for module names to locations relative to the 'baseUrl'. */ - // "rootDirs": [], /* List of root folders whose combined content represent the structure of the project at runtime. */ + // "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */ + // "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */ // "typeRoots": [], /* List of folders to include type definitions from. */ // "types": [], /* Type declaration files to be included in compilation. */ // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ - /* SourceMap Options */ + /* Source Map Options */ // "sourceRoot": "./", /* Specify the location where debugger should locate TypeScript files instead of source locations. */ // "mapRoot": "./", /* Specify the location where debugger should locate map files instead of generated locations. */ // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */ diff --git a/tests/baselines/reference/tsConfig/Initialized TSConfig with incorrect compiler option value/tsconfig.json b/tests/baselines/reference/tsConfig/Initialized TSConfig with incorrect compiler option value/tsconfig.json index 62bfc7ca26..3eabb0894f 100644 --- a/tests/baselines/reference/tsConfig/Initialized TSConfig with incorrect compiler option value/tsconfig.json +++ b/tests/baselines/reference/tsConfig/Initialized TSConfig with incorrect compiler option value/tsconfig.json @@ -14,11 +14,11 @@ // "removeComments": true, /* Do not emit comments to output. */ // "noEmit": true, /* Do not emit outputs. */ // "importHelpers": true, /* Import emit helpers from 'tslib'. */ - // "downlevelIteration": true, /* Use full down-level iteration for iterables and arrays for 'for-of', spread, and destructuring in ES5/3. */ - // "isolatedModules": true, /* Unconditionally emit imports for unresolved files. */ + // "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */ + // "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */ - /* Strict Type Checks */ - "strict": true /* Enable all strict type checks. */ + /* Strict Type-Checking Options */ + "strict": true /* Enable all strict type-checking options. */ // "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */ // "strictNullChecks": true, /* Enable strict null checks. */ // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */ @@ -33,13 +33,13 @@ /* Module Resolution Options */ // "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */ // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */ - // "paths": {}, /* List of path mapping entries for module names to locations relative to the 'baseUrl'. */ - // "rootDirs": [], /* List of root folders whose combined content represent the structure of the project at runtime. */ + // "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */ + // "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */ // "typeRoots": [], /* List of folders to include type definitions from. */ // "types": [], /* Type declaration files to be included in compilation. */ // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ - /* SourceMap Options */ + /* Source Map Options */ // "sourceRoot": "./", /* Specify the location where debugger should locate TypeScript files instead of source locations. */ // "mapRoot": "./", /* Specify the location where debugger should locate map files instead of generated locations. */ // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */ diff --git a/tests/baselines/reference/tsConfig/Initialized TSConfig with incorrect compiler option/tsconfig.json b/tests/baselines/reference/tsConfig/Initialized TSConfig with incorrect compiler option/tsconfig.json index f26b471d2c..5918c273ce 100644 --- a/tests/baselines/reference/tsConfig/Initialized TSConfig with incorrect compiler option/tsconfig.json +++ b/tests/baselines/reference/tsConfig/Initialized TSConfig with incorrect compiler option/tsconfig.json @@ -14,11 +14,11 @@ // "removeComments": true, /* Do not emit comments to output. */ // "noEmit": true, /* Do not emit outputs. */ // "importHelpers": true, /* Import emit helpers from 'tslib'. */ - // "downlevelIteration": true, /* Use full down-level iteration for iterables and arrays for 'for-of', spread, and destructuring in ES5/3. */ - // "isolatedModules": true, /* Unconditionally emit imports for unresolved files. */ + // "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */ + // "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */ - /* Strict Type Checks */ - "strict": true /* Enable all strict type checks. */ + /* Strict Type-Checking Options */ + "strict": true /* Enable all strict type-checking options. */ // "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */ // "strictNullChecks": true, /* Enable strict null checks. */ // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */ @@ -33,13 +33,13 @@ /* Module Resolution Options */ // "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */ // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */ - // "paths": {}, /* List of path mapping entries for module names to locations relative to the 'baseUrl'. */ - // "rootDirs": [], /* List of root folders whose combined content represent the structure of the project at runtime. */ + // "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */ + // "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */ // "typeRoots": [], /* List of folders to include type definitions from. */ // "types": [], /* Type declaration files to be included in compilation. */ // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ - /* SourceMap Options */ + /* Source Map Options */ // "sourceRoot": "./", /* Specify the location where debugger should locate TypeScript files instead of source locations. */ // "mapRoot": "./", /* Specify the location where debugger should locate map files instead of generated locations. */ // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */ diff --git a/tests/baselines/reference/tsConfig/Initialized TSConfig with list compiler options with enum value/tsconfig.json b/tests/baselines/reference/tsConfig/Initialized TSConfig with list compiler options with enum value/tsconfig.json index 02a1724add..b88ac604c1 100644 --- a/tests/baselines/reference/tsConfig/Initialized TSConfig with list compiler options with enum value/tsconfig.json +++ b/tests/baselines/reference/tsConfig/Initialized TSConfig with list compiler options with enum value/tsconfig.json @@ -14,11 +14,11 @@ // "removeComments": true, /* Do not emit comments to output. */ // "noEmit": true, /* Do not emit outputs. */ // "importHelpers": true, /* Import emit helpers from 'tslib'. */ - // "downlevelIteration": true, /* Use full down-level iteration for iterables and arrays for 'for-of', spread, and destructuring in ES5/3. */ - // "isolatedModules": true, /* Unconditionally emit imports for unresolved files. */ + // "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */ + // "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */ - /* Strict Type Checks */ - "strict": true /* Enable all strict type checks. */ + /* Strict Type-Checking Options */ + "strict": true /* Enable all strict type-checking options. */ // "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */ // "strictNullChecks": true, /* Enable strict null checks. */ // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */ @@ -33,13 +33,13 @@ /* Module Resolution Options */ // "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */ // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */ - // "paths": {}, /* List of path mapping entries for module names to locations relative to the 'baseUrl'. */ - // "rootDirs": [], /* List of root folders whose combined content represent the structure of the project at runtime. */ + // "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */ + // "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */ // "typeRoots": [], /* List of folders to include type definitions from. */ // "types": [], /* Type declaration files to be included in compilation. */ // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ - /* SourceMap Options */ + /* Source Map Options */ // "sourceRoot": "./", /* Specify the location where debugger should locate TypeScript files instead of source locations. */ // "mapRoot": "./", /* Specify the location where debugger should locate map files instead of generated locations. */ // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */ diff --git a/tests/baselines/reference/tsConfig/Initialized TSConfig with list compiler options/tsconfig.json b/tests/baselines/reference/tsConfig/Initialized TSConfig with list compiler options/tsconfig.json index b1e048551d..db838e21d2 100644 --- a/tests/baselines/reference/tsConfig/Initialized TSConfig with list compiler options/tsconfig.json +++ b/tests/baselines/reference/tsConfig/Initialized TSConfig with list compiler options/tsconfig.json @@ -14,11 +14,11 @@ // "removeComments": true, /* Do not emit comments to output. */ // "noEmit": true, /* Do not emit outputs. */ // "importHelpers": true, /* Import emit helpers from 'tslib'. */ - // "downlevelIteration": true, /* Use full down-level iteration for iterables and arrays for 'for-of', spread, and destructuring in ES5/3. */ - // "isolatedModules": true, /* Unconditionally emit imports for unresolved files. */ + // "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */ + // "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */ - /* Strict Type Checks */ - "strict": true, /* Enable all strict type checks. */ + /* Strict Type-Checking Options */ + "strict": true, /* Enable all strict type-checking options. */ // "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */ // "strictNullChecks": true, /* Enable strict null checks. */ // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */ @@ -33,13 +33,13 @@ /* Module Resolution Options */ // "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */ // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */ - // "paths": {}, /* List of path mapping entries for module names to locations relative to the 'baseUrl'. */ - // "rootDirs": [], /* List of root folders whose combined content represent the structure of the project at runtime. */ + // "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */ + // "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */ // "typeRoots": [], /* List of folders to include type definitions from. */ "types": ["jquery","mocha"] /* Type declaration files to be included in compilation. */ // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ - /* SourceMap Options */ + /* Source Map Options */ // "sourceRoot": "./", /* Specify the location where debugger should locate TypeScript files instead of source locations. */ // "mapRoot": "./", /* Specify the location where debugger should locate map files instead of generated locations. */ // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */ From 88b88e10551be40c78b083b84f422f71ae125124 Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Wed, 22 Mar 2017 12:41:11 -0700 Subject: [PATCH 22/24] Remove BOM --- src/compiler/commandLineParser.ts | 2 +- src/harness/unittests/initializeTSConfig.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts index 598906cb05..41d71c79ac 100644 --- a/src/compiler/commandLineParser.ts +++ b/src/compiler/commandLineParser.ts @@ -1,4 +1,4 @@ -/// +/// /// /// /// diff --git a/src/harness/unittests/initializeTSConfig.ts b/src/harness/unittests/initializeTSConfig.ts index 4f193d358f..d0bc72d430 100644 --- a/src/harness/unittests/initializeTSConfig.ts +++ b/src/harness/unittests/initializeTSConfig.ts @@ -1,4 +1,4 @@ -/// +/// /// namespace ts { From ae1983bce1a65ecb736c3ce752eb228a4e3227b9 Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Wed, 22 Mar 2017 12:45:36 -0700 Subject: [PATCH 23/24] Show help if `--all` is specifided without `--help` --- src/compiler/tsc.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/tsc.ts b/src/compiler/tsc.ts index a62bad393a..4fd3ecb02b 100644 --- a/src/compiler/tsc.ts +++ b/src/compiler/tsc.ts @@ -225,7 +225,7 @@ namespace ts { return sys.exit(ExitStatus.Success); } - if (commandLine.options.help) { + if (commandLine.options.help || commandLine.options.all) { printVersion(); printHelp(commandLine.options.all); return sys.exit(ExitStatus.Success); From 11d1409f5fd07bd90e64e6128ef90171d2a5b099 Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Wed, 22 Mar 2017 13:01:53 -0700 Subject: [PATCH 24/24] Format else clauses --- Jakefile.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/Jakefile.js b/Jakefile.js index fa5aa141d6..fa4869c192 100644 --- a/Jakefile.js +++ b/Jakefile.js @@ -29,7 +29,8 @@ var thirdParty = "ThirdPartyNoticeText.txt"; var nodeModulesPathPrefix = path.resolve("./node_modules/.bin/") + path.delimiter; if (process.env.path !== undefined) { process.env.path = nodeModulesPathPrefix + process.env.path; -} else if (process.env.PATH !== undefined) { +} +else if (process.env.PATH !== undefined) { process.env.PATH = nodeModulesPathPrefix + process.env.PATH; } @@ -312,13 +313,15 @@ function compileFile(outFile, sources, prereqs, prefixes, useBuiltCompiler, opts if (useDebugMode) { if (opts.inlineSourceMap) { options += " --inlineSourceMap --inlineSources"; - } else { + } + else { options += " -sourcemap"; if (!opts.noMapRoot) { options += " -mapRoot file:///" + path.resolve(path.dirname(outFile)); } } - } else { + } + else { options += " --newLine LF"; } @@ -748,7 +751,8 @@ function exec(cmd, completeHandler, errorHandler) { ex.addListener("error", function (e, status) { if (errorHandler) { errorHandler(e, status); - } else { + } + else { fail("Process exited with code " + status); } }); @@ -1021,7 +1025,8 @@ function acceptBaseline(sourceFolder, targetFolder) { if (filename.substr(filename.length - deleteEnding.length) === deleteEnding) { filename = filename.substr(0, filename.length - deleteEnding.length); fs.unlinkSync(path.join(targetFolder, filename)); - } else { + } + else { var target = path.join(targetFolder, filename); if (fs.existsSync(target)) { fs.unlinkSync(target);