pub struct TypeCheckOptions {Show 18 fields
pub constant_parameters: bool,
pub allow_elided_arguments: bool,
pub allow_extra_arguments: bool,
pub constant_function_declarations: bool,
pub strict_casts: bool,
pub debug_types: bool,
pub allow_type_casts: bool,
pub store_type_mappings: bool,
pub extra_syntax: bool,
pub parse_comments: bool,
pub lsp_mode: bool,
pub record_all_assignments_and_reads: bool,
pub infer_sensible_constraints_in_for_loops: bool,
pub evaluate_exports: bool,
pub max_inline_count: u16,
pub measure_time: bool,
pub advanced_numbers: bool,
pub debug_dts: bool,
}Expand description
Options for type checking TODO figure out compat with tsc
Fields§
§constant_parameters: boolParameters cannot be reassigned
allow_elided_arguments: boolMissing arguments are treated as undefined (thats how JS works)
allow_extra_arguments: boolAddition arguments are allowed
constant_function_declarations: boolGiven a function x, x = 2 is not possible
strict_casts: boolWhether auto casts can happen. aka {} + 2 is allowed using the Object’s primitive default
TODO maybe levels
debug_types: boolAny types displayed will be in debug view
allow_type_casts: boolEnables as casts
store_type_mappings: boolFor post type check optimisations and LSP. Stores both expressions and type annotations
extra_syntax: bool?
parse_comments: boolTODO WIP
lsp_mode: boolAllows partial syntax and collects other information for using in editor
record_all_assignments_and_reads: boolCan be used for linting
infer_sensible_constraints_in_for_loops: boolTechnically the i in for (let i = 0; i < ...) can be reassigned to any type. But this behavior isn’t great
and adds work for the inference engine. So this instead picks a basic type instead. This will
raise errors in valid javascript
evaluate_exports: boolEvaluate exports to detect dead code
max_inline_count: u16§measure_time: bool§advanced_numbers: boolEnables two things:
- range and modulo class inference
- modifications to ranges and classes based on operations
debug_dts: boolPrinting internal diagnostics in dts
Trait Implementations§
Source§impl Clone for TypeCheckOptions
impl Clone for TypeCheckOptions
Source§fn clone(&self) -> TypeCheckOptions
fn clone(&self) -> TypeCheckOptions
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for TypeCheckOptions
impl RefUnwindSafe for TypeCheckOptions
impl Send for TypeCheckOptions
impl Sync for TypeCheckOptions
impl Unpin for TypeCheckOptions
impl UnwindSafe for TypeCheckOptions
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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