This plugin automatically adds @types/
packages into your dependencies when you add a package that doesn't include its own types.
yarn plugin import typescript
β― yarn/packages/plugin-typescript β― yarn add lodash
β€ BR0000: β Resolution step
β€ BR0002: β babel-preset-jest@npm:24.1.0 doesn't provide @babel/core@^7.0.0-0 requested by @babel/plugin-syntax-object-rest-spread@npm:7.2.0
β€ BR0000: β Completed in 0.24s
β€ BR0000: β Fetch step
β€ BR0013: β @types/lodash@npm:4.14.121 can't be found in the cache and will be fetched from the remote registry
β€ BR0000: β Completed in 3.63s
β€ BR0000: β Link step
β€ BR0005: β webpack-cli@npm:3.2.1 lists build scripts, but its build has been explicitly disabled through configuration.
β€ BR0005: β fsevents@npm:1.2.6 lists build scripts, but its build has been explicitly disabled through configuration.
β€ BR0005: β webpack-cli@npm:3.2.1 lists build scripts, but its build has been explicitly disabled through configuration.
β€ BR0005: β webpack-cli@npm:3.2.1 lists build scripts, but its build has been explicitly disabled through configuration.
β€ BR0000: β Completed in 2.75s
β€ BR0000: Done with warnings in 6.81s
As you can see in the fetch step, even though we only added lodash
into our dependencies, Yarn automatically figured out that we would need @types/lodash
, and added it before we ask it to.