Avoid importing polyfill packages for features that are already available as built-ins in your target environments. Keeping unused polyfills in a project adds bundle weight and maintenance overhead without any benefit.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/sindresorhus/eslint-plugin-unicorn/llms.txt
Use this file to discover all available pages before exploring further.
| Recommended | ✅ recommended · ☑️ unopinionated |
targets option or, if that is not set, from the browserslist or engines field in the nearest package.json. It then cross-references imported module names against the core-js compatibility data to detect polyfills whose features are fully supported by all targets.
This rule requires either a
targets option or a browserslist/engines field in package.json. Without target information the rule does nothing.Examples
Options
Type:object
targets
Type: string | string[] | object
The target environments to check against. Accepts any value supported by the core-js-compat targets option: a Browserslist query string, an array of query strings, or a targets object.
When omitted, the rule falls back to the browserslist field in package.json, then the engines field.