Skip to content

no-unnecessary-polyfills: always triggered on core-js/{actual,full}/<feature> #2506

Open
@andreww2012

Description

@andreww2012

Hello! If the environment doesn't support <feature>, when I import from core-js/actual/<feature> or core-js/full/<feature>, no-unnecessary-polyfills rule is incorrectly triggered, but if I import it from es or stable, it is not.

Example:

// Reported - but the environment doesn't support `Array.prototype.toSpliced`:
import 'core-js/actual/array/to-spliced';
import 'core-js/full/array/to-spliced';

// Not reported as expected:
import 'core-js/es/array/to-spliced';
import 'core-js/stable/array/to-spliced';

Full reproduction: https://stackblitz.com/edit/vitejs-vite-zrgjkh?file=src%2Fmain.js

pnpm test

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions