What does HackerNews think of eslint-plugin-compat?

Check the browser compatibility of your code

Language: TypeScript

#15 in API
Can any browser that is not a reskin of Chrome with feature and bug-for-bug parity actually satisfy web developers at this point?

If Firefox had the marketshare of Safari and was mandatory to support because they were a major platform’s browser devs would be cursing their name too but with a different set of things that aren’t exactly like Chrome.

It really does feel like devs are literally developing against Chrome with not even so much a thought at cross-browser compat or a glance at caniuse and then taking their finished site and then working backwards from there on other browsers cursing the compatibility issues when they could have avoided it entirely had they started with a cross-platform subset of browser features. Just the same as how cross-platform native development works.

Hell someone did all the hard work for you https://github.com/amilajack/eslint-plugin-compat

Then multiply by all the npm packages blindly imported that were developed with the same methodology and I see where the rage comes from.

eslint-plugin-compat [0] and stylelint-no-unsupported-browser-features [1] can help you know when you're using an unsupported browser feature.

[0] https://github.com/amilajack/eslint-plugin-compat

[1] https://github.com/ismay/stylelint-no-unsupported-browser-fe...

Browserlist [1] makes use of the browser market shares and you can use it with plugins such as eslint-plugin-compat [2].

[1] https://github.com/browserslist/browserslist [2] https://github.com/amilajack/eslint-plugin-compat

It's probably easier to find tools by searching GitHub instead of SO. It looks like doiuse also comes as a PostCSS plugin so you could have better compile time linter integration with that[0]. There's also a similar plugin for ESLint called eslint-plugin-compat which checks for JS cross browser compatibility[1].

You can also set up automation via WebDriver for cross-browser functional and visual testing if you really want to be sure everything works well. WebDriverIO is good for that[2]. Unless you're going to sink over 1000 hours into the project it's probably not worth it though. It's notoriously tricky to set up correctly if you haven't done it before.

[0] https://github.com/anandthakker/doiuse

[1] https://github.com/amilajack/eslint-plugin-compat

[2] https://webdriver.io/