Enum tsconfig::TypeAcquisition[][src]

pub enum TypeAcquisition {
    Bool(bool),
    Object {
        enable: bool,
        include: Option<Vec<String>>,
        exclude: Option<Vec<String>>,
        disable_filename_based_type_acquisition: Option<bool>,
    },
}

Defines how automatic type acquisition behaves.

When you have a JavaScript project in your editor, TypeScript will provide types for your node_modules automatically using the DefinitelyTyped set of @types definitions. This is called automatic type acquisition, and you can customize it using the typeAcquisition object in your configuration.

If you would like to disable or customize this feature, create a jsconfig.json in the root of your project:

{
  "typeAcquisition": {
    "enable": false
  }
}

If you have a specific module which should be included (but isn’t in node_modules):

{
  "typeAcquisition": {
    "include": ["jest"]
  }
}

If a module should not be automatically acquired, for example if the library is available in your node_modules but your team has agreed to not use it:

{
  "typeAcquisition": {
    "exclude": ["jquery"]
  }
}

In TypeScript 4.1, we added the ability to disable the special-casing where a filename would trigger type acquisition:

{
  "typeAcquisition": {
    "disableFilenameBasedTypeAcquisition": true
  }
}

This means that having a file like jquery.js in your project would not automatically download the types for JQuery from DefinitelyTyped.

Variants

Bool(bool)
Object
Show fields

Fields of Object

enable: boolinclude: Option<Vec<String>>exclude: Option<Vec<String>>disable_filename_based_type_acquisition: Option<bool>

Trait Implementations

impl Clone for TypeAcquisition[src]

impl Debug for TypeAcquisition[src]

impl<'de> Deserialize<'de> for TypeAcquisition[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.