Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

no-unnecessary-polyfills: respect .browserslistrc #2389

Open
RebeccaStevens opened this issue Jun 24, 2024 · 0 comments
Open

no-unnecessary-polyfills: respect .browserslistrc #2389

RebeccaStevens opened this issue Jun 24, 2024 · 0 comments

Comments

@RebeccaStevens
Copy link

Description

Currently it will respect a browserlist field in package.json but it would be great if it could also respect the .browserslistrc file.

This will be a little more complicated though as that file can define multiple targets, so an option as to which target to respect would also need to be added, defaulting to production.

Fail

# .browserslistrc

[production]
since 2024

[development]
last 1 version
if (!("groupBy" in Object)) {
  import("object.groupby").then(({ shim }) => shim())
}

Pass

# .browserslistrc

[production]
since 2020

[development]
last 1 version
if (!("groupBy" in Object)) {
  import("object.groupby").then(({ shim }) => shim())
}

Additional Info

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants