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)
Show fields
Trait Implementations
impl Clone for TypeAcquisition
[src]
impl Clone for TypeAcquisition
[src]fn clone(&self) -> TypeAcquisition
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<'de> Deserialize<'de> for TypeAcquisition
[src]
impl<'de> Deserialize<'de> for TypeAcquisition
[src]fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
Auto Trait Implementations
impl RefUnwindSafe for TypeAcquisition
impl RefUnwindSafe for TypeAcquisition
impl Send for TypeAcquisition
impl Send for TypeAcquisition
impl Sync for TypeAcquisition
impl Sync for TypeAcquisition
impl Unpin for TypeAcquisition
impl Unpin for TypeAcquisition
impl UnwindSafe for TypeAcquisition
impl UnwindSafe for TypeAcquisition
Blanket Implementations
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]