pub enum ModuleDetectionMode {
Auto,
Legacy,
Force,
}Expand description
Module detection mode
This setting controls how TypeScript determines whether a file is a script or a module. These choices include:
- “auto” (default) - TypeScript will not only look for import and export statements, but it will also check whether the “type” field in a package.json is set to “module” when running with module: nodenext or node16, and check whether the current file is a JSX file when running under jsx: react-jsx.
- “legacy” - The same behavior as 4.6 and prior, usings import and export statements to determine whether a file is a module.
- “force” - Ensures that every non-declaration file is treated as a module.
Variants§
Trait Implementations§
Source§impl Clone for ModuleDetectionMode
impl Clone for ModuleDetectionMode
Source§fn clone(&self) -> ModuleDetectionMode
fn clone(&self) -> ModuleDetectionMode
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for ModuleDetectionMode
Source§impl Debug for ModuleDetectionMode
impl Debug for ModuleDetectionMode
Source§impl Default for ModuleDetectionMode
impl Default for ModuleDetectionMode
Source§fn default() -> ModuleDetectionMode
fn default() -> ModuleDetectionMode
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for ModuleDetectionMode
impl<'de> Deserialize<'de> for ModuleDetectionMode
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for ModuleDetectionMode
impl PartialEq for ModuleDetectionMode
Source§fn eq(&self, other: &ModuleDetectionMode) -> bool
fn eq(&self, other: &ModuleDetectionMode) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for ModuleDetectionMode
Auto Trait Implementations§
impl Freeze for ModuleDetectionMode
impl RefUnwindSafe for ModuleDetectionMode
impl Send for ModuleDetectionMode
impl Sync for ModuleDetectionMode
impl Unpin for ModuleDetectionMode
impl UnsafeUnpin for ModuleDetectionMode
impl UnwindSafe for ModuleDetectionMode
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
Mutably borrows from an owned value. Read more