Skip to main content

CliArgs

Struct CliArgs 

Source
pub struct CliArgs {
Show 139 fields pub all: bool, pub build: bool, pub init: bool, pub list_files_only: bool, pub locale: Option<String>, pub show_config: bool, pub watch: bool, pub project: Option<PathBuf>, pub target: Option<Target>, pub module: Option<Module>, pub lib: Option<Vec<String>>, pub jsx: Option<JsxEmit>, pub jsx_factory: Option<String>, pub jsx_fragment_factory: Option<String>, pub jsx_import_source: Option<String>, pub no_lib: bool, pub use_define_for_class_fields: Option<bool>, pub module_detection: Option<ModuleDetection>, pub experimental_decorators: bool, pub emit_decorator_metadata: bool, pub module_resolution: Option<ModuleResolution>, pub base_url: Option<PathBuf>, pub type_roots: Option<Vec<PathBuf>>, pub types: Option<Vec<String>>, pub root_dirs: Option<Vec<PathBuf>>, pub paths: Option<Vec<String>>, pub plugins: Option<Vec<String>>, pub resolve_json_module: bool, pub resolve_package_json_exports: Option<bool>, pub resolve_package_json_imports: Option<bool>, pub module_suffixes: Option<Vec<String>>, pub allow_arbitrary_extensions: bool, pub allow_importing_ts_extensions: bool, pub rewrite_relative_import_extensions: bool, pub custom_conditions: Option<Vec<String>>, pub no_resolve: bool, pub allow_umd_global_access: bool, pub no_unchecked_side_effect_imports: bool, pub allow_js: bool, pub check_js: bool, pub max_node_module_js_depth: Option<u32>, pub declaration: bool, pub declaration_dir: Option<PathBuf>, pub declaration_map: bool, pub emit_declaration_only: bool, pub source_map: bool, pub inline_source_map: bool, pub inline_sources: bool, pub out_dir: Option<PathBuf>, pub root_dir: Option<PathBuf>, pub out_file: Option<PathBuf>, pub no_emit: bool, pub no_emit_on_error: bool, pub no_emit_helpers: bool, pub import_helpers: bool, pub downlevel_iteration: bool, pub map_root: Option<String>, pub source_root: Option<String>, pub new_line: Option<NewLine>, pub remove_comments: bool, pub preserve_const_enums: bool, pub strip_internal: bool, pub emit_bom: bool, pub es_module_interop: bool, pub allow_synthetic_default_imports: Option<bool>, pub isolated_modules: bool, pub isolated_declarations: bool, pub verbatim_module_syntax: bool, pub force_consistent_casing_in_file_names: Option<bool>, pub preserve_symlinks: bool, pub erasable_syntax_only: bool, pub strict: bool, pub no_implicit_any: Option<bool>, pub strict_null_checks: Option<bool>, pub strict_function_types: Option<bool>, pub strict_bind_call_apply: Option<bool>, pub strict_property_initialization: Option<bool>, pub strict_builtin_iterator_return: Option<bool>, pub no_implicit_this: Option<bool>, pub use_unknown_in_catch_variables: Option<bool>, pub always_strict: Option<bool>, pub no_unused_locals: bool, pub no_unused_parameters: bool, pub exact_optional_property_types: bool, pub no_implicit_returns: bool, pub no_fallthrough_cases_in_switch: bool, pub sound: bool, pub no_unchecked_indexed_access: bool, pub no_implicit_override: bool, pub no_property_access_from_index_signature: bool, pub allow_unreachable_code: Option<bool>, pub allow_unused_labels: Option<bool>, pub skip_default_lib_check: bool, pub skip_lib_check: bool, pub composite: bool, pub incremental: bool, pub ts_build_info_file: Option<PathBuf>, pub disable_referenced_project_load: bool, pub disable_solution_searching: bool, pub disable_source_of_project_reference_redirect: bool, pub diagnostics: bool, pub extended_diagnostics: bool, pub explain_files: bool, pub list_files: bool, pub list_emitted_files: bool, pub trace_resolution: bool, pub trace_dependencies: bool, pub generate_trace: Option<PathBuf>, pub generate_cpu_profile: Option<PathBuf>, pub no_check: bool, pub pretty: Option<bool>, pub no_error_truncation: bool, pub preserve_watch_output: bool, pub watch_file: Option<WatchFileKind>, pub watch_directory: Option<WatchDirectoryKind>, pub fallback_polling: Option<PollingWatchKind>, pub synchronous_watch_directory: bool, pub exclude_directories: Option<Vec<PathBuf>>, pub exclude_files: Option<Vec<PathBuf>>, pub build_verbose: bool, pub dry: bool, pub force: bool, pub clean: bool, pub stop_build_on_errors: bool, pub assume_changes_only_affect_direct_dependencies: bool, pub react_namespace: Option<String>, pub charset: Option<String>, pub imports_not_used_as_values: Option<ImportsNotUsedAsValues>, pub keyof_strings_only: bool, pub no_implicit_use_strict: bool, pub no_strict_generic_checks: bool, pub out: Option<PathBuf>, pub preserve_value_imports: bool, pub suppress_excess_property_errors: bool, pub suppress_implicit_any_index_errors: bool, pub disable_size_limit: bool, pub types_versions_compiler_version: Option<String>, pub batch: bool, pub files: Vec<PathBuf>,
}
Expand description

