Skip to content

feat(eslint): add compat eslint plugin - #364

Open
ghost wants to merge 1 commit into
masterfrom
add-eslint-compat-plugin
Open

feat(eslint): add compat eslint plugin#364
ghost wants to merge 1 commit into
masterfrom
add-eslint-compat-plugin

Conversation

@ghost

@ghost ghost commented Mar 10, 2021

Copy link
Copy Markdown

This adds https://www.npmjs.com/package/eslint-plugin-compat. This plugin checks the js APIs you're using against your browserslist. It'll warn you when you're using js APIs that aren't supported by your target audience.

As long as we're sticking to stable browser features, and not polyfilling with babel to features that haven't shipped with browsers yet, this is a useful plugin to have (and even if we do it can be useful, just means that we need to define the polyfills we ship).

@ghost
ghost requested review from HendrikThePendric, amcgee and varl March 10, 2021 10:27

@HendrikThePendric HendrikThePendric left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Seems like another good addition 👍

@ghost
ghost force-pushed the add-eslint-compat-plugin branch from 539a9b3 to e448da7 Compare March 10, 2021 10:50
@ghost

ghost commented Mar 10, 2021

Copy link
Copy Markdown
Author

I've changed the approach here slightly. The recommended preset of this plugin sets all violations to errors, and since our browserslist includes opera mini, most our codebases will fail linting as that browser doesn't support promises:

Screenshot 2021-03-10 at 11 45 49

We could remove opera mini from our browserslist if we don't support it, and otherwise we should ship a promise polyfill. Until then, I'll leave this rule on warn. Once we've decided what we want to do about the above, we could move the rule to error (and potentially configure the plugin so it knows we're shipping a promise polyfill).

@amcgee amcgee left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice to have confidence in browser compatibility!

We should probably exclude Opera Mini, otherwise we will definitely need the polyfill

@stale

stale Bot commented Mar 2, 2022

Copy link
Copy Markdown

Hi!

Due to a lack of activity on this issue over time (180 days) it seems to be stale. If still relevant, please provide information that moves it forward, e.g. additional information, a pull request with suggested changes, or a reason to keep it open.

Any activity will keep it open, otherwise it will be closed automatically in 30 days. Thanks! 🤖

@stale stale Bot added the stale label Mar 2, 2022
@stale

stale Bot commented Apr 16, 2022

Copy link
Copy Markdown

Automatically closing due to lack of activity. 🤖

@stale stale Bot closed this Apr 16, 2022
@ghost ghost reopened this Oct 11, 2022
@ghost
ghost removed the request for review from varl October 11, 2022 08:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants