The Wayback Machine - https://web.archive.org/web/20230117112231/https://github.com/parcel-bundler/parcel/pull/5340
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

Add flow types for browserslist #5340

Merged

Conversation

thebriando
Copy link
Member

↪️ Pull Request

Adds a flow type lib def for browserslist.

🚨 Test instructions

Run yarn flow to ensure that there are no flow errors.

@padmaia @wbinnssmith

@height
Copy link

height bot commented Nov 11, 2020

Link Height tasks by mentioning a task ID in the pull request title or description, commit messages, or comments.

💡Tip: You can also use "Close T-X" to automatically close a task when the pull request is merged.

flow-libs/browserslist.js.flow Outdated Show resolved Hide resolved
flow-libs/browserslist.js.flow Outdated Show resolved Hide resolved
declare module.exports: {|
(browsers: string | Array<string>): Array<string>,
parseConfig(configResult: ConfigResult): Promise<?BrowserslistConfig>,
loadConfig({[path: FilePath]: FilePath, ...}): string,
Copy link
Contributor

Choose a reason for hiding this comment

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

the first argument, options, is defined in browserlist's js api docs: https://github.com/browserslist/browserslist#js-api

flow-libs/browserslist.js.flow Outdated Show resolved Hide resolved
@@ -1,4 +1,5 @@
// @flow
// @flow strict-local
// flowlint unsafe-getters-setters: off
Copy link
Contributor

Choose a reason for hiding this comment

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

@devongovett @mischnic what do you think of allowing getters and setters globally? They do technically introduce potential unsoundness.

Copy link
Member

Choose a reason for hiding this comment

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

👍 We do use them extensively in the public interfaces. And I think as long as we keep them side-effect-free (which no linter can verify anyway), it should be fine regarding soundness.

flow-libs/browserslist.js.flow Outdated Show resolved Hide resolved
@wbinnssmith wbinnssmith merged commit 6100114 into parcel-bundler:v2 Nov 13, 2020
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.

None yet

3 participants