CLI arguments for the tsz binary.

Fields§

§all: bool

Show all compiler options.

§build: bool

Build one or more projects and their dependencies, if out of date.

§init: bool

Initializes a TypeScript project and creates a tsconfig.json file.

§list_files_only: bool

Print names of files that are part of the compilation and then stop processing.

§locale: Option<String>

Set the language of the messaging from TypeScript.

§show_config: bool

Print the final configuration instead of building.

§watch: bool

Watch input files and recompile on changes.

§project: Option<PathBuf>

Path to tsconfig.json or a directory containing it.

§target: Option<Target>

Set the JavaScript language version for emitted JavaScript.

§module: Option<Module>

Specify what module code is generated.

§lib: Option<Vec<String>>

Specify a set of bundled library declaration files.

§jsx: Option<JsxEmit>

Specify what JSX code is generated.

§jsx_factory: Option<String>

Specify the JSX factory function (e.g. ‘React.createElement’).

§jsx_fragment_factory: Option<String>

Specify the JSX Fragment reference (e.g. ‘React.Fragment’).

§jsx_import_source: Option<String>

Specify module specifier for JSX factory functions (e.g. ‘react’).

§no_lib: bool

Disable including any library files, including the default lib.d.ts.

§use_define_for_class_fields: Option<bool>

Emit ECMAScript-standard-compliant class fields.

§module_detection: Option<ModuleDetection>

Control what method is used to detect module-format JS files.

§experimental_decorators: bool

Enable experimental support for legacy experimental decorators.

§emit_decorator_metadata: bool

Emit design-type metadata for decorated declarations in source files.

§module_resolution: Option<ModuleResolution>

Specify how TypeScript looks up a file from a given module specifier.

§base_url: Option<PathBuf>

Specify the base directory to resolve non-relative module names.

§type_roots: Option<Vec<PathBuf>>

Specify multiple folders that act like ‘./node_modules/@types’.

§types: Option<Vec<String>>

Specify type package names to be included without being referenced in a source file.

§root_dirs: Option<Vec<PathBuf>>

Allow multiple folders to be treated as one when resolving modules.

§paths: Option<Vec<String>>

Specify a set of entries that re-map imports to additional lookup locations. Accepted for CLI compatibility; normally set in tsconfig.json.

§plugins: Option<Vec<String>>

Specify list of language service plugins. Accepted for CLI compatibility; normally set in tsconfig.json.

§resolve_json_module: bool

Enable importing .json files.

§resolve_package_json_exports: Option<bool>

Use the package.json ‘exports’ field when resolving package imports.

§resolve_package_json_imports: Option<bool>

