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

URLSearchParams.size not reported when targeting Safari / iOS <17 #611

Open
davidjayb opened this issue Feb 8, 2024 · 0 comments
Open

Comments

@davidjayb
Copy link

Support for URLSearchParams.size was introduced in Safari 17:

https://caniuse.com/?search=URLSearchParams.size

However, when targeting Safari versions before 17 the compat plugin doesn't flag this as an error:

new URLSearchParams().size

I dug through the code an noticed this reference:

https://github.com/amilajack/eslint-plugin-compat/blob/v4.2.0/src/rules/compat.ts#L116

 * A small optimization that only lints APIs that are not supported by targeted browsers.
 * For example, if the user is targeting chrome 50, which supports the fetch API, it is
 * wasteful to lint calls to fetch.

Does this mean that because Safari >17 supports a subset of the URLSearchParams API it will not be reported? It seems like the caniuse provider will only check for URLSearchParams but not looking for broad compatibility:

https://github.com/amilajack/eslint-plugin-compat/blob/v4.2.0/src/providers/caniuse-provider.ts#L169

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

No branches or pull requests

1 participant