When building web apps, you want to keep the bundles as small as possible. This rule can help prevent fully importing huge libraries. The plugin is flexible and doesn't impose any list of libraries.
Assuming that you select these libraries: ["lodash", "aws-sdk"]
, the following patterns are considered invalid:
🚫 import _ from 'lodash';
🚫 import 'lodash';
🚫 import { default as something } from 'aws-sdk';
🚫 import { s3 } from 'aws-sdk';
The following patterns are considered valid:
✅ import find from 'lodash/debounce';
✅ import find from 'aws-sdk/clients/s3';
If you do not care that an entire libary is being included into your bundle.