Use the package.json ‘imports’ field when resolving imports.

§module_suffixes: Option<Vec<String>>

List of file name suffixes to search when resolving a module.

§allow_arbitrary_extensions: bool

Enable importing files with any extension, provided a declaration file is present.

§allow_importing_ts_extensions: bool

Allow imports to include TypeScript file extensions.

§rewrite_relative_import_extensions: bool

Rewrite ‘.ts’, ‘.tsx’, ‘.mts’, and ‘.cts’ file extensions in relative import paths.

§custom_conditions: Option<Vec<String>>

Conditions to set in addition to the resolver-specific defaults when resolving imports.

§no_resolve: bool

Disallow ’import’s, ’require’s or ’’s from expanding the number of files.

§allow_umd_global_access: bool

Allow accessing UMD globals from modules.

§no_unchecked_side_effect_imports: bool

Check side effect imports.

§allow_js: bool

Allow JavaScript files to be a part of your program.

§check_js: bool

Enable error reporting in type-checked JavaScript files.

§max_node_module_js_depth: Option<u32>

Specify the maximum folder depth used for checking JavaScript files from ‘node_modules’.

§declaration: bool

Generate .d.ts files from TypeScript and JavaScript files in your project.

§declaration_dir: Option<PathBuf>

Specify the output directory for generated declaration files.

§declaration_map: bool

Create sourcemaps for d.ts files.

§emit_declaration_only: bool

Only output d.ts files and not JavaScript files.

§source_map: bool

Create source map files for emitted JavaScript files.

§inline_source_map: bool

Include sourcemap files inside the emitted JavaScript.

§inline_sources: bool

Include source code in the sourcemaps inside the emitted JavaScript.

§out_dir: Option<PathBuf>

Specify an output folder for all emitted files.

§root_dir: Option<PathBuf>

Specify the root folder within your source files.

§out_file: Option<PathBuf>

Specify a file that bundles all outputs into one JavaScript file.

§no_emit: bool

Disable emitting files from a compilation.

§no_emit_on_error: bool

Disable emitting files if any type checking errors are reported.

§no_emit_helpers: bool

Disable generating custom helper functions like ‘__extends’ in compiled output.

§import_helpers: bool

Allow importing helper functions from tslib once per project.

§downlevel_iteration: bool

Emit more compliant, but verbose and less performant JavaScript for iteration.

§map_root: Option<String>

Specify the location where debugger should locate map files instead of generated locations.

§source_root: Option<String>

Specify the root path for debuggers to find the reference source code.

§new_line: Option<NewLine>

Set the newline character for emitting files.

§remove_comments: bool

Disable emitting comments.

§preserve_const_enums: bool

Disable erasing ‘const enum’ declarations in generated code.

§strip_internal: bool

Disable emitting declarations that have ‘@internal’ in their JSDoc comments.

§emit_bom: bool

Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files.

§es_module_interop: bool

Emit additional JavaScript to ease support for importing CommonJS modules.

§allow_synthetic_default_imports: Option<bool>

Allow ‘import x from y’ when a module doesn’t have a default export.

§isolated_modules: bool

Ensure that each file can be safely transpiled without relying on other imports.

§isolated_declarations: bool

Require sufficient annotation on exports so other tools can trivially generate declaration files.

§verbatim_module_syntax: bool

Do not transform or elide any imports or exports not marked as type-only.

§force_consistent_casing_in_file_names: Option<bool>

Ensure that casing is correct in imports.

§preserve_symlinks: bool

Disable resolving symlinks to their realpath.

§erasable_syntax_only: bool

Do not allow runtime constructs that are not part of ECMAScript.

§strict: bool

Enable all strict type-checking options.

§no_implicit_any: Option<bool>

Enable error reporting for expressions and declarations with an implied ‘any’ type.

§strict_null_checks: Option<bool>

When type checking, take into account ‘null’ and ‘undefined’.

§strict_function_types: Option<bool>

When assigning functions, check to ensure parameters and the return values are subtype-compatible.

§strict_bind_call_apply: Option<bool>

Check that the arguments for ‘bind’, ‘call’, and ‘apply’ methods match the original function.

§strict_property_initialization: Option<bool>

Check for class properties that are declared but not set in the constructor.

§strict_builtin_iterator_return: Option<bool>

Built-in iterators are instantiated with a ‘TReturn’ type of ‘undefined’ instead of ‘any’.

§no_implicit_this: Option<bool>

Enable error reporting when ‘this’ is given the type ‘any’.

§use_unknown_in_catch_variables: Option<bool>

Default catch clause variables as ‘unknown’ instead of ‘any’.

§always_strict: Option<bool>

Ensure ‘use strict’ is always emitted.

§no_unused_locals: bool

Enable error reporting when local variables aren’t read.

§no_unused_parameters: bool

Raise an error when a function parameter isn’t read.

§exact_optional_property_types: bool

Interpret optional property types as written, rather than adding ‘undefined’.

§no_implicit_returns: bool

Enable error reporting for codepaths that do not explicitly return in a function.

§no_fallthrough_cases_in_switch: bool

Enable error reporting for fallthrough cases in switch statements.

§sound: bool

Enable Sound Mode for stricter type checking beyond TypeScript’s defaults. Catches common unsoundness like mutable array covariance, method bivariance, any escapes, and excess properties via sticky freshness. Uses TS9xxx diagnostic codes (TS9001-TS9008).

§no_unchecked_indexed_access: bool

Add ‘undefined’ to a type when accessed using an index.

§no_implicit_override: bool

Ensure overriding members in derived classes are marked with an override modifier.

§no_property_access_from_index_signature: bool

Enforces using indexed accessors for keys declared using an indexed type.

§allow_unreachable_code: Option<bool>

Disable error reporting for unreachable code.

§allow_unused_labels: Option<bool>

Disable error reporting for unused labels.

§skip_default_lib_check: bool

Skip type checking .d.ts files that are included with TypeScript.

§skip_lib_check: bool

Skip type checking all .d.ts files.

§composite: bool

Enable constraints that allow a TypeScript project to be used with project references.

§incremental: bool

Save .tsbuildinfo files to allow for incremental compilation of projects.

§ts_build_info_file: Option<PathBuf>

Specify the path to .tsbuildinfo incremental compilation file.

§disable_referenced_project_load: bool

Reduce the number of projects loaded automatically by TypeScript.

§disable_solution_searching: bool

Opt a project out of multi-project reference checking when editing.

§disable_source_of_project_reference_redirect: bool

Disable preferring source files instead of declaration files when referencing composite projects.

§diagnostics: bool

Output compiler performance information after building.

§extended_diagnostics: bool

Output more detailed compiler performance information after building.

§explain_files: bool

Print files read during the compilation including why it was included.

§list_files: bool

Print all of the files read during the compilation.

§list_emitted_files: bool

Print the names of emitted files after a compilation.

§trace_resolution: bool

Log paths used during the ‘moduleResolution’ process.

§trace_dependencies: bool

Log all dependencies that were resolved during compilation.

§generate_trace: Option<PathBuf>

Generates an event trace and a list of types.

§generate_cpu_profile: Option<PathBuf>

Emit a v8 CPU profile of the compiler run for debugging.

§no_check: bool

Disable full type checking (only critical parse and emit errors will be reported).

§pretty: Option<bool>

Enable color and formatting in TypeScript’s output to make compiler errors easier to read.

§no_error_truncation: bool

Disable truncating types in error messages.

§preserve_watch_output: bool

Disable wiping the console in watch mode.

§watch_file: Option<WatchFileKind>

Specify how the TypeScript watch mode works.

§watch_directory: Option<WatchDirectoryKind>

Specify how directories are watched on systems that lack recursive file-watching functionality.

§fallback_polling: Option<PollingWatchKind>

Specify what approach the watcher should use if the system runs out of native file watchers.

§synchronous_watch_directory: bool

