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

feat: Enable setting Browserslist JS API options #587

Merged
merged 1 commit into from
Aug 27, 2023

Conversation

frehner
Copy link
Contributor

@frehner frehner commented Jul 27, 2023

In your ESLint config, you can now add settings.browserslistOpts to configure which settings to pass to the Browserslist JS API.

For example, this would change the environment that Browserslist uses from production (the default) to otherEnv:

{
  "settings": {
    "browserslistOpts": {
      "env": "otherEnv"
    }
  }
}

Closes #392 by allowing each ESLint config in a project to specify its own Browserslist env to choose from.

(I tested this in a personal repo and it works great!)

In your ESLint config, you can now add `settings.browserslistOpts` to configure which settings to pass to the [Browserslist JS API](https://github.com/browserslist/browserslist#js-api)
src/types.ts Show resolved Hide resolved
Copy link
Owner

@amilajack amilajack left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for this!

@amilajack amilajack merged commit ed1b34f into amilajack:main Aug 27, 2023
@amilajack
Copy link
Owner

@frehner I've cut a preminor release in eslint-plugin-compat@next that includes these changes. let me know if that works for you :)

@frehner
Copy link
Contributor Author

frehner commented Aug 27, 2023

I should be able to test it out tomorrow. Thanks!

@frehner frehner deleted the browserlistopts branch August 28, 2023 14:59
@frehner
Copy link
Contributor Author

frehner commented Aug 28, 2023

Things work well with that @next release. 👍

@amilajack
Copy link
Owner

awesome! cut to 4.2.0 🥳

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

Successfully merging this pull request may close these issues.

Allow multiple browserlist environments
2 participants