Synchronously call callbacks and update the state of directory watchers.

§exclude_directories: Option<Vec<PathBuf>>

Remove a list of directories from the watch process.

§exclude_files: Option<Vec<PathBuf>>

Remove a list of files from the watch mode’s processing.

§build_verbose: bool

Enable verbose logging (build mode).

§dry: bool

Show what would be built (or deleted, if specified with ‘–clean’).

§force: bool

Build all projects, including those that appear to be up to date.

§clean: bool

Delete the outputs of all projects.

§stop_build_on_errors: bool

Skip building downstream projects on error in upstream project.

§assume_changes_only_affect_direct_dependencies: bool

Have recompiles in projects that use ‘incremental’ and ‘watch’ mode assume changes only affect direct dependencies.

§react_namespace: Option<String>

Deprecated: Specify the object invoked for ‘createElement’ (use –jsxFactory instead).

§charset: Option<String>

Deprecated: In early versions, manually set the text encoding for reading files.

§imports_not_used_as_values: Option<ImportsNotUsedAsValues>

Deprecated: Specify emit/checking behavior for imports that are only used for types.

§keyof_strings_only: bool

Deprecated: Make keyof only return strings instead of string, numbers or symbols.

§no_implicit_use_strict: bool

Deprecated: Disable adding ‘use strict’ directives in emitted JavaScript files.

§no_strict_generic_checks: bool

Deprecated: Disable strict checking of generic signatures in function types.

§out: Option<PathBuf>

Deprecated: Use ‘outFile’ instead.

§preserve_value_imports: bool

Deprecated: Preserve unused imported values in the JavaScript output.

§suppress_excess_property_errors: bool

Deprecated: Disable reporting of excess property errors during the creation of object literals.

§suppress_implicit_any_index_errors: bool

Deprecated: Suppress ‘noImplicitAny’ errors when indexing objects that lack index signatures.

§disable_size_limit: bool

Remove the 20mb cap on total source code size for JavaScript files in the TypeScript language server.

§types_versions_compiler_version: Option<String>

Override the compiler version used for typesVersions resolution (or set TSZ_TYPES_VERSIONS_COMPILER_VERSION).

§batch: bool

Enter batch mode: read project paths from stdin, one per line, compile each, and print diagnostics followed by a sentinel line. Used by the conformance runner’s process pool for amortized startup.

§files: Vec<PathBuf>

Input files to compile.

Trait Implementations§

Source§

impl Args for CliArgs

Source§

fn group_id() -> Option<Id>

Report the ArgGroup::id for this set of arguments
Source§

fn augment_args<'b>(__clap_app: Command) -> Command

Append to Command so it can instantiate Self via FromArgMatches::from_arg_matches_mut Read more
Source§

fn augment_args_for_update<'b>(__clap_app: Command) -> Command

Append to Command so it can instantiate self via FromArgMatches::update_from_arg_matches_mut Read more
Source§

impl CommandFactory for CliArgs

Source§

fn command<'b>() -> Command

Build a Command that can instantiate Self. Read more
Source§

fn command_for_update<'b>() -> Command

Build a Command that can update self. Read more
Source§

impl Debug for CliArgs

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl FromArgMatches for CliArgs

Source§

fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
Source§

fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
Source§

fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

fn update_from_arg_matches_mut( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

impl Parser for CliArgs

Source§

fn parse() -> Self

Parse from std::env::args_os(), exit on error.
Source§

fn try_parse() -> Result<Self, Error>

Parse from std::env::args_os(), return Err on error.
Source§

fn parse_from<I, T>(itr: I) -> Self
where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Parse from iterator, exit on error.
Source§

fn try_parse_from<I, T>(itr: I) -> Result<Self, Error>
where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Parse from iterator, return Err on error.
Source§

fn update_from<I, T>(&mut self, itr: I)
where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Update from iterator, exit on error. Read more
Source§

fn try_update_from<I, T>(&mut self, itr: I) -> Result<(), Error>
where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Update from iterator, return Err on error